--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Test;
+
+namespace Tizen.NUI.Tests
+{
+
+ [TestFixture]
+ [Description("Tizen.NUI.DragAndDrop Tests")]
+ public class DragAndDropTests
+ {
+ private string TAG = "NUI";
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, "Init() is called!");
+ App.MainTitleChangeText("DragAndDropTests");
+ App.MainTitleChangeBackgroundColor(null);
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, "Destroy() is called!");
+ }
+
+ private void OnSourceEventFunc(DragSourceEventType type)
+ {
+ Tizen.Log.Info(TAG, "Drag Source Event Function is called!");
+ }
+
+ private void OnTargetEventFunc(View targetView, DragEvent dragEvent)
+ {
+ Tizen.Log.Info(TAG, "Target Event Function is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DragAndDrop constructor test, create a DragAndDrop instance.")]
+ [Property("SPEC", "Tizen.NUI.DragAndDrop.Instance A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Taehyub Kim, taehyub.kim@samsung.com")]
+ public void Instance_GET_VALUE()
+ {
+ /* TEST CODE */
+ var dnd = DragAndDrop.Instance;
+ Assert.IsInstanceOf<DragAndDrop>(dnd, "Should return DragAndDrop instance.");
+ Assert.IsNotNull(dnd, "Object should not be null");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test StartDragAndDrop. Check whether the start drag and drop works.")]
+ [Property("SPEC", "Tizen.NUI.DragAndDrop.StartDragAndDrop M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Taehyub Kim, taehyub.kim@samsung.com")]
+ public void StartDragAndDrop_CHECK_RETURN_VALUE()
+ {
+ /* TEST CODE */
+ try
+ {
+ var window = Window.Instance;
+
+ var dnd = DragAndDrop.Instance;
+ var sourceView = new ImageView();
+ window.Add(sourceView);
+
+ var shadowView = new ImageView();
+
+ DragData dragData;
+ dragData.MimeType = "text/uri-list";
+ dragData.Data = "ImagePathHere";
+
+ dnd.StartDragAndDrop(sourceView, shadowView, dragData, OnSourceEventFunc);
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test AddListener. Check whether the adding listener works.")]
+ [Property("SPEC", "Tizen.NUI.DragAndDrop.AddListener M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Taehyub Kim, taehyub.kim@samsung.com")]
+ public void AddListener_CHECK_RETURN_VALUE()
+ {
+ /* TEST CODE */
+ try
+ {
+ var dnd = DragAndDrop.Instance;
+ var targetView = new ImageView();
+ dnd.AddListener(targetView, OnTargetEventFunc);
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test RemoveListener. Check whether the removing listener works.")]
+ [Property("SPEC", "Tizen.NUI.DragAndDrop.RemoveListener M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Taehyub Kim, taehyub.kim@samsung.com")]
+ public void RemoveListener_CHECK_RETURN_VALUE()
+ {
+ /* TEST CODE */
+ try
+ {
+ var dnd = DragAndDrop.Instance;
+ var targetView = new ImageView();
+ dnd.AddListener(targetView, OnTargetEventFunc);
+ dnd.RemoveListener(targetView, OnTargetEventFunc);
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+ }
+}