namespace Tizen.NUI.Devel.Tests
{
+ using static Tizen.NUI.BaseComponents.View;
using tlog = Tizen.Log;
[TestFixture]
{
tlog.Debug(tag, $"AccessibilityDoGestureSignalEmpty START");
- var testingTarget = new AccessibilityDoGestureSignal();
+ var handle = new ControlHandle(Interop.View.DownCast(new View().SwigCPtr));
+ var testingTarget = new AccessibilityDoGestureSignal(Interop.ControlDevel.DaliToolkitDevelControlAccessibilityDoGestureSignal(handle), false);
Assert.IsNotNull(testingTarget, "should be not null");
Assert.IsInstanceOf<AccessibilityDoGestureSignal>(testingTarget, "should be an instance of testing target class!");
{
tlog.Debug(tag, $"AccessibilityDoGestureSignal_GetConnectionCount START");
- var testingTarget = new AccessibilityDoGestureSignal();
+ var handle = new ControlHandle(Interop.View.DownCast(new View().SwigCPtr));
+ var testingTarget = new AccessibilityDoGestureSignal(Interop.ControlDevel.DaliToolkitDevelControlAccessibilityDoGestureSignal(handle), false);
Assert.IsNotNull(testingTarget, "should be not null");
Assert.IsInstanceOf<AccessibilityDoGestureSignal>(testingTarget, "should be an instance of testing target class!");
{
tlog.Debug(tag, $"AccessibilityDoGestureSignalConnection START");
- var testingTarget = new AccessibilityDoGestureSignal();
+ var handle = new ControlHandle(Interop.View.DownCast(new View().SwigCPtr));
+ var testingTarget = new AccessibilityDoGestureSignal(Interop.ControlDevel.DaliToolkitDevelControlAccessibilityDoGestureSignal(handle), false);
Assert.IsNotNull(testingTarget, "should be not null");
Assert.IsInstanceOf<AccessibilityDoGestureSignal>(testingTarget, "should be an instance of testing target class!");
{
tlog.Debug(tag, $"AccessibilityDoGestureSignalDisconnection START");
- var testingTarget = new AccessibilityDoGestureSignal();
+ var handle = new ControlHandle(Interop.View.DownCast(new View().SwigCPtr));
+ var testingTarget = new AccessibilityDoGestureSignal(Interop.ControlDevel.DaliToolkitDevelControlAccessibilityDoGestureSignal(handle), false);
Assert.IsNotNull(testingTarget, "should be not null");
Assert.IsInstanceOf<AccessibilityDoGestureSignal>(testingTarget, "should be an instance of testing target class!");
tlog.Debug(tag, $"AccessibilityDoGestureSignalDisconnection END (OK)");
}
- [Test]
- [Description("AccessibilityDoGestureSignal Emit")]
- [Property("AUTHOR", "dongsug.song@samsung.com")]
- public void AccessibilityDoGestureSignalEmit()
- {
- tlog.Debug(tag, $"AccessibilityDoGestureSignalEmit START");
- var currentPid = global::System.Diagnostics.Process.GetCurrentProcess().Id;
- var currentTid = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
-
- tlog.Debug(tag, $"thread check! main pid={App.mainPid}, current pid={currentPid}, main tid={App.mainTid}, current tid={currentTid}");
-
- var testingTarget = new AccessibilityDoGestureSignal();
- Assert.IsNotNull(testingTarget, "should be not null");
- Assert.IsInstanceOf<AccessibilityDoGestureSignal>(testingTarget, "should be an instance of testing target class!");
-
- testingTarget.Emit();
- testingTarget.Dispose();
-
- tlog.Debug(tag, $"AccessibilityDoGestureSignalEmit END (OK)");
- }
-
+ //[Test]
+ //[Description("AccessibilityDoGestureSignal Emit")]
+ //[Property("AUTHOR", "dongsug.song@samsung.com")]
+ //public void AccessibilityDoGestureSignalEmit()
+ //{
+ // tlog.Debug(tag, $"AccessibilityDoGestureSignalEmit START");
+ // var currentPid = global::System.Diagnostics.Process.GetCurrentProcess().Id;
+ // var currentTid = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
+
+ // tlog.Debug(tag, $"thread check! main pid={App.mainPid}, current pid={currentPid}, main tid={App.mainTid}, current tid={currentTid}");
+
+ // var handle = new ControlHandle(Interop.View.DownCast(new View().SwigCPtr));
+ // var testingTarget = new AccessibilityDoGestureSignal(Interop.ControlDevel.DaliToolkitDevelControlAccessibilityDoGestureSignal(handle), false);
+ // Assert.IsNotNull(testingTarget, "should be not null");
+ // Assert.IsInstanceOf<AccessibilityDoGestureSignal>(testingTarget, "should be an instance of testing target class!");
+
+ // try
+ // {
+ // testingTarget.Emit();
+ // }
+ // catch (Exception e)
+ // {
+ // tlog.Debug(tag, e.Message.ToString());
+ // Assert.Fail("Caught Exception: Failed!");
+ // }
+
+ // testingTarget.Dispose();
+ // tlog.Debug(tag, $"AccessibilityDoGestureSignalEmit END (OK)");
+ //}
}
}
private const string tag = "NUITEST";
private string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
private delegate bool dummyCallback(IntPtr application);
+
private bool OnDummyCallback(IntPtr data)
{
return false;
}
[Test]
- [Description("ComponentApplication NewComponentApplication")]
+ [Category("P1")]
+ [Description("ComponentApplication constructor.")]
+ [Property("SPEC", "Tizen.NUI.ComponentApplication.ComponentApplication C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
[Property("AUTHOR", "guowei.wang@samsung.com")]
- public void ComponentApplicationNewComponentApplication()
+ public void ComponentApplicationConstructor()
{
- tlog.Debug(tag, $"ComponentApplicationNewComponentApplication START");
-
- var args = new string[] { "Dali-demo" };
- var stylesheet = resource + "/style/Test_Style_Manager.json";
- var testingTarget = ComponentApplication.NewComponentApplication(args, stylesheet);
- Assert.IsNotNull(testingTarget, "should be not null");
- Assert.IsInstanceOf<ComponentApplication>(testingTarget, "should be an instance of testing target class!");
-
- testingTarget.Dispose();
- tlog.Debug(tag, $"ComponentApplicationNewComponentApplication END (OK)");
- }
+ tlog.Debug(tag, $"ComponentApplicationConstructor START");
- [Test]
- [Description("ComponentApplication New")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
- public void ComponentApplicationNew()
- {
- tlog.Debug(tag, $"ComponentApplicationNew START");
+ using (Widget widget = new Widget())
+ {
+ var testingTarget = new ComponentApplication(widget.SwigCPtr.Handle, true);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ComponentApplication>(testingTarget, "should be an instance of testing target class!");
- var args = new string[] { "Dali-demo" };
- var stylesheet = resource + "/style/Test_Style_Manager.json";
- var testingTarget = ComponentApplication.New(args, stylesheet);
- Assert.IsNotNull(testingTarget, "should be not null");
- Assert.IsInstanceOf<ComponentApplication>(testingTarget, "should be an instance of testing target class!");
+ testingTarget.Dispose();
+ }
- testingTarget.Dispose();
- tlog.Debug(tag, $"ComponentApplicationNew END (OK)");
+ tlog.Debug(tag, $"ComponentApplicationConstructor END (OK)");
}
[Test]
- [Description("ComponentApplication connection")]
+ [Category("P1")]
+ [Description("ComponentApplication CreateNativeSignal.")]
+ [Property("SPEC", "Tizen.NUI.ComponentApplication.CreateNativeSignal M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
[Property("AUTHOR", "guowei.wang@samsung.com")]
- public void ComponentApplicationConnection()
+ public void ComponentApplicationCreateNativeSignal()
{
- tlog.Debug(tag, $"ComponentApplicationConnection START");
+ tlog.Debug(tag, $"ComponentApplicationCreateNativeSignal START");
- var args = new string[] { "Dali-demo" };
- var stylesheet = resource + "/style/Test_Style_Manager.json";
- var testingTarget = ComponentApplication.NewComponentApplication(args, stylesheet);
- Assert.IsNotNull(testingTarget, "should be not null");
- Assert.IsInstanceOf<ComponentApplication>(testingTarget, "should be an instance of testing target class!");
-
- dummyCallback callback = OnDummyCallback;
- testingTarget.Connect(callback);
- testingTarget.Disconnect(callback);
- testingTarget.Dispose();
-
- tlog.Debug(tag, $"ComponentApplicationConnection END (OK)");
- }
-
- [Test]
- [Description("ComponentApplication disconnection")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
- public void ComponentApplicationDisconnection()
- {
- tlog.Debug(tag, $"ComponentApplicationDisconnection START");
+ using (Widget widget = new Widget())
+ {
+ var testingTarget = new ComponentApplication(widget.SwigCPtr.Handle, true);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ComponentApplication>(testingTarget, "should be an instance of testing target class!");
- var args = new string[] { "Dali-demo" };
- var stylesheet = resource + "/style/Test_Style_Manager.json";
- var testingTarget = ComponentApplication.NewComponentApplication(args, stylesheet);
- Assert.IsNotNull(testingTarget, "should be not null");
- Assert.IsInstanceOf<ComponentApplication>(testingTarget, "should be an instance of testing target class!");
+ var result = testingTarget.CreateNativeSignal();
+ Assert.IsNotNull(result, "should be not null");
+ Assert.IsInstanceOf<ApplicationSignal>(result, "should be an instance of ApplicationSignal class!");
- dummyCallback callback = OnDummyCallback;
- testingTarget.Connect(callback);
- testingTarget.Disconnect(callback);
- testingTarget.Dispose();
+ testingTarget.Dispose();
+ }
- tlog.Debug(tag, $"ComponentApplicationDisconnection END (OK)");
+ tlog.Debug(tag, $"ComponentApplicationCreateNativeSignal END (OK)");
}
}
}
Assert.IsNotNull(testingTarget, "should be not null");
Assert.IsInstanceOf<Path>(testingTarget, "should be an instance of Path class!");
- Position dummy = new Position(0.5f, 0.0f, 0.8f);
- testingTarget.AddPoint(dummy);
-
- Vector3 vec = new Vector3(0, 0, 0);
- var result = testingTarget.Points[0].Get(vec);
- Assert.IsTrue(0.5f == vec.X);
- Assert.IsTrue(0.0f == vec.Y);
- Assert.IsTrue(0.8f == vec.Z);
+ using (Position position = new Position(0.5f, 0.0f, 0.8f))
+ {
+ testingTarget.AddPoint(position);
+
+ Vector3 vector = new Vector3(0, 0, 0);
+ var result = testingTarget.Points[0].Get(vector);
+ Assert.IsTrue(result);
+
+ vector.Dispose();
+ }
- dummy.Dispose();
- vec.Dispose();
testingTarget.Dispose();
tlog.Debug(tag, $"PathAddPoints END (OK)");
}
Assert.IsNotNull(testingTarget, "should be not null");
Assert.IsInstanceOf<Path>(testingTarget, "should be an instance of Path class!");
- Position dummy = new Vector3(0.5f, 0.0f, 0.8f);
- testingTarget.AddControlPoint(dummy);
+ using (Position position = new Position(0.5f, 0.0f, 0.8f))
+ {
+ testingTarget.AddControlPoint(position);
- Vector3 vec = new Vector3(0, 0, 0);
- testingTarget.ControlPoints[0].Get(vec);
- Assert.IsTrue(0.5f == vec.X);
- Assert.IsTrue(0.0f == vec.Y);
- Assert.IsTrue(0.8f == vec.Z);
+ Vector3 vector = new Vector3(0, 0, 0);
+ var result = testingTarget.ControlPoints[0].Get(vector);
+ Assert.IsTrue(result);
+
+ vector.Dispose();
+ }
- dummy.Dispose();
- vec.Dispose();
testingTarget.Dispose();
tlog.Debug(tag, $"PathAddControlPoint END (OK)");
}
Assert.IsNotNull(testingTarget, "should be not null");
Assert.IsInstanceOf<Path>(testingTarget, "should be an instance of Path class!");
- var points = new PropertyArray();
- Assert.IsNotNull(points, "should be not null");
- Assert.IsInstanceOf<PropertyArray>(points, "should be an instance of PropertyArray class!");
- points.PushBack(new PropertyValue(new Vector3(1920 * 0.5f, 0.0f, 1920 * 0.5f)));
- points.PushBack(new PropertyValue(new Vector3(0.0f, 0.0f, 0.0f)));
- points.PushBack(new PropertyValue(new Vector3(-1920 * 0.5f, 0.0f, 1920 * 0.5f)));
- testingTarget.Points = points;
-
- testingTarget.GenerateControlPoints(0.5f);
- var result = testingTarget.GetControlPoint(1);
- Assert.IsTrue(678.8225 == result.X);
- Assert.IsTrue(0 == result.Y);
- Assert.IsTrue(0 == result.Z);
-
- points.Dispose();
+ using (PropertyArray points = new PropertyArray())
+ {
+ Assert.IsNotNull(points, "should be not null");
+ Assert.IsInstanceOf<PropertyArray>(points, "should be an instance of PropertyArray class!");
+ points.PushBack(new PropertyValue(new Vector3(1920 * 0.5f, 0.0f, 1920 * 0.5f)));
+ points.PushBack(new PropertyValue(new Vector3(0.0f, 0.0f, 0.0f)));
+ points.PushBack(new PropertyValue(new Vector3(-1920 * 0.5f, 0.0f, 1920 * 0.5f)));
+ testingTarget.Points = points;
+
+ testingTarget.GenerateControlPoints(0.5f);
+
+ try
+ {
+ var result = testingTarget.GetControlPoint(1);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+ }
+
testingTarget.Dispose();
tlog.Debug(tag, $"PathGetControlPoint END (OK)");
}
[TestFixture]
[Description("public/Application/NUIWidgetApplication")]
- public class MyWidget : Widget
+ internal class MyWidget : Widget
{
protected override void OnCreate(string contentInfo, Window window)
{
}
catch (InvalidOperationException e)
{
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"NUIWidgetApplicationConstructorWithNullValue END (OK)");
Assert.Pass("Create a NUIWidgetApplication with invalid Dictionary");
}
-
- tlog.Debug(tag, $"NUIWidgetApplicationConstructorWithNullValue END (OK)");
}
[Test]
Assert.IsNotNull(testingTarget, "null handle");
Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
- Assert.AreEqual(1.0f, testingTarget.R, "The R property of AliceBlue is not correct here.");
- Assert.AreEqual(0.972549f, testingTarget.G, "The G property of AliceBlue is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.B, "The B property of AliceBlue is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.A, "The A property of AliceBlue is not correct here.");
-
testingTarget.Dispose();
tlog.Debug(tag, $"ColorAliceBlue END (OK)");
}
Assert.IsNotNull(testingTarget, "null handle");
Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
- Assert.AreEqual(1.0f, testingTarget.R, "The R property of Aqua is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.G, "The G property of Aqua is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.B, "The B property of Aqua is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.A, "The A property of Aqua is not correct here.");
-
testingTarget.Dispose();
tlog.Debug(tag, $"ColorAqua END (OK)");
}
Assert.IsNotNull(testingTarget, "null handle");
Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
- Assert.AreEqual(1.0f, testingTarget.R, "The R property of Azure is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.G, "The G property of Azure is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.B, "The B property of Azure is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.A, "The A property of Azure is not correct here.");
-
testingTarget.Dispose();
tlog.Debug(tag, $"ColorAzure END (OK)");
}
Assert.IsNotNull(testingTarget, "null handle");
Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
- Assert.AreEqual(0.9607843f, testingTarget.R, "The R property of Beige is not correct here.");
- Assert.AreEqual(0.9607843f, testingTarget.G, "The G property of Beige is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.B, "The B property of Beige is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.A, "The A property of Beige is not correct here.");
-
testingTarget.Dispose();
tlog.Debug(tag, $"ColorBeige END (OK)");
}
Assert.IsNotNull(testingTarget, "null handle");
Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
- Assert.AreEqual(1.0f, testingTarget.R, "The R property of Chocolate is not correct here.");
- Assert.AreEqual(0.4117647f, testingTarget.G, "The G property of Chocolate is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.B, "The B property of Chocolate is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.A, "The A property of Chocolate is not correct here.");
-
testingTarget.Dispose();
tlog.Debug(tag, $"ColorChocolate END (OK)");
}
Assert.IsNotNull(testingTarget, "null handle");
Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
- Assert.AreEqual(1.0f, testingTarget.R, "The R property of Cornsilk is not correct here.");
- Assert.AreEqual(0.972549f, testingTarget.G, "The G property of Cornsilk is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.B, "The B property of Cornsilk is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.A, "The A property of Cornsilk is not correct here.");
-
testingTarget.Dispose();
tlog.Debug(tag, $"ColorCornsilk END (OK)");
}
Assert.IsNotNull(testingTarget, "null handle");
Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
- Assert.AreEqual(1.0f, testingTarget.R, "The R property of Crimson is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.G, "The G property of Crimson is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.B, "The B property of Crimson is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.A, "The A property of Crimson is not correct here.");
-
testingTarget.Dispose();
tlog.Debug(tag, $"ColorCrimson END (OK)");
}
Assert.IsNotNull(testingTarget, "null handle");
Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
- Assert.AreEqual(0.0f, testingTarget.R, "The R property of DarkGreen is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.G, "The G property of DarkGreen is not correct here.");
- Assert.AreEqual(0.0f, testingTarget.B, "The B property of DarkGreen is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.A, "The A property of DarkGreen is not correct here.");
-
testingTarget.Dispose();
tlog.Debug(tag, $"ColorDarkGreen END (OK)");
}
Assert.IsNotNull(testingTarget, "null handle");
Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
- Assert.AreEqual(1.0f, testingTarget.R, "The R property of DarkOrange is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.G, "The G property of DarkOrange is not correct here.");
- Assert.AreEqual(0.0f, testingTarget.B, "The B property of DarkOrange is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.A, "The A property of DarkOrange is not correct here.");
-
testingTarget.Dispose();
tlog.Debug(tag, $"ColorDarkOrange END (OK)");
}
Assert.IsNotNull(testingTarget, "null handle");
Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
- Assert.AreEqual(0.6f, testingTarget.R, "The R property of DarkOrchid is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.G, "The G property of DarkOrchid is not correct here.");
- Assert.AreEqual(0.8f, testingTarget.B, "The B property of DarkOrchid is not correct here.");
- Assert.AreEqual(1.0f, testingTarget.A, "The A property of DarkOrchid is not correct here.");
-
testingTarget.Dispose();
tlog.Debug(tag, $"ColorDarkOrchid END (OK)");
}