{
tlog.Debug(tag, $"NativeImageInterfaceConstructor START");
- using (ImageView view = new ImageView())
+ var testingTarget = new NativeImageSource(100, 50, NativeImageSource.ColorDepth.Default);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<NativeImageSource>(testingTarget, "Should be an Instance of NativeImageSource!");
+
+ tlog.Debug(tag, "getCPtr : " + NativeImageInterface.getCPtr(testingTarget));
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"NativeImageInterfaceConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("NativeImageInterface TargetTexture.")]
+ [Property("SPEC", "Tizen.NUI.NativeImageInterface.TargetTexture M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void NativeImageInterfaceTargetTexture()
+ {
+ tlog.Debug(tag, $"NativeImageInterfaceTargetTexture START");
+
+ var testingTarget = new NativeImageSource(100, 50, NativeImageSource.ColorDepth.Default);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<NativeImageSource>(testingTarget, "Should be an Instance of NativeImageSource!");
+
+ try
+ {
+ testingTarget.TargetTexture();
+ }
+ catch (Exception e)
{
- var testingTarget = new NativeImageInterface(view.SwigCPtr.Handle, false);
- Assert.IsNotNull(testingTarget, "Should be not null!");
- Assert.IsInstanceOf<NativeImageInterface>(testingTarget, "Should be an Instance of NativeImageInterface!");
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ tlog.Debug(tag, $"NativeImageInterfaceTargetTexture END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("NativeImageInterface PrepareTexture.")]
+ [Property("SPEC", "Tizen.NUI.NativeImageInterface.PrepareTexture M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void NativeImageInterfacePrepareTexture()
+ {
+ tlog.Debug(tag, $"NativeImageInterfacePrepareTexture START");
+
+ var testingTarget = new NativeImageSource(100, 50, NativeImageSource.ColorDepth.Default);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<NativeImageSource>(testingTarget, "Should be an Instance of NativeImageSource!");
- testingTarget.Dispose();
+ try
+ {
+ testingTarget.PrepareTexture();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"NativeImageInterfaceConstructor END (OK)");
+ tlog.Debug(tag, $"NativeImageInterfacePrepareTexture END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("NativeImageInterface GetWidth.")]
+ [Property("SPEC", "Tizen.NUI.NativeImageInterface.GetWidth M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void NativeImageInterfaceGetWidth()
+ {
+ tlog.Debug(tag, $"NativeImageInterfaceGetWidth START");
+
+ var testingTarget = new NativeImageSource(100, 50, NativeImageSource.ColorDepth.Default);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<NativeImageSource>(testingTarget, "Should be an Instance of NativeImageSource!");
+
+ var width = testingTarget.GetWidth();
+ Assert.AreEqual(100, width, "should be equal!");
+ var height = testingTarget.GetHeight();
+ Assert.AreEqual(50, height, "should be equal!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"NativeImageInterfaceGetWidth END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("NativeImageInterface RequiresBlending.")]
+ [Property("SPEC", "Tizen.NUI.NativeImageInterface.RequiresBlending M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void NativeImageInterfaceRequiresBlending()
+ {
+ tlog.Debug(tag, $"NativeImageInterfaceRequiresBlending START");
+
+ var testingTarget = new NativeImageSource(100, 50, NativeImageSource.ColorDepth.Default);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<NativeImageSource>(testingTarget, "Should be an Instance of NativeImageSource!");
+
+ var result = testingTarget.RequiresBlending();
+ tlog.Debug(tag, "RequiresBlending : " + result);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"NativeImageInterfaceRequiresBlending END (OK)");
}
}
}
Assert.IsNotNull(testingTarget, "null handle");
Assert.IsInstanceOf<ObjectRegistry>(testingTarget, "Should return ObjectRegistry instance.");
+ tlog.Debug(tag, "getCPtr : " + ObjectRegistry.getCPtr(testingTarget));
+
testingTarget.Dispose();
tlog.Debug(tag, $"ObjectRegistryConstructor END (OK)");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("ObjectRegistry ObjectCreatedEventArgs .")]
+ [Property("SPEC", "Tizen.NUI.ObjectRegistry.ObjectCreatedEventArgs A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ObjectRegistryObjectCreatedEventArgs()
+ {
+ tlog.Debug(tag, $"ObjectRegistryObjectCreatedEventArgs START");
+
+ var testingTarget = new Tizen.NUI.ObjectRegistry.ObjectCreatedEventArgs();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<Tizen.NUI.ObjectRegistry.ObjectCreatedEventArgs>(testingTarget, "Should return ObjectCreatedEventArgs instance.");
+
+ using (View view = new View())
+ {
+ testingTarget.BaseHandle = view;
+ tlog.Debug(tag, "BaseHandle : " + testingTarget.BaseHandle);
+ }
+
+ tlog.Debug(tag, $"ObjectRegistryObjectCreatedEventArgs END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObjectRegistry ObjectDestroyedEventArgs .")]
+ [Property("SPEC", "Tizen.NUI.ObjectRegistry.ObjectDestroyedEventArgs A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ObjectRegistryObjectDestroyedEventArgs()
+ {
+ tlog.Debug(tag, $"ObjectRegistryObjectDestroyedEventArgs START");
+
+ var testingTarget = new Tizen.NUI.ObjectRegistry.ObjectDestroyedEventArgs();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<Tizen.NUI.ObjectRegistry.ObjectDestroyedEventArgs>(testingTarget, "Should return ObjectDestroyedEventArgs instance.");
+
+ using (View view = new View())
+ {
+ RefObject obj = RefObject.GetRefObjectFromPtr(view.SwigCPtr.Handle);
+ testingTarget.RefObject = obj;
+ tlog.Debug(tag, "RefObject : " + testingTarget.RefObject);
+ }
+
+ tlog.Debug(tag, $"ObjectRegistryObjectDestroyedEventArgs END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObjectRegistry ObjectRegistry .")]
+ [Property("SPEC", "Tizen.NUI.ObjectRegistry.ObjectRegistry C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ObjectRegistryObjectRegistry()
+ {
+ tlog.Debug(tag, $"ObjectRegistryObjectRegistry START");
+
+ using (ObjectRegistry obj = new ObjectRegistry(new View().SwigCPtr.Handle, false))
+ {
+ var testingTarget = new ObjectRegistry(obj);
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<ObjectRegistry>(testingTarget, "Should return ObjectRegistry instance.");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"ObjectRegistryObjectRegistry END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObjectRegistry Assign .")]
+ [Property("SPEC", "Tizen.NUI.ObjectRegistry.Assign M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ObjectRegistryAssign()
+ {
+ tlog.Debug(tag, $"ObjectRegistryAssign START");
+
+ using (ObjectRegistry obj = new ObjectRegistry(new View().SwigCPtr.Handle, false))
+ {
+ var testingTarget = obj.Assign(obj);
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<ObjectRegistry>(testingTarget, "Should return ObjectRegistry instance.");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"ObjectRegistryAssign END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObjectRegistry ObjectCreatedSignal .")]
+ [Property("SPEC", "Tizen.NUI.ObjectRegistry.ObjectCreatedSignal M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ObjectRegistryObjectCreatedSignal()
+ {
+ tlog.Debug(tag, $"ObjectRegistryObjectCreatedSignal START");
+
+ using (View view = new View())
+ {
+ var testingTarget = new ObjectRegistry(view.SwigCPtr.Handle, false);
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<ObjectRegistry>(testingTarget, "Should return ObjectRegistry instance.");
+
+ var createdSignal = testingTarget.ObjectCreatedSignal();
+ Assert.IsInstanceOf<ObjectCreatedSignal>(createdSignal, "Should return ObjectCreatedSignal instance.");
+
+ var destroyedSignal = testingTarget.ObjectDestroyedSignal();
+ Assert.IsInstanceOf<ObjectDestroyedSignal>(destroyedSignal, "Should return ObjectDestroyedSignal instance.");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"ObjectRegistryObjectCreatedSignal END (OK)");
+ }
}
}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("internal/Common/PropertyRegistration")]
+ public class InternalPropertyRegistrationTest
+ {
+ private const string tag = "NUITEST";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("PropertyRegistration constructor.")]
+ [Property("SPEC", "Tizen.NUI.PropertyRegistration.PropertyRegistration C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PropertyRegistrationConstructor()
+ {
+ tlog.Debug(tag, $"PropertyRegistrationConstructor START");
+
+ using (View view = new View())
+ {
+
+ TypeRegistration registration = new TypeRegistration(view.SwigCPtr.Handle, false);
+ SWIGTYPE_p_f_p_Dali__BaseObject_int_r_q_const__Dali__Property__Value__void set = new SWIGTYPE_p_f_p_Dali__BaseObject_int_r_q_const__Dali__Property__Value__void(View.getCPtr(view).Handle);
+ SWIGTYPE_p_f_p_Dali__BaseObject_Dali__Property__Index__Dali__Property__Value get = new SWIGTYPE_p_f_p_Dali__BaseObject_Dali__Property__Index__Dali__Property__Value(View.getCPtr(view).Handle);
+
+ var testingTarget = new PropertyRegistration(registration, "mytest", 10000001, PropertyType.Float, set, get);
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<PropertyRegistration>(testingTarget, "Should return PropertyRegistration instance.");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"PropertyRegistrationConstructor END (OK)");
+ }
+ }
+}
// tlog.Debug(tag, $"RenderTaskSetSourceView END (OK)");
//}
- //[Test]
- //[Category("P1")]
- //[Description("RenderTask SetExclusive.")]
- //[Property("SPEC", "Tizen.NUI.RenderTask.SetExclusive M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void RenderTaskSetExclusive()
- //{
- // tlog.Debug(tag, $"RenderTaskSetExclusive START");
+ [Test]
+ [Category("P1")]
+ [Description("RenderTask SetExclusive.")]
+ [Property("SPEC", "Tizen.NUI.RenderTask.SetExclusive M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void RenderTaskSetExclusive()
+ {
+ tlog.Debug(tag, $"RenderTaskSetExclusive START");
- // using (Animatable ani = new Animatable())
- // {
- // var testingTarget = new RenderTask(ani.SwigCPtr.Handle, false);
- // Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
- // Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
+ using (View view = new View() { Size = new Size(100, 50) })
+ {
+ var testingTarget = RenderTask.GetRenderTaskFromPtr(view.SwigCPtr.Handle);
+ Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
+ Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
- // try
- // {
- // testingTarget.SetExclusive(true);
+ try
+ {
+ testingTarget.SetExclusive(false);
- // var result = testingTarget.IsExclusive();
- // tlog.Debug(tag, "IsExclusive : " + result);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception : Failed!");
- // }
+ var result = testingTarget.IsExclusive();
+ tlog.Debug(tag, "IsExclusive : " + result);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
- // testingTarget.Dispose();
- // }
+ testingTarget.Dispose();
+ }
- // tlog.Debug(tag, $"RenderTaskSetExclusive END (OK)");
- //}
+ tlog.Debug(tag, $"RenderTaskSetExclusive END (OK)");
+ }
[Test]
[Category("P1")]
//{
// tlog.Debug(tag, $"RenderTaskSetCamera START");
- // using (Animatable ani = new Animatable())
+ // using (View view = new View() { Size = new Size(100, 50) })
// {
- // var testingTarget = new RenderTask(ani.SwigCPtr.Handle, false);
+ // var testingTarget = new RenderTask(view.SwigCPtr.Handle, false);
// Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
// Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
// tlog.Debug(tag, $"RenderTaskSetCamera END (OK)");
//}
- //[Test]
- //[Category("P1")]
- //[Description("RenderTask SetFrameBuffer.")]
- //[Property("SPEC", "Tizen.NUI.RenderTask.SetFrameBuffer M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void RenderTaskSetFrameBuffer()
- //{
- // tlog.Debug(tag, $"RenderTaskSetFrameBuffer START");
+ [Test]
+ [Category("P1")]
+ [Description("RenderTask SetFrameBuffer.")]
+ [Property("SPEC", "Tizen.NUI.RenderTask.SetFrameBuffer M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void RenderTaskSetFrameBuffer()
+ {
+ tlog.Debug(tag, $"RenderTaskSetFrameBuffer START");
- // using (Animatable ani = new Animatable())
- // {
- // var testingTarget = new RenderTask(ani.SwigCPtr.Handle, false);
- // Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
- // Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
+ using (View view = new View() { Size = new Size(100, 50) })
+ {
+ var testingTarget = new RenderTask(view.SwigCPtr.Handle, false);
+ Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
+ Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
- // using (FrameBuffer buffer = new FrameBuffer(1, 2, 3))
- // {
- // try
- // {
- // testingTarget.SetFrameBuffer(buffer);
+ using (FrameBuffer buffer = new FrameBuffer(1, 2, 3))
+ {
+ try
+ {
+ testingTarget.SetFrameBuffer(buffer);
- // var result = testingTarget.GetFrameBuffer();
- // tlog.Debug(tag, "FrameBuffer : " + result);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception : Failed!");
- // }
- // }
+ var result = testingTarget.GetFrameBuffer();
+ tlog.Debug(tag, "FrameBuffer : " + result);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+ }
- // testingTarget.Dispose();
- // }
+ testingTarget.Dispose();
+ }
- // tlog.Debug(tag, $"RenderTaskSetFrameBuffer END (OK)");
- //}
+ tlog.Debug(tag, $"RenderTaskSetFrameBuffer END (OK)");
+ }
[Test]
[Category("P1")]
tlog.Debug(tag, $"RenderTaskSetScreenToFrameBufferFunction END (OK)");
}
- //[Test]
- //[Category("P1")]
- //[Description("RenderTask SetScreenToFrameBufferMappingView.")]
- //[Property("SPEC", "Tizen.NUI.RenderTask.SetScreenToFrameBufferMappingView M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void RenderTaskSetScreenToFrameBufferMappingView()
- //{
- // tlog.Debug(tag, $"RenderTaskSetScreenToFrameBufferMappingView START");
+ [Test]
+ [Category("P1")]
+ [Description("RenderTask SetScreenToFrameBufferMappingView.")]
+ [Property("SPEC", "Tizen.NUI.RenderTask.SetScreenToFrameBufferMappingView M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void RenderTaskSetScreenToFrameBufferMappingView()
+ {
+ tlog.Debug(tag, $"RenderTaskSetScreenToFrameBufferMappingView START");
- // using (Animatable ani = new Animatable())
- // {
- // var testingTarget = new RenderTask(ani.SwigCPtr.Handle, false);
- // Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
- // Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
+ using (View view = new View() { Size = new Size(100, 50) })
+ {
+ var testingTarget = new RenderTask(view.SwigCPtr.Handle, false);
+ Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
+ Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
- // using (View view = new View())
- // {
- // try
- // {
- // testingTarget.SetScreenToFrameBufferMappingView(view);
+ try
+ {
+ testingTarget.SetScreenToFrameBufferMappingView(view);
- // var result = testingTarget.GetScreenToFrameBufferMappingView();
- // tlog.Debug(tag, "ScreenToFrameBufferMappingView : " + result);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception : Failed!");
- // }
- // }
+ var result = testingTarget.GetScreenToFrameBufferMappingView();
+ tlog.Debug(tag, "ScreenToFrameBufferMappingView : " + result);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
- // testingTarget.Dispose();
- // }
+ testingTarget.Dispose();
+ }
- // tlog.Debug(tag, $"RenderTaskSetScreenToFrameBufferMappingView END (OK)");
- //}
+ tlog.Debug(tag, $"RenderTaskSetScreenToFrameBufferMappingView END (OK)");
+ }
//[Test]
//[Category("P1")]
//{
// tlog.Debug(tag, $"RenderTaskSetViewportPosition START");
- // using (Animatable ani = new Animatable())
+ // using (View view = new View() { Size = new Size(100, 50), Position = new Position(100, 50) })
// {
- // var testingTarget = new RenderTask(ani.SwigCPtr.Handle, false);
+ // var testingTarget = RenderTask.GetRenderTaskFromPtr(view.SwigCPtr.Handle);
// Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
// Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
- // using (Vector2 position = new Vector2(0.3f, 0.5f))
+ // using (Vector2 postion = new Vector2(200, 100))
// {
- // try
- // {
- // testingTarget.SetViewportPosition(position);
-
- // var result = testingTarget.GetCurrentViewportPosition();
- // tlog.Debug(tag, "ViewportPosition : " + result);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception : Failed!");
- // }
+ // testingTarget.SetViewportPosition(postion);
+ // var pos = testingTarget.GetCurrentViewportPosition();
+ // tlog.Debug(tag, "ViewportPosition : " + pos);
// }
// testingTarget.Dispose();
//{
// tlog.Debug(tag, $"RenderTaskSetViewportSize START");
- // using (Animatable ani = new Animatable())
+ // using (View view = new View() { Size = new Size(100, 50), Position = new Position(100, 50) })
// {
- // var testingTarget = new RenderTask(ani.SwigCPtr.Handle, false);
+ // var testingTarget = new RenderTask(view.SwigCPtr.Handle, false);
// Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
// Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
- // using (Vector2 size = new Vector2(0.3f, 0.5f))
+ // using (Vector2 size = new Vector2(200, 100))
// {
- // try
- // {
- // testingTarget.SetViewportSize(size);
-
- // var result = testingTarget.GetCurrentViewportSize();
- // tlog.Debug(tag, "CurrentViewportSize : " + result);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception : Failed!");
- // }
+ // testingTarget.SetViewportSize(size);
+ // var result = testingTarget.GetCurrentViewportSize();
+ // tlog.Debug(tag, "Current viewport Size : " + result);
// }
// testingTarget.Dispose();
//{
// tlog.Debug(tag, $"RenderTaskSetViewport START");
- // using (Animatable ani = new Animatable())
+ // using (View view = new View() { Size = new Size(100, 50), Position = new Position(100, 50) })
// {
- // var testingTarget = new RenderTask(ani.SwigCPtr.Handle, false);
+ // var testingTarget = new RenderTask(view.SwigCPtr.Handle, false);
// Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
// Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
// using (Rectangle viewport = new Rectangle(3, 5, 4, 6))
// {
- // try
- // {
- // testingTarget.SetViewport(viewport);
-
- // var result = testingTarget.GetViewport();
- // tlog.Debug(tag, "Viewport : " + result);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception : Failed!");
- // }
+ // testingTarget.SetViewport(viewport);
+ // var result = testingTarget.GetViewport();
+ // tlog.Debug(tag, "Viewport : " + result);
// }
// testingTarget.Dispose();
//{
// tlog.Debug(tag, $"RenderTaskSetClearColor START");
- // using (Animatable ani = new Animatable())
+ // using (View view = new View() { Size = new Size(100, 50), Position = new Position(100, 50), Color = Color.Cyan })
// {
- // var testingTarget = new RenderTask(ani.SwigCPtr.Handle, false);
+ // var testingTarget = new RenderTask(view.SwigCPtr.Handle, false);
// Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
// Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
// using (Vector4 color = new Vector4(0.3f, 0.5f, 0.4f, 0.6f))
// {
- // try
- // {
- // testingTarget.SetClearColor(color);
-
- // var result = testingTarget.GetClearColor();
- // tlog.Debug(tag, "ClearColor : " + result);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception : Failed!");
- // }
+ // testingTarget.SetClearColor(color);
+ // var result = testingTarget.GetClearColor();
+ // tlog.Debug(tag, "ClearColor : " + result);
// }
// testingTarget.Dispose();
Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
- using (Vector4 color = new Vector4(0.3f, 0.5f, 0.4f, 0.6f))
+ try
{
- try
- {
- testingTarget.SetClearEnabled(true);
-
- var result = testingTarget.GetClearEnabled();
- tlog.Debug(tag, "ClearEnabled : " + result);
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- Assert.Fail("Caught Exception : Failed!");
- }
+ testingTarget.SetClearEnabled(true);
+ var result = testingTarget.GetClearEnabled();
+ tlog.Debug(tag, "ClearEnabled : " + result);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
testingTarget.Dispose();
Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
- using (Vector4 color = new Vector4(0.3f, 0.5f, 0.4f, 0.6f))
+ try
{
- try
- {
- testingTarget.SetCullMode(true);
-
- var result = testingTarget.GetCullMode();
- tlog.Debug(tag, "CullMode : " + result);
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- Assert.Fail("Caught Exception : Failed!");
- }
+ testingTarget.SetCullMode(true);
+ var result = testingTarget.GetCullMode();
+ tlog.Debug(tag, "CullMode : " + result);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
testingTarget.Dispose();
Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
- using (Vector4 color = new Vector4(0.3f, 0.5f, 0.4f, 0.6f))
+ try
{
- try
- {
- testingTarget.SetRefreshRate(100);
-
- var result = testingTarget.GetRefreshRate();
- tlog.Debug(tag, "RefreshRate : " + result);
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- Assert.Fail("Caught Exception : Failed!");
- }
+ testingTarget.SetRefreshRate(100);
+ var result = testingTarget.GetRefreshRate();
+ tlog.Debug(tag, "RefreshRate : " + result);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
testingTarget.Dispose();
//{
// tlog.Debug(tag, $"RenderTaskWorldToViewport START");
- // using (Animatable ani = new Animatable())
+ // using (View view = new View() { Size = new Size(100, 50) })
// {
- // var testingTarget = new RenderTask(ani.SwigCPtr.Handle, false);
+ // var testingTarget = new RenderTask(view.SwigCPtr.Handle, false);
// Assert.IsNotNull(testingTarget, "Can't create success object RenderTask.");
// Assert.IsInstanceOf<RenderTask>(testingTarget, "Should return RenderTask instance.");
[Test]
[Category("P1")]
+ [Description("RulerPtr Assign.")]
+ [Property("SPEC", "Tizen.NUI.RulerPtr.Assign M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void RulerPtrAssignRulerInstance()
+ {
+ tlog.Debug(tag, $"RulerPtrAssignRulerInstance START");
+
+ using (RulerPtr ruler = new RulerPtr())
+ {
+ var testingTarget = ruler.Assign(new DefaultRuler());
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<RulerPtr>(testingTarget, "Should return RulerPtr instance.");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"RulerPtrAssignRulerInstance END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
[Description("RulerPtr Reset.")]
[Property("SPEC", "Tizen.NUI.RulerPtr.Reset M")]
[Property("SPEC_URL", "-")]
Assert.Fail("Caught Exception : Failed!");
}
- testingTarget?.Dispose();
+ testingTarget.Dispose();
tlog.Debug(tag, $"RulerPtrReset END (OK)");
}
[Test]
[Category("P1")]
+ [Description("RulerPtr Reset.")]
+ [Property("SPEC", "Tizen.NUI.RulerPtr.Reset M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void RulerPtrResetRuler()
+ {
+ tlog.Debug(tag, $"RulerPtrResetRuler START");
+
+ var testingTarget = new RulerPtr();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<RulerPtr>(testingTarget, "Should return RulerPtr instance.");
+
+ try
+ {
+ testingTarget.Reset(new DefaultRuler());
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RulerPtrResetRuler END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
[Description("RulerPtr Detach.")]
[Property("SPEC", "Tizen.NUI.RulerPtr.Detach M")]
[Property("SPEC_URL", "-")]
{
tlog.Debug(tag, $"RulerPtrDetach START");
- var testingTarget = new RulerPtr();
+ var testingTarget = new RulerPtr(new DefaultRuler());
Assert.IsNotNull(testingTarget, "null handle");
Assert.IsInstanceOf<RulerPtr>(testingTarget, "Should return RulerPtr instance.");
tlog.Debug(tag, $"RulerPtrDetach END (OK)");
}
- //[Test]
- //[Category("P1")]
- //[Description("RulerPtr Snap.")]
- //[Property("SPEC", "Tizen.NUI.RulerPtr.Snap M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("COVPARAM", "")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void RulerPtrSnap()
- //{
- // tlog.Debug(tag, $"RulerPtrSnap START");
-
- // using (DefaultRuler ruler = new DefaultRuler())
- // {
- // var testingTarget = new RulerPtr(ruler);
- // Assert.IsNotNull(testingTarget, "null handle");
- // Assert.IsInstanceOf<RulerPtr>(testingTarget, "Should return RulerPtr instance.");
-
- // // float x
- // var result = testingTarget.Snap(0.3f);
- // tlog.Debug(tag, "Snap : " + result);
-
- // // float x, float bias
- // result = testingTarget.Snap(0.3f, 0.2f);
- // tlog.Debug(tag, "Snap : " + result);
-
- // testingTarget.Dispose();
- // }
-
- // tlog.Debug(tag, $"RulerPtrSnap END (OK)");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("RulerPtr Enable.")]
- //[Property("SPEC", "Tizen.NUI.RulerPtr.Enable M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("COVPARAM", "")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void RulerPtrEnable()
- //{
- // tlog.Debug(tag, $"RulerPtrEnable START");
-
- // using (DefaultRuler ruler = new DefaultRuler())
- // {
- // var testingTarget = new RulerPtr(ruler);
- // Assert.IsNotNull(testingTarget, "null handle");
- // Assert.IsInstanceOf<RulerPtr>(testingTarget, "Should return RulerPtr instance.");
-
- // testingTarget.Enable();
- // var result = testingTarget.IsEnabled();
- // tlog.Debug(tag, "IsEnabled : " + result);
-
- // testingTarget.Dispose();
- // }
-
- // tlog.Debug(tag, $"RulerPtrEnable END (OK)");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("RulerPtr Disable.")]
- //[Property("SPEC", "Tizen.NUI.RulerPtr.Disable M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("COVPARAM", "")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void RulerPtrDisable()
- //{
- // tlog.Debug(tag, $"RulerPtrDisable START");
-
- // using (DefaultRuler ruler = new DefaultRuler())
- // {
- // var testingTarget = new RulerPtr(ruler);
- // Assert.IsNotNull(testingTarget, "null handle");
- // Assert.IsInstanceOf<RulerPtr>(testingTarget, "Should return RulerPtr instance.");
-
- // testingTarget.Disable();
- // var result = testingTarget.IsEnabled();
- // tlog.Debug(tag, "IsEnabled : " + result);
-
- // testingTarget.Dispose();
- // }
-
- // tlog.Debug(tag, $"RulerPtrDisable END (OK)");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("RulerPtr SetDomain.")]
- //[Property("SPEC", "Tizen.NUI.RulerPtr.SetDomain M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("COVPARAM", "")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void RulerPtrSetDomain()
- //{
- // tlog.Debug(tag, $"RulerPtrSetDomain START");
-
- // using (DefaultRuler ruler = new DefaultRuler())
- // {
- // var testingTarget = new RulerPtr(ruler);
- // Assert.IsNotNull(testingTarget, "null handle");
- // Assert.IsInstanceOf<RulerPtr>(testingTarget, "Should return RulerPtr instance.");
-
- // try
- // {
- // using (RulerDomain domain = new RulerDomain(0.0f, 1.0f, false))
- // {
- // testingTarget.SetDomain(domain);
- // }
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception : Failed!");
- // }
-
- // var result = testingTarget.GetDomain();
- // tlog.Debug(tag, "GetDomain : " + result);
-
- // testingTarget.Dispose();
- // }
-
- // tlog.Debug(tag, $"RulerPtrSetDomain END (OK)");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("RulerPtr DisableDomain.")]
- //[Property("SPEC", "Tizen.NUI.RulerPtr.DisableDomain M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("COVPARAM", "")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void RulerPtrDisableDomain()
- //{
- // tlog.Debug(tag, $"RulerPtrDisableDomain START");
-
- // using (DefaultRuler ruler = new DefaultRuler())
- // {
- // var testingTarget = new RulerPtr(ruler);
- // Assert.IsNotNull(testingTarget, "null handle");
- // Assert.IsInstanceOf<RulerPtr>(testingTarget, "Should return RulerPtr instance.");
-
- // try
- // {
- // testingTarget.DisableDomain();
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception : Failed!");
- // }
-
- // testingTarget.Dispose();
- // }
-
- // tlog.Debug(tag, $"RulerPtrDisableDomain END (OK)");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("RulerPtr Clamp.")]
- //[Property("SPEC", "Tizen.NUI.RulerPtr.Clamp M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("COVPARAM", "")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void RulerPtrClamp()
- //{
- // tlog.Debug(tag, $"RulerPtrClamp START");
-
- // using (DefaultRuler ruler = new DefaultRuler())
- // {
- // var testingTarget = new RulerPtr(ruler);
- // Assert.IsNotNull(testingTarget, "null handle");
- // Assert.IsInstanceOf<RulerPtr>(testingTarget, "Should return RulerPtr instance.");
-
- // try
- // {
- // // float x
- // var result = testingTarget.Clamp(0.3f);
- // tlog.Debug(tag, "Clamp : " + result);
-
- // // float x, float length
- // result = testingTarget.Clamp(0.3f, 0.8f);
- // tlog.Debug(tag, "Clamp : " + result);
-
- // // float x, float length, float scale
- // result = testingTarget.Clamp(0.3f, 0.8f, 0.5f);
- // tlog.Debug(tag, "Clamp : " + result);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception : Failed!");
- // }
-
- // testingTarget.Dispose();
- // }
-
- // tlog.Debug(tag, $"RulerPtrClamp END (OK)");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("RulerPtr SnapAndClamp.")]
- //[Property("SPEC", "Tizen.NUI.RulerPtr.SnapAndClamp M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("COVPARAM", "")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void RulerPtrSnapAndClamp()
- //{
- // tlog.Debug(tag, $"RulerPtrSnapAndClamp START");
-
- // using (DefaultRuler ruler = new DefaultRuler())
- // {
- // var testingTarget = new RulerPtr(ruler);
- // Assert.IsNotNull(testingTarget, "null handle");
- // Assert.IsInstanceOf<RulerPtr>(testingTarget, "Should return RulerPtr instance.");
-
- // // float x
- // var result = testingTarget.SnapAndClamp(0.3f);
- // tlog.Debug(tag, "SnapAndClamp : " + result);
-
- // // float x, float bias
- // result = testingTarget.SnapAndClamp(0.3f, 0.1f);
- // tlog.Debug(tag, "SnapAndClamp : " + result);
-
- // // float x, float bias, float length
- // result = testingTarget.SnapAndClamp(0.3f, 0.1f, 1.0f);
- // tlog.Debug(tag, "SnapAndClamp : " + result);
-
- // // float x, float bias, float length, float scale
- // result = testingTarget.SnapAndClamp(0.3f, 0.1f, 1.0f, 0.5f);
- // tlog.Debug(tag, "SnapAndClamp : " + result);
-
- // testingTarget.Dispose();
- // }
-
- // tlog.Debug(tag, $"RulerPtrSnapAndClamp END (OK)");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("RulerPtr Reference.")]
- //[Property("SPEC", "Tizen.NUI.RulerPtr.Reference M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("COVPARAM", "")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void RulerPtrReference()
- //{
- // tlog.Debug(tag, $"RulerPtrReference START");
-
- // using (DefaultRuler ruler = new DefaultRuler())
- // {
- // var testingTarget = new RulerPtr(ruler);
- // Assert.IsNotNull(testingTarget, "null handle");
- // Assert.IsInstanceOf<RulerPtr>(testingTarget, "Should return RulerPtr instance.");
-
- // try
- // {
- // testingTarget.Reference();
- // tlog.Debug(tag, "ReferenceCount : " + testingTarget.ReferenceCount());
-
- // testingTarget.Unreference();
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception : Failed!");
- // }
-
- // testingTarget.Dispose();
- // tlog.Debug(tag, $"RulerPtrReference END (OK)");
- // }
- //}
+ [Test]
+ [Category("P1")]
+ [Description("RulerPtr Snap.")]
+ [Property("SPEC", "Tizen.NUI.RulerPtr.Snap M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void RulerPtrSnap()
+ {
+ tlog.Debug(tag, $"RulerPtrSnap START");
+
+ var testingTarget = new RulerPtr(new DefaultRuler());
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<RulerPtr>(testingTarget, "Should return RulerPtr instance.");
+
+ // float x
+ var result = testingTarget.Snap(0.3f);
+ tlog.Debug(tag, "Snap : " + result);
+
+ // float x, float bias
+ result = testingTarget.Snap(0.3f, 0.2f);
+ tlog.Debug(tag, "Snap : " + result);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RulerPtrSnap END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RulerPtr Enable.")]
+ [Property("SPEC", "Tizen.NUI.RulerPtr.Enable M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void RulerPtrEnable()
+ {
+ tlog.Debug(tag, $"RulerPtrEnable START");
+
+ var testingTarget = new RulerPtr(new DefaultRuler());
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<RulerPtr>(testingTarget, "Should return RulerPtr instance.");
+
+ testingTarget.Disable();
+ var dis = testingTarget.IsEnabled();
+ tlog.Debug(tag, "IsEnabled : " + dis);
+
+ testingTarget.Enable();
+ var ena = testingTarget.IsEnabled();
+ tlog.Debug(tag, "IsEnabled : " + ena);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RulerPtrEnable END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RulerPtr SetDomain.")]
+ [Property("SPEC", "Tizen.NUI.RulerPtr.SetDomain M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void RulerPtrSetDomain()
+ {
+ tlog.Debug(tag, $"RulerPtrSetDomain START");
+
+ var testingTarget = new RulerPtr(new DefaultRuler());
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<RulerPtr>(testingTarget, "Should return RulerPtr instance.");
+
+ try
+ {
+ using (RulerDomain domain = new RulerDomain(0.0f, 1.0f, false))
+ {
+ testingTarget.SetDomain(domain);
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ var result = testingTarget.GetDomain();
+ tlog.Debug(tag, "GetDomain : " + result);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RulerPtrSetDomain END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RulerPtr DisableDomain.")]
+ [Property("SPEC", "Tizen.NUI.RulerPtr.DisableDomain M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void RulerPtrDisableDomain()
+ {
+ tlog.Debug(tag, $"RulerPtrDisableDomain START");
+
+ var testingTarget = new RulerPtr(new DefaultRuler());
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<RulerPtr>(testingTarget, "Should return RulerPtr instance.");
+
+ try
+ {
+ testingTarget.DisableDomain();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RulerPtrDisableDomain END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RulerPtr Clamp.")]
+ [Property("SPEC", "Tizen.NUI.RulerPtr.Clamp M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void RulerPtrClamp()
+ {
+ tlog.Debug(tag, $"RulerPtrClamp START");
+
+ var testingTarget = new RulerPtr(new DefaultRuler());
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<RulerPtr>(testingTarget, "Should return RulerPtr instance.");
+
+ try
+ {
+ // float x
+ var result = testingTarget.Clamp(0.3f);
+ tlog.Debug(tag, "Clamp : " + result);
+
+ // float x, float length
+ result = testingTarget.Clamp(0.3f, 0.8f);
+ tlog.Debug(tag, "Clamp : " + result);
+
+ // float x, float length, float scale
+ result = testingTarget.Clamp(0.3f, 0.8f, 0.5f);
+ tlog.Debug(tag, "Clamp : " + result);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RulerPtrClamp END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RulerPtr SnapAndClamp.")]
+ [Property("SPEC", "Tizen.NUI.RulerPtr.SnapAndClamp M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void RulerPtrSnapAndClamp()
+ {
+ tlog.Debug(tag, $"RulerPtrSnapAndClamp START");
+
+ var testingTarget = new RulerPtr(new DefaultRuler());
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<RulerPtr>(testingTarget, "Should return RulerPtr instance.");
+
+ // float x
+ var result = testingTarget.SnapAndClamp(0.3f);
+ tlog.Debug(tag, "SnapAndClamp : " + result);
+
+ // float x, float bias
+ result = testingTarget.SnapAndClamp(0.3f, 0.1f);
+ tlog.Debug(tag, "SnapAndClamp : " + result);
+
+ // float x, float bias, float length
+ result = testingTarget.SnapAndClamp(0.3f, 0.1f, 1.0f);
+ tlog.Debug(tag, "SnapAndClamp : " + result);
+
+ // float x, float bias, float length, float scale
+ result = testingTarget.SnapAndClamp(0.3f, 0.1f, 1.0f, 0.5f);
+ tlog.Debug(tag, "SnapAndClamp : " + result);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RulerPtrSnapAndClamp END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RulerPtr Reference.")]
+ [Property("SPEC", "Tizen.NUI.RulerPtr.Reference M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void RulerPtrReference()
+ {
+ tlog.Debug(tag, $"RulerPtrReference START");
+
+ var testingTarget = new RulerPtr(new DefaultRuler());
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<RulerPtr>(testingTarget, "Should return RulerPtr instance.");
+
+ try
+ {
+ testingTarget.Reference();
+ tlog.Debug(tag, "ReferenceCount : " + testingTarget.ReferenceCount());
+
+ testingTarget.Unreference();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RulerPtrReference END (OK)");
+ }
}
}
tlog.Debug(tag, $"StringToVoidSignalGetResult END (OK)");
}
- [Test]
- [Category("P1")]
- [Description("StringToVoidSignal SetResult.")]
- [Property("SPEC", "Tizen.NUI.StringToVoidSignal.SetResult M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
- public void StringToVoidSignalSetResult()
- {
- tlog.Debug(tag, $"StringToVoidSignalSetResult START");
-
- using (TextLabel label = new TextLabel())
- {
- label.Text = "";
- try
- {
- StringToVoidSignal.SetResult(label.SwigCPtr.Handle, "TextLabel");
- tlog.Debug(tag, "GetResult : " + StringToVoidSignal.GetResult(label.SwigCPtr.Handle));
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- Assert.Fail("Cuaght Exception: Failed!");
- }
- }
-
- tlog.Debug(tag, $"StringToVoidSignalSetResult END (OK)");
- }
+ //[Test]
+ //[Category("P1")]
+ //[Description("StringToVoidSignal SetResult.")]
+ //[Property("SPEC", "Tizen.NUI.StringToVoidSignal.SetResult M")]
+ //[Property("SPEC_URL", "-")]
+ //[Property("CRITERIA", "MR")]
+ //[Property("AUTHOR", "guowei.wang@samsung.com")]
+ //public void StringToVoidSignalSetResult()
+ //{
+ // tlog.Debug(tag, $"StringToVoidSignalSetResult START");
+
+ // using (TextLabel label = new TextLabel())
+ // {
+ // label.Text = "";
+ // try
+ // {
+ // StringToVoidSignal.SetResult(label.SwigCPtr.Handle, "TextLabel");
+ // tlog.Debug(tag, "GetResult : " + StringToVoidSignal.GetResult(label.SwigCPtr.Handle));
+ // }
+ // catch (Exception e)
+ // {
+ // tlog.Debug(tag, e.Message.ToString());
+ // Assert.Fail("Cuaght Exception: Failed!");
+ // }
+ // }
+
+ // tlog.Debug(tag, $"StringToVoidSignalSetResult END (OK)");
+ //}
}
}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("internal/Common/ViewImpl")]
+ public class InternalViewImplTest
+ {
+ private const string tag = "NUITEST";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ViewImpl New.")]
+ [Property("SPEC", "Tizen.NUI.ViewImpl.New M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ViewImplNew()
+ {
+ tlog.Debug(tag, $"ViewImplNew START");
+
+ var testingTarget = ViewImpl.New();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<View>(testingTarget, "Should return View instance.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ViewImplNew END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ViewImpl getCPtr.")]
+ [Property("SPEC", "Tizen.NUI.ViewImpl.getCPtr M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ViewImplGetCPtr()
+ {
+ tlog.Debug(tag, $"ViewImplGetCPtr START");
+
+ using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
+ {
+ var testingTarget = new ViewWrapper("CustomView", impl);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ViewWrapper>(testingTarget, "should be an instance of testing target class!");
+
+ var result = ViewWrapperImpl.getCPtr(testingTarget.viewWrapperImpl);
+ tlog.Debug(tag, "getCptr : " + result);
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"ViewImplGetCPtr END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ViewImpl SetStyleName.")]
+ [Property("SPEC", "Tizen.NUI.ViewImpl.SetStyleName M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ViewImplSetStyleName()
+ {
+ tlog.Debug(tag, $"ViewImplSetStyleName START");
+
+ using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
+ {
+ var testingTarget = new ViewWrapper("CustomView", impl);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ViewWrapper>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.viewWrapperImpl.SetStyleName("style");
+ var result = testingTarget.viewWrapperImpl.GetStyleName();
+ tlog.Debug(tag, "StyleName : " + result);
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"ViewImplSetStyleName END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ViewImpl SetBackgroundColor.")]
+ [Property("SPEC", "Tizen.NUI.ViewImpl.SetBackgroundColor M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ViewImplSetBackgroundColor()
+ {
+ tlog.Debug(tag, $"ViewImplSetBackgroundColor START");
+
+ using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
+ {
+ var testingTarget = new ViewWrapper("CustomView", impl);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ViewWrapper>(testingTarget, "should be an instance of testing target class!");
+
+ using (Vector4 color = new Vector4(0.3f, 0.5f, 0.9f, 1.0f))
+ {
+ testingTarget.viewWrapperImpl.SetBackgroundColor(color);
+ //tlog.Debug(tag, "BackgroundColor : " + wrapper.viewWrapperImpl.GetBackgroundColor());
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"ViewImplSetBackgroundColor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ViewImpl SetBackground.")]
+ [Property("SPEC", "Tizen.NUI.ViewImpl.SetBackground M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ViewImplSetBackground()
+ {
+ tlog.Debug(tag, $"ViewImplSetBackground START");
+
+ using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
+ {
+ var testingTarget = new ViewWrapper("CustomView", impl);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ViewWrapper>(testingTarget, "should be an instance of testing target class!");
+
+ using (ColorVisual colorVisual = new ColorVisual())
+ {
+ colorVisual.Color = Color.Cyan;
+
+ try
+ {
+ testingTarget.viewWrapperImpl.SetBackground(colorVisual.OutputVisualMap);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+ }
+
+ testingTarget.viewWrapperImpl.ClearBackground();
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"ViewImplSetBackground END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ViewImpl EnableGestureDetection.")]
+ [Property("SPEC", "Tizen.NUI.ViewImpl.EnableGestureDetection M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ViewImplEnableGestureDetection()
+ {
+ tlog.Debug(tag, $"ViewImplEnableGestureDetection START");
+
+ using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
+ {
+ var testingTarget = new ViewWrapper("CustomView", impl);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ViewWrapper>(testingTarget, "should be an instance of testing target class!");
+
+ try
+ {
+ testingTarget.viewWrapperImpl.EnableGestureDetection(Gesture.GestureType.LongPress);
+ testingTarget.viewWrapperImpl.DisableGestureDetection(Gesture.GestureType.LongPress);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"ViewImplEnableGestureDetection (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ViewImpl GetPinchGestureDetector.")]
+ [Property("SPEC", "Tizen.NUI.ViewImpl.GetPinchGestureDetector M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ViewImplGetGestureDetector()
+ {
+ tlog.Debug(tag, $"ViewImplGetGestureDetector START");
+
+ using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
+ {
+ var testingTarget = new ViewWrapper("CustomView", impl);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ViewWrapper>(testingTarget, "should be an instance of testing target class!");
+
+ var pinchGesture = testingTarget.viewWrapperImpl.GetPinchGestureDetector();
+ Assert.IsInstanceOf<PinchGestureDetector>(pinchGesture, "should be an instance of testing target class!");
+
+ var panGesture = testingTarget.viewWrapperImpl.GetPanGestureDetector();
+ Assert.IsInstanceOf<PanGestureDetector>(panGesture, "should be an instance of testing target class!");
+
+ var tapGesture = testingTarget.viewWrapperImpl.GetTapGestureDetector();
+ Assert.IsInstanceOf<TapGestureDetector>(tapGesture, "should be an instance of testing target class!");
+
+ var pressGesture = testingTarget.viewWrapperImpl.GetLongPressGestureDetector();
+ Assert.IsInstanceOf<LongPressGestureDetector>(pressGesture, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"ViewImplGetGestureDetector (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ViewImpl SetKeyInputFocus.")]
+ [Property("SPEC", "Tizen.NUI.ViewImpl.SetKeyInputFocus M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ViewImplSetKeyInputFocus()
+ {
+ tlog.Debug(tag, $"ViewImplSetKeyInputFocus START");
+
+ using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
+ {
+ var testingTarget = new ViewWrapper("CustomView", impl);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ViewWrapper>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.viewWrapperImpl.SetKeyInputFocus();
+ var result = testingTarget.viewWrapperImpl.HasKeyInputFocus();
+ tlog.Debug(tag, "HasKeyInputFocus : " + result);
+ testingTarget.viewWrapperImpl.ClearKeyInputFocus();
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"ViewImplSetKeyInputFocus (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ViewImpl KeyEventSignal.")]
+ [Property("SPEC", "Tizen.NUI.ViewImpl.KeyEventSignal M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ViewImplSignal()
+ {
+ tlog.Debug(tag, $"ViewImplSignal START");
+
+ using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
+ {
+ var testingTarget = new ViewWrapper("CustomView", impl);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ViewWrapper>(testingTarget, "should be an instance of testing target class!");
+
+ var signal = testingTarget.viewWrapperImpl.KeyEventSignal();
+ Assert.IsInstanceOf<ControlKeySignal>(signal, "Should return ControlKeySignal instance.");
+
+ var focusGained = testingTarget.viewWrapperImpl.KeyInputFocusGainedSignal();
+ Assert.IsInstanceOf<KeyInputFocusSignal>(focusGained, "Should return ControlKeySignal instance.");
+
+ var focusLost = testingTarget.viewWrapperImpl.KeyInputFocusLostSignal();
+ Assert.IsInstanceOf<KeyInputFocusSignal>(focusLost, "Should return ControlKeySignal instance.");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"ViewImplSignal (OK)");
+ }
+
+ //[Test]
+ //[Category("P1")]
+ //[Description("ViewImpl EmitKeyEventSignal.")]
+ //[Property("SPEC", "Tizen.NUI.ViewImpl.EmitKeyEventSignal M")]
+ //[Property("SPEC_URL", "-")]
+ //[Property("CRITERIA", "MR")]
+ //[Property("COVPARAM", "")]
+ //[Property("AUTHOR", "guowei.wang@samsung.com")]
+ //public void ViewImplEmitKeyEventSignal()
+ //{
+ // tlog.Debug(tag, $"ViewImplEmitKeyEventSignal START");
+
+ // using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
+ // {
+ // var testingTarget = new ViewWrapper("CustomView", impl);
+ // Assert.IsNotNull(testingTarget, "should be not null");
+ // Assert.IsInstanceOf<ViewWrapper>(testingTarget, "should be an instance of testing target class!");
+
+ // using (Key key = new Key())
+ // {
+ // var result = testingTarget.viewWrapperImpl.EmitKeyEventSignal(key);
+ // tlog.Debug(tag, "EmitKeyEventSignal : " + result);
+ // }
+
+ // testingTarget.Dispose();
+ // }
+
+ // tlog.Debug(tag, $"ViewImplEmitKeyEventSignal (OK)");
+ //}
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("internal/Common/ViewWrapperImpl")]
+ public class InternalViewWrapperImplTest
+ {
+ private const string tag = "NUITEST";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ViewWrapperImpl constructor.")]
+ [Property("SPEC", "Tizen.NUI.ViewWrapperImpl.ViewWrapperImpl M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ViewWrapperImplConstructor()
+ {
+ tlog.Debug(tag, $"ViewWrapperImplConstructor START");
+
+ var testingTarget = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ViewWrapperImpl>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ // disposed
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ViewWrapperImplConstructor END (OK)");
+ }
+
+ //[Test]
+ //[Category("P1")]
+ //[Description("ViewWrapperImpl New.")]
+ //[Property("SPEC", "Tizen.NUI.ViewWrapperImpl.New M")]
+ //[Property("SPEC_URL", "-")]
+ //[Property("CRITERIA", "MR")]
+ //[Property("COVPARAM", "")]
+ //[Property("AUTHOR", "guowei.wang@samsung.com")]
+ //public void ViewWrapperImplNew()
+ //{
+ // tlog.Debug(tag, $"ViewWrapperImplNew START");
+
+ // using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
+ // {
+ // var testingTarget = ViewWrapperImpl.New("CustomView", impl);
+ // Assert.IsNotNull(testingTarget, "should be not null");
+ // Assert.IsInstanceOf<ViewWrapper>(testingTarget, "should be an instance of testing target class!");
+
+ // testingTarget.Dispose();
+ // }
+
+ // tlog.Debug(tag, $"ViewWrapperImplNew END (OK)");
+ //}
+
+ //[Test]
+ //[Category("P1")]
+ //[Description("ViewWrapperImpl ApplyThemeStyle.")]
+ //[Property("SPEC", "Tizen.NUI.ViewWrapperImpl.ApplyThemeStyle M")]
+ //[Property("SPEC_URL", "-")]
+ //[Property("CRITERIA", "MR")]
+ //[Property("COVPARAM", "")]
+ //[Property("AUTHOR", "guowei.wang@samsung.com")]
+ //public void ViewWrapperImplApplyThemeStyle()
+ //{
+ // tlog.Debug(tag, $"ViewWrapperImplApplyThemeStyle START");
+
+ // var testingTarget = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault);
+ // Assert.IsNotNull(testingTarget, "should be not null");
+ // Assert.IsInstanceOf<ViewWrapperImpl>(testingTarget, "should be an instance of testing target class!");
+
+ // try
+ // {
+ // testingTarget.ApplyThemeStyle();
+ // }
+ // catch (Exception e)
+ // {
+ // tlog.Debug(tag, e.Message.ToString());
+ // Assert.Fail("Caught Exception : Failed!");
+ // }
+
+ // testingTarget.Dispose();
+ // tlog.Debug(tag, $"ViewWrapperImplApplyThemeStyle END (OK)");
+ //}
+
+ [Test]
+ [Category("P1")]
+ [Description("ViewWrapperImpl ViewBehaviourFlagCount.")]
+ [Property("SPEC", "Tizen.NUI.ViewWrapperImpl.ViewBehaviourFlagCount A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ViewWrapperImplViewBehaviourFlagCount()
+ {
+ tlog.Debug(tag, $"ViewWrapperImplViewBehaviourFlagCount START");
+
+ var result = ViewWrapperImpl.ViewBehaviourFlagCount;
+ tlog.Debug(tag, "ViewBehaviourFlagCount : " + result);
+
+ tlog.Debug(tag, $"ViewWrapperImplViewBehaviourFlagCount END (OK)");
+ }
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using System.Collections.Generic;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("internal/FrameBroker/FrameBrokerBase")]
+ public class InternalFrameBrokerBaseTest
+ {
+ private const string tag = "NUITEST";
+ private const string MyAppId = "org.tizen.SampleServiceApp.Tizen";
+ private string path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("FrameBrokerBase SendLaunchRequest.")]
+ [Property("SPEC", "Tizen.NUI.FrameBrokerBase.SendLaunchRequest M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void FrameBrokerBaseSendLaunchRequestNullAppControl()
+ {
+ tlog.Debug(tag, $"FrameBrokerBaseSendLaunchRequestNullAppControl START");
+
+ using (Window window = new Window(new Rectangle(0, 0, 100, 200), false))
+ {
+ var testingTarget = new DefaultFrameBroker(window);
+ Assert.IsNotNull(testingTarget, "Can't create success object CustomView");
+ Assert.IsInstanceOf<DefaultFrameBroker>(testingTarget, "Should be an instance of DefaultFrameBroker type.");
+
+ try
+ {
+ testingTarget.SendLaunchRequest(null, true);
+ }
+ catch (Exception e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"FrameBrokerBaseSendLaunchRequestNullAppControl END (OK)");
+ Assert.Pass("Caught ArgumentException : Passed!");
+ }
+ }
+ }
+ }
+}
tlog.Debug(tag, $"BuilderLoadFromString END (OK)");
}
- //[Test]
- //[Category("P1")]
- //[Description("Builder Create.")]
- //[Property("SPEC", "Tizen.NUI.Builder.Create M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void BuilderCreate()
- //{
- // tlog.Debug(tag, $"BuilderCreate START");
-
- // var testingTarget = new Builder();
- // Assert.IsNotNull(testingTarget, "Should be not null!");
- // Assert.IsInstanceOf<Builder>(testingTarget, "Should be an Instance of Builder!");
-
- // try
- // {
- // testingTarget.Create("{\"View\" : [\"Size\" : \"\"]}");
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception: Failed!");
- // }
-
- // testingTarget.Dispose();
- // testingTarget = null;
- // tlog.Debug(tag, $"BuilderCreate END (OK)");
- //}
+ [Test]
+ [Category("P1")]
+ [Description("Builder CreateFromJson.")]
+ [Property("SPEC", "Tizen.NUI.Builder.CreateFromJson M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void BuilderCreateFromJson()
+ {
+ tlog.Debug(tag, $"BuilderCreateFromJson START");
+
+ var testingTarget = new Builder();
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<Builder>(testingTarget, "Should be an Instance of Builder!");
+
+ try
+ {
+ testingTarget.CreateFromJson("{\"v\":\"5.1.18\",\"fr\":30,\"ip\":0,\"op\":31,\"w\":750,\"h\":488,\"nm\":\"A Shapes_03 Rectangle_750x488\",\"ddd\":0,\"assets\":[],\"layers\":[{\"ddd\":0,\"ind\":1,\"ty\":4,\"nm\":\"Rectantgle Outlines\",\"hd\":false}],\"ip\":0,\"op\":6300,\"st\":0,\"bm\":0}],\"markers\":[]}");
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ testingTarget = null;
+ tlog.Debug(tag, $"BuilderCreateFromJson END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Builder ApplyFromJson.")]
+ [Property("SPEC", "Tizen.NUI.Builder.ApplyFromJson M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void BuilderApplyFromJson()
+ {
+ tlog.Debug(tag, $"BuilderApplyFromJson START");
+
+ var testingTarget = new Builder();
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<Builder>(testingTarget, "Should be an Instance of Builder!");
+
+ using (Animatable ani = new Animatable())
+ {
+ try
+ {
+ var result = testingTarget.ApplyFromJson(ani, "{\"v\":\"5.1.18\",\"fr\":30,\"ip\":0,\"op\":31,\"w\":750,\"h\":488,\"nm\":\"A Shapes_03 Rectangle_750x488\",\"ddd\":0,\"assets\":[],\"layers\":[{\"ddd\":0,\"ind\":1,\"ty\":4,\"nm\":\"Rectantgle Outlines\",\"hd\":false}],\"ip\":0,\"op\":6300,\"st\":0,\"bm\":0}],\"markers\":[]}");
+ tlog.Debug(tag, "ApplyFromJson : " + result);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+ }
+
+ testingTarget.Dispose();
+ testingTarget = null;
+ tlog.Debug(tag, $"BuilderCreateFromJson END (OK)");
+ }
private void MyOnQuit(object sender, EventArgs e)
{
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("Internal/Utility/GaussianBlurView")]
+ public class InternalGaussianBlurViewTest
+ {
+ private const string tag = "NUITEST";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GaussianBlurView constructor.")]
+ [Property("SPEC", "Tizen.NUI.GaussianBlurView.GaussianBlurView C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void GaussianBlurViewConstructor()
+ {
+ tlog.Debug(tag, $"GaussianBlurViewConstructor START");
+
+ var testingTarget = new GaussianBlurView();
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<GaussianBlurView>(testingTarget, "Should be an Instance of GaussianBlurView!");
+
+ testingTarget.Finished += OnFinished;
+ testingTarget.Finished -= OnFinished;
+
+ testingTarget.Dispose();
+ // disposed
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"GaussianBlurViewConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GaussianBlurView constructor.")]
+ [Property("SPEC", "Tizen.NUI.GaussianBlurView.GaussianBlurView C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void GaussianBlurViewConstructorWithPixelFormat()
+ {
+ tlog.Debug(tag, $"GaussianBlurViewConstructorWithPixelFormat START");
+
+ var testingTarget = new GaussianBlurView(3, 0.3f, PixelFormat.BGR8888, 1.0f, 1.0f, false);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<GaussianBlurView>(testingTarget, "Should be an Instance of GaussianBlurView!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"GaussianBlurViewConstructorWithPixelFormat END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GaussianBlurView constructor.")]
+ [Property("SPEC", "Tizen.NUI.GaussianBlurView.GaussianBlurView C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void GaussianBlurViewConstructorWithGaussianBlurView()
+ {
+ tlog.Debug(tag, $"GaussianBlurViewConstructorWithGaussianBlurView START");
+
+ using (GaussianBlurView view = new GaussianBlurView())
+ {
+ var testingTarget = new GaussianBlurView(view);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<GaussianBlurView>(testingTarget, "Should be an Instance of GaussianBlurView!");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"GaussianBlurViewConstructorWithGaussianBlurView END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GaussianBlurView BlurStrength.")]
+ [Property("SPEC", "Tizen.NUI.GaussianBlurView.BlurStrength A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void GaussianBlurViewBlurStrength()
+ {
+ tlog.Debug(tag, $"GaussianBlurViewBlurStrength START");
+
+ using (View view = new View() { Size = new Size(100, 50) })
+ {
+ var testingTarget = new GaussianBlurView(view.SwigCPtr.Handle, false);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<GaussianBlurView>(testingTarget, "Should be an Instance of Builder!");
+
+ testingTarget.BlurStrength = 0.3f;
+ tlog.Debug(tag, "BlurStrength : " + testingTarget.BlurStrength);
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"GaussianBlurViewBlurStrength END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GaussianBlurView Activate.")]
+ [Property("SPEC", "Tizen.NUI.GaussianBlurView.Activate M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void GaussianBlurViewActivate()
+ {
+ tlog.Debug(tag, $"GaussianBlurViewActivate START");
+
+ var testingTarget = new GaussianBlurView();
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<GaussianBlurView>(testingTarget, "Should be an Instance of GaussianBlurView!");
+
+ try
+ {
+ testingTarget.Activate();
+ testingTarget.Deactivate();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"GaussianBlurViewActivate END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GaussianBlurView SetBackgroundColor.")]
+ [Property("SPEC", "Tizen.NUI.GaussianBlurView.SetBackgroundColor M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void GaussianBlurViewSetBackgroundColor()
+ {
+ tlog.Debug(tag, $"GaussianBlurViewSetBackgroundColor START");
+
+ var testingTarget = new GaussianBlurView();
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<GaussianBlurView>(testingTarget, "Should be an Instance of GaussianBlurView!");
+
+ using (Vector4 color = new Vector4(1.0f, 1.0f, 1.0f, 1.0f))
+ {
+ testingTarget.SetBackgroundColor(color);
+ var result = testingTarget.GetBackgroundColor();
+ tlog.Debug(tag, "BackgroundColor.X" + result.X);
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"GaussianBlurViewSetBackgroundColor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GaussianBlurView ActivateOnce.")]
+ [Property("SPEC", "Tizen.NUI.GaussianBlurView.ActivateOnce M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void GaussianBlurViewActivateOnce()
+ {
+ tlog.Debug(tag, $"GaussianBlurViewActivateOnce START");
+
+ var testingTarget = new GaussianBlurView();
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<GaussianBlurView>(testingTarget, "Should be an Instance of GaussianBlurView!");
+
+ NUIApplication.GetDefaultWindow().Add(testingTarget);
+
+ try
+ {
+ testingTarget.ActivateOnce();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ NUIApplication.GetDefaultWindow().Remove(testingTarget);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"GaussianBlurViewActivateOnce END (OK)");
+ }
+
+ private void OnFinished(object source, EventArgs e) { }
+ }
+}
public class InternalPageTurnViewTest
{
private const string tag = "NUITEST";
+ private View view = null;
+ private PageTurnView pageTurnView = null;
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
+
+ View view = new View()
+ {
+ Size = new Size(100, 50),
+ Color = Color.Cyan
+ };
+ view.OnWindowSignal();
+ pageTurnView = new PageTurnView(view.SwigCPtr.Handle, false);
}
[TearDown]
public void Destroy()
{
+ view.Dispose();
+ view = null;
+ pageTurnView.Dispose();
+ pageTurnView = null;
+
tlog.Info(tag, "Destroy() is called!");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("PageTurnView constructor")]
+ [Property("SPEC", "Tizen.NUI.PageTurnView.PageTurnView C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PageTurnViewConstructorWithPageTurnView()
+ {
+ tlog.Debug(tag, $"PageTurnViewConstructorWithPageTurnView START");
+
+ var testingTarget = new PageTurnView(pageTurnView);
+ Assert.IsNotNull(testingTarget, "Can't create success object PageTurnView");
+ Assert.IsInstanceOf<PageTurnView>(testingTarget, "Should be an instance of PageTurnView!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"PageTurnViewConstructorWithPageTurnView END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("PageTurnView Assign")]
+ [Property("SPEC", "Tizen.NUI.PageTurnView.Assign M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PageTurnViewAssign()
+ {
+ tlog.Debug(tag, $"PageTurnViewAssign START");
+
+ var testingTarget = pageTurnView.Assign(pageTurnView);
+ Assert.IsNotNull(testingTarget, "Can't create success object PageTurnView");
+ Assert.IsInstanceOf<PageTurnView>(testingTarget, "Should be an instance of PageTurnView!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"PageTurnViewAssign END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("PageTurnView DownCast")]
+ [Property("SPEC", "Tizen.NUI.PageTurnView.DownCast M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PageTurnViewDownCast()
+ {
+ tlog.Debug(tag, $"PageTurnViewDownCast START");
+
+ try
+ {
+ PageTurnView.DownCast(pageTurnView);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ tlog.Debug(tag, $"PageTurnViewDownCast END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("PageTurnView GetPageTurnViewFromPtr")]
+ [Property("SPEC", "Tizen.NUI.PageTurnView.GetPageTurnViewFromPtr M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PageTurnViewGetPageTurnViewFromPtr()
+ {
+ tlog.Debug(tag, $"PageTurnViewGetPageTurnViewFromPtr START");
+
+ var testingTarget = PageTurnView.GetPageTurnViewFromPtr(pageTurnView.SwigCPtr.Handle);
+ Assert.IsNotNull(testingTarget, "Can't create success object PageTurnView");
+ Assert.IsInstanceOf<PageTurnView>(testingTarget, "Should be an instance of PageTurnView!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"PageTurnViewGetPageTurnViewFromPtr END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("PageTurnView PageTurnStartedSignal")]
+ [Property("SPEC", "Tizen.NUI.PageTurnView.PageTurnStartedSignal M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PageTurnViewPageTurnStartedSignal()
+ {
+ tlog.Debug(tag, $"PageTurnViewPageTurnStartedSignal START");
+
+ var testingTarget = pageTurnView.PageTurnStartedSignal();
+ Assert.IsNotNull(testingTarget, "Can't create success object PageTurnSignal");
+ Assert.IsInstanceOf<PageTurnSignal>(testingTarget, "Should be an instance of PageTurnSignal!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"PageTurnViewPageTurnStartedSignal END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("PageTurnView PageTurnFinishedSignal")]
+ [Property("SPEC", "Tizen.NUI.PageTurnView.PageTurnFinishedSignal M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PageTurnViewPageTurnFinishedSignal()
+ {
+ tlog.Debug(tag, $"PageTurnViewPageTurnFinishedSignal START");
+
+ var testingTarget = pageTurnView.PageTurnFinishedSignal();
+ Assert.IsNotNull(testingTarget, "Can't create success object PageTurnSignal");
+ Assert.IsInstanceOf<PageTurnSignal>(testingTarget, "Should be an instance of PageTurnSignal!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"PageTurnViewPageTurnFinishedSignal END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("PageTurnView PagePanStartedSignal")]
+ [Property("SPEC", "Tizen.NUI.PageTurnView.PagePanStartedSignal M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PageTurnViewPagePanStartedSignal()
+ {
+ tlog.Debug(tag, $"PageTurnViewPagePanStartedSignal START");
+
+ var testingTarget = pageTurnView.PagePanStartedSignal();
+ Assert.IsNotNull(testingTarget, "Can't create success object PagePanSignal");
+ Assert.IsInstanceOf<PagePanSignal>(testingTarget, "Should be an instance of PagePanSignal!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"PageTurnViewPagePanStartedSignal END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("PageTurnView PagePanFinishedSignal")]
+ [Property("SPEC", "Tizen.NUI.PageTurnView.PagePanFinishedSignal M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PageTurnViewPagePanFinishedSignal()
+ {
+ tlog.Debug(tag, $"PageTurnViewPagePanFinishedSignal START");
+
+ var testingTarget = pageTurnView.PagePanFinishedSignal();
+ Assert.IsNotNull(testingTarget, "Can't create success object PagePanSignal");
+ Assert.IsInstanceOf<PagePanSignal>(testingTarget, "Should be an instance of PagePanSignal!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"PageTurnViewPagePanFinishedSignal END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("PageTurnView PageSize")]
+ [Property("SPEC", "Tizen.NUI.PageTurnView.PageSize A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PageTurnViewPageSize()
+ {
+ tlog.Debug(tag, $"PageTurnViewPageSize START");
+
+ pageTurnView.PageSize = new Vector2(100, 50);
+ tlog.Debug(tag, "PageSize : " + pageTurnView.PageSize);
+
+ tlog.Debug(tag, $"PageTurnViewPageSize END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("PageTurnView CurrentPageId")]
+ [Property("SPEC", "Tizen.NUI.PageTurnView.CurrentPageId A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PageTurnViewCurrentPageId()
+ {
+ tlog.Debug(tag, $"PageTurnViewCurrentPageId START");
+
+ pageTurnView.CurrentPageId = 1;
+ tlog.Debug(tag, "CurrentPageId : " + pageTurnView.CurrentPageId);
+
+ tlog.Debug(tag, $"PageTurnViewCurrentPageId END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("PageTurnView SpineShadow")]
+ [Property("SPEC", "Tizen.NUI.PageTurnView.SpineShadow A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PageTurnViewSpineShadow()
+ {
+ tlog.Debug(tag, $"PageTurnViewSpineShadow START");
+
+ pageTurnView.SpineShadow = new Vector2(100, 50);
+ tlog.Debug(tag, "SpineShadow : " + pageTurnView.SpineShadow);
+
+ tlog.Debug(tag, $"PageTurnViewSpineShadow END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("PageTurnView PagePanStartedEventArgs")]
+ [Property("SPEC", "Tizen.NUI.PageTurnView.PagePanStartedEventArgs A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PageTurnViewPagePanStartedEventArgs()
+ {
+ tlog.Debug(tag, $"PageTurnViewPagePanStartedEventArgs START");
+
+ var testingTarget = new PageTurnView.PagePanStartedEventArgs();
+ Assert.IsNotNull(testingTarget, "Can't create success object PagePanStartedEventArgs");
+ Assert.IsInstanceOf<PageTurnView.PagePanStartedEventArgs>(testingTarget, "Should be an instance of PagePanStartedEventArgs!");
+
+ testingTarget.PageTurnView = pageTurnView;
+ tlog.Debug(tag, "pageTurnView : " + testingTarget.PageTurnView);
+
+ tlog.Debug(tag, $"PageTurnViewPagePanStartedEventArgs END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("PageTurnView PagePanFinishedEventArgs ")]
+ [Property("SPEC", "Tizen.NUI.PageTurnView.PagePanFinishedEventArgs A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PageTurnViewPagePanFinishedEventArgs()
+ {
+ tlog.Debug(tag, $"PageTurnViewPagePanFinishedEventArgs START");
+
+ var testingTarget = new PageTurnView.PagePanFinishedEventArgs();
+ Assert.IsNotNull(testingTarget, "Can't create success object PagePanFinishedEventArgs");
+ Assert.IsInstanceOf<PageTurnView.PagePanFinishedEventArgs>(testingTarget, "Should be an instance of PagePanFinishedEventArgs !");
+
+ testingTarget.PageTurnView = pageTurnView;
+ tlog.Debug(tag, "pageTurnView : " + testingTarget.PageTurnView);
+
+ tlog.Debug(tag, $"PageTurnViewPagePanFinishedEventArgs END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("PageTurnView PageTurnStartedEventArgs ")]
+ [Property("SPEC", "Tizen.NUI.PageTurnView.PageTurnStartedEventArgs A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PageTurnViewPageTurnStartedEventArgs()
+ {
+ tlog.Debug(tag, $"PageTurnViewPageTurnStartedEventArgs START");
+
+ var testingTarget = new PageTurnView.PageTurnStartedEventArgs();
+ Assert.IsNotNull(testingTarget, "Can't create success object PageTurnStartedEventArgs");
+ Assert.IsInstanceOf<PageTurnView.PageTurnStartedEventArgs>(testingTarget, "Should be an instance of PageTurnStartedEventArgs !");
+
+ testingTarget.PageTurnView = pageTurnView;
+ tlog.Debug(tag, "pageTurnView : " + testingTarget.PageTurnView);
+
+ testingTarget.PageIndex = 1;
+ tlog.Debug(tag, "PageIndex : " + testingTarget.PageIndex);
+
+ testingTarget.IsTurningForward = true;
+ tlog.Debug(tag, "IsTurningForward : " + testingTarget.IsTurningForward);
+
+ tlog.Debug(tag, $"PageTurnViewPageTurnStartedEventArgs END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("PageTurnView PageTurnFinishedEventArgs ")]
+ [Property("SPEC", "Tizen.NUI.PageTurnView.PageTurnFinishedEventArgs A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PageTurnViewPageTurnFinishedEventArgs()
+ {
+ tlog.Debug(tag, $"PageTurnViewPageTurnFinishedEventArgs START");
+
+ var testingTarget = new PageTurnView.PageTurnFinishedEventArgs();
+ Assert.IsNotNull(testingTarget, "Can't create success object PageTurnFinishedEventArgs ");
+ Assert.IsInstanceOf<PageTurnView.PageTurnFinishedEventArgs>(testingTarget, "Should be an instance of PageTurnFinishedEventArgs !");
+
+ testingTarget.PageTurnView = pageTurnView;
+ tlog.Debug(tag, "pageTurnView : " + testingTarget.PageTurnView);
+
+ testingTarget.PageIndex = 1;
+ tlog.Debug(tag, "PageIndex : " + testingTarget.PageIndex);
+
+ testingTarget.IsTurningForward = true;
+ tlog.Debug(tag, "IsTurningForward : " + testingTarget.IsTurningForward);
+
+ tlog.Debug(tag, $"PageTurnViewPageTurnFinishedEventArgs END (OK)");
+ }
+
+ private void OnPagePanStarted(object source, PageTurnView.PagePanStartedEventArgs e) { }
+ private void OnPagePanFinished(object source, PageTurnView.PagePanFinishedEventArgs e) { }
+ private void OnPageTurnFinished(object source, PageTurnView.PageTurnFinishedEventArgs e) { }
+ private void OnPageTurnStarted(object source, PageTurnView.PageTurnStartedEventArgs e) { }
}
}
using NUnit.Framework;
using System;
using System.Collections.Generic;
-using System.Reflection;
using System.Xml;
+using Tizen.NUI.Binding;
using Tizen.NUI.Xaml;
namespace Tizen.NUI.Devel.Tests
[TestFixture]
[Description("internal/Xaml/ApplyPropertiesVisitor")]
- public class InternalXamlApplyPropertiesVisitorTest
+ public class InternalApplyPropertiesVisitorTest
{
private const string tag = "NUITEST";
- public const string NUI2018Uri = "http://tizen.org/Tizen.NUI/2018/XAML";
- private string xaml_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "simpleXaml.xaml";
private ApplyPropertiesVisitor visitor;
+
+ internal class INodeImpl : INode
+ {
+ public global::System.Collections.Generic.List<string> IgnorablePrefixes { get; set; }
+ public global::System.Xml.IXmlNamespaceResolver NamespaceResolver => new INodeImpl().NamespaceResolver;
+ public INode Parent { get; set; }
+ public void Accept(IXamlNodeVisitor visitor, INode parentNode) { }
+ public INode Clone() { return new INodeImpl(); }
+ }
+
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- HydrationContext context = new HydrationContext();
- visitor = new ApplyPropertiesVisitor(context, false);
+ visitor = new ApplyPropertiesVisitor(new HydrationContext(), false);
}
[TearDown]
[Test]
[Category("P1")]
- [Description("ApplyPropertiesVisitor ApplyPropertiesVisitor")]
- [Property("SPEC", "Tizen.NUI.ApplyPropertiesVisitor.ApplyPropertiesVisitor C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
- public void ApplyPropertiesVisitorConstructor()
- {
- tlog.Debug(tag, $"ApplyPropertiesVisitorConstructor START");
-
- var testingTarget = new ApplyPropertiesVisitor(new HydrationContext(), false);
- Assert.IsNotNull(testingTarget, "Can't create success object ApplyPropertiesVisitor");
- Assert.IsInstanceOf<ApplyPropertiesVisitor>(testingTarget, "Should be an instance of ApplyPropertiesVisitor type.");
-
- tlog.Debug(tag, $"ApplyPropertiesVisitorConstructor END (OK)");
- }
-
- [Test]
- [Category("P1")]
- [Description("ApplyPropertiesVisitor Skips.")]
- [Property("SPEC", "Tizen.NUI.ApplyPropertiesVisitor.Skips M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
- public void ApplyPropertiesVisitorSkips()
- {
- tlog.Debug(tag, $"ApplyPropertiesVisitorSkips START");
-
- var testingTarget = ApplyPropertiesVisitor.Skips;
- Assert.IsNotNull(testingTarget, "Can't create success object ApplyPropertiesVisitor");
- Assert.IsInstanceOf<IList<XmlName>>(testingTarget, "Should be an instance of IList<XmlName> type.");
-
- tlog.Debug(tag, $"ApplyPropertiesVisitorSkips END (OK)");
- }
-
- [Test]
- [Category("P1")]
[Description("ApplyPropertiesVisitor VisitingMode")]
- [Property("SPEC", "Tizen.NUI.ApplyPropertiesVisitor.VisitingMode M")]
+ [Property("SPEC", "Tizen.NUI.ApplyPropertiesVisitor.VisitingMode A")]
[Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
+ [Property("CRITERIA", "PRW")]
public void ApplyPropertiesVisitorVisitingMode()
{
tlog.Debug(tag, $"ApplyPropertiesVisitorVisitingMode START");
Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"ApplyPropertiesVisitorVisitingMode END (OK)");
+ tlog.Debug(tag, $"ApplyPropertiesVisitorVisitingMode END");
}
[Test]
[Category("P1")]
[Description("ApplyPropertiesVisitor StopOnDataTemplate")]
- [Property("SPEC", "Tizen.NUI.ApplyPropertiesVisitor.StopOnDataTemplate M")]
+ [Property("SPEC", "Tizen.NUI.ApplyPropertiesVisitor.StopOnDataTemplate A")]
[Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
+ [Property("CRITERIA", "PRW")]
public void ApplyPropertiesVisitorStopOnDataTemplate()
{
tlog.Debug(tag, $"ApplyPropertiesVisitorStopOnDataTemplate START");
Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"ApplyPropertiesVisitorStopOnDataTemplate END (OK)");
+ tlog.Debug(tag, $"ApplyPropertiesVisitorStopOnDataTemplate END");
}
[Test]
[Property("SPEC", "Tizen.NUI.ApplyPropertiesVisitor.StopOnResourceDictionary A")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
public void ApplyPropertiesVisitorStopOnResourceDictionary()
{
tlog.Debug(tag, $"ApplyPropertiesVisitorStopOnResourceDictionary START");
Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"ApplyPropertiesVisitorStopOnResourceDictionary END (OK)");
+ tlog.Debug(tag, $"ApplyPropertiesVisitorStopOnResourceDictionary END");
}
[Test]
[Category("P1")]
[Description("ApplyPropertiesVisitor VisitNodeOnDataTemplate ")]
- [Property("SPEC", "Tizen.NUI.ApplyPropertiesVisitor.VisitNodeOnDataTemplate M")]
+ [Property("SPEC", "Tizen.NUI.ApplyPropertiesVisitor.VisitNodeOnDataTemplate A")]
[Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
+ [Property("CRITERIA", "PRW")]
public void ApplyPropertiesVisitorVisitNodeOnDataTemplate()
{
tlog.Debug(tag, $"ApplyPropertiesVisitorVisitNodeOnDataTemplate START");
Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"ApplyPropertiesVisitorVisitNodeOnDataTemplate END (OK)");
- }
-
- internal class INodeImplement : INode
- {
- public global::System.Collections.Generic.List<string> IgnorablePrefixes { get; set; }
-
- public global::System.Xml.IXmlNamespaceResolver NamespaceResolver => new XmlNamespaceResolver();
-
- public INode Parent { get; set; }
-
- public void Accept(IXamlNodeVisitor visitor, INode parentNode) { }
-
- public INode Clone()
- {
- return null;
- }
+ tlog.Debug(tag, $"ApplyPropertiesVisitorVisitNodeOnDataTemplate END");
}
[Test]
try
{
- INodeImplement n1 = new INodeImplement();
- INodeImplement n2 = new INodeImplement();
- bool b1 = visitor.SkipChildren(n1, n2);
- }
- catch (Exception e)
- {
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
- }
+ var child = new INodeImpl();
+ Assert.IsNotNull(child, "null INodeImpl object.");
- tlog.Debug(tag, $"ApplyPropertiesVisitorSkipChildren END (OK)");
- Assert.Pass("ApplyPropertiesVisitorSkipChildren");
- }
+ var parent = new INodeImpl();
+ Assert.IsNotNull(parent, "null INodeImpl object.");
- public class IXmlNamespaceResolverImplement : IXmlNamespaceResolver
- {
- public IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope)
- {
- throw new NotImplementedException();
+ var result = visitor.SkipChildren(child, parent);
+ tlog.Debug(tag, "SkipChildren : " + result);
}
-
- public string LookupNamespace(string prefix)
+ catch (Exception e)
{
- throw new NotImplementedException();
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- public string LookupPrefix(string namespaceName)
- {
- throw new NotImplementedException();
- }
+ tlog.Debug(tag, $"ApplyPropertiesVisitorSkipChildren END");
}
-
- //[Test]
- //[Category("P1")]
- //[Description("ApplyPropertiesVisitor IsResourceDictionary")]
- //[Property("SPEC", "Tizen.NUI.ApplyPropertiesVisitor.IsResourceDictionary M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void ApplyPropertiesVisitorIsResourceDictionary()
- //{
- // tlog.Debug(tag, $"ApplyPropertiesVisitorIsResourceDictionary START");
-
- // try
- // {
- // IList<XmlType> list = null;
- // XmlType xmlType = new XmlType("myNameSpace", "myName", list);
-
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
- // ElementNode n1 = new ElementNode(xmlType, "myNameSpace", i1);
- // bool b1 = visitor.IsResourceDictionary(n1);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"ApplyPropertiesVisitorIsResourceDictionary END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
-
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("ApplyPropertiesVisitor Visit. With ValueNode.")]
- //[Property("SPEC", "Tizen.NUI.ApplyPropertiesVisitor.Visit M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void ApplyPropertiesVisitorVisitWithValueNode()
- //{
- // tlog.Debug(tag, $"ApplyPropertiesVisitorVisitWithValueNode START");
-
- // try
- // {
- // object o1 = new object();
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
- // ValueNode valueNode = new ValueNode(o1, i1);
-
- // INodeImplement nodeImplement = new INodeImplement();
- // visitor.Visit(valueNode, nodeImplement);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"ApplyPropertiesVisitorVisitWithValueNode END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("ApplyPropertiesVisitor Visit. With ElementNode.")]
- //[Property("SPEC", "Tizen.NUI.ApplyPropertiesVisitor.Visit M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void ApplyPropertiesVisitorVisitWithElementNode()
- //{
- // tlog.Debug(tag, $"ApplyPropertiesVisitorVisitWithElementNode START");
-
- // try
- // {
- // INodeImplement nodeImplement = new INodeImplement();
-
- // IList<XmlType> list = null;
- // XmlType xmlType = new XmlType("myNameSpace", "myName", list);
-
- // IXmlNamespaceResolverImplement ix1 = new IXmlNamespaceResolverImplement();
- // ElementNode n1 = new ElementNode(xmlType, "myNameSpace", ix1);
-
- // visitor.Visit(n1, nodeImplement);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"ApplyPropertiesVisitorVisit END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("ApplyPropertiesVisitor TryGetPropertyName")]
- //[Property("SPEC", "Tizen.NUI.ApplyPropertiesVisitor.TryGetPropertyName M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void ApplyPropertiesVisitorTryGetPropertyName()
- //{
- // tlog.Debug(tag, $"ApplyPropertiesVisitorTryGetPropertyName START");
-
- // try
- // {
- // INodeImplement n1 = new INodeImplement();
- // INodeImplement n2 = new INodeImplement();
- // XmlName xmlName = new XmlName();
- // ApplyPropertiesVisitor.TryGetPropertyName(n1, n2, out xmlName);
- // }
- // catch (Exception e)
- // {
- // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- // Assert.Fail("Caught Exception" + e.ToString());
- // }
-
- // tlog.Debug(tag, $"ApplyPropertiesVisitorTryGetPropertyName END (OK)");
- // Assert.Pass("ApplyPropertiesVisitorTryGetPropertyName");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("ApplyPropertiesVisitor IsCollectionItem")]
- //[Property("SPEC", "Tizen.NUI.ApplyPropertiesVisitor.IsCollectionItem M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void ApplyPropertiesVisitorIsCollectionItem()
- //{
- // tlog.Debug(tag, $"ApplyPropertiesVisitorIsCollectionItem START");
-
- // try
- // {
- // INodeImplement n1 = new INodeImplement();
- // INodeImplement n2 = new INodeImplement();
-
- // ApplyPropertiesVisitor.IsCollectionItem(n1, n2);
- // }
- // catch (Exception e)
- // {
- // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- // Assert.Fail("Caught Exception" + e.ToString());
- // }
-
- // tlog.Debug(tag, $"ApplyPropertiesVisitorIsCollectionItem END (OK)");
- // Assert.Pass("ApplyPropertiesVisitorIsCollectionItem");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("ApplyPropertiesVisitor GetContentPropertyName")]
- //[Property("SPEC", "Tizen.NUI.ApplyPropertiesVisitor.GetContentPropertyName M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void ApplyPropertiesVisitorGetContentPropertyName()
- //{
- // tlog.Debug(tag, $"ApplyPropertiesVisitorGetContentPropertyName START");
-
- // try
- // {
- // var typeInfo = new BindingExtension().GetType().GetTypeInfo();
- // ApplyPropertiesVisitor.GetContentPropertyName(typeInfo);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception : Failed!");
- // }
-
- // tlog.Debug(tag, $"ApplyPropertiesVisitorGetContentPropertyName END (OK)");
- //}
-
- //public class IXmlLineInfoImplement : IXmlLineInfo
- //{
- // public int LineNumber => throw new NotImplementedException();
-
- // public int LinePosition => throw new NotImplementedException();
-
- // public bool HasLineInfo()
- // {
- // throw new NotImplementedException();
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("ApplyPropertiesVisitor SetPropertyValue")]
- //[Property("SPEC", "Tizen.NUI.ApplyPropertiesVisitor.SetPropertyValue M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void ApplyPropertiesVisitorProvideValue()
- //{
- // tlog.Debug(tag, $"ApplyPropertiesVisitorSetPropertyValue START");
-
- // try
- // {
- // object o1 = new object();
- // XmlName xmlName = new XmlName();
- // object value = new object();
- // object rootElement = new object();
- // INodeImplement nodeImplement = new INodeImplement();
- // HydrationContext context = new HydrationContext();
- // IXmlLineInfoImplement xmlLineInfoImplement = new IXmlLineInfoImplement();
-
- // ApplyPropertiesVisitor.SetPropertyValue(o1, xmlName, value, rootElement, nodeImplement, context, xmlLineInfoImplement);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"ApplyPropertiesVisitorSetPropertyValue END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("ApplyPropertiesVisitor GetPropertyValue")]
- //[Property("SPEC", "Tizen.NUI.ApplyPropertiesVisitor.GetPropertyValue M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void ApplyPropertiesVisitorGetPropertyValue()
- //{
- // tlog.Debug(tag, $"ApplyPropertiesVisitorGetPropertyValue START");
-
- // try
- // {
- // object o1 = new object();
- // XmlName xmlName = new XmlName();
- // object value = new object();
- // INodeImplement nodeImplement = new INodeImplement();
- // HydrationContext context = new HydrationContext();
- // IXmlLineInfoImplement xmlLineInfoImplement = new IXmlLineInfoImplement();
-
- // ApplyPropertiesVisitor.GetPropertyValue(o1, xmlName, context, xmlLineInfoImplement, out value);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"ApplyPropertiesVisitorGetPropertyValue END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
}
}
\ No newline at end of file
[TestFixture]
[Description("internal/Xaml/CreateValuesVisitor")]
- public class InternalXamlCreateValuesVisitorTest
+ public class InternalCreateValuesVisitorTest
{
private const string tag = "NUITEST";
- private CreateValuesVisitor c1;
+ private CreateValuesVisitor visitor;
+
+ internal class INodeImpl : INode
+ {
+ public global::System.Collections.Generic.List<string> IgnorablePrefixes { get; set; }
+ public global::System.Xml.IXmlNamespaceResolver NamespaceResolver => new INodeImpl().NamespaceResolver;
+ public INode Parent { get; set; }
+ public void Accept(IXamlNodeVisitor visitor, INode parentNode) { }
+ public INode Clone() { return new INodeImpl(); }
+ }
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- HydrationContext context = new HydrationContext();
- c1 = new CreateValuesVisitor(context);
+ visitor = new CreateValuesVisitor(new HydrationContext());
}
[TearDown]
public void Destroy()
{
- c1 = null;
+ visitor = null;
tlog.Info(tag, "Destroy() is called!");
}
[Test]
[Category("P1")]
- [Description("CreateValuesVisitor CreateValuesVisitor")]
- [Property("SPEC", "Tizen.NUI.CreateValuesVisitor.CreateValuesVisitor C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- public void CreateValuesVisitorConstructor()
- {
- tlog.Debug(tag, $"ApplyPropertiesVisitorConstructor START");
-
- HydrationContext context = new HydrationContext();
-
- CreateValuesVisitor createValuesVisitor = new CreateValuesVisitor(context);
-
- tlog.Debug(tag, $"CreateValuesVisitorConstructor END (OK)");
- Assert.Pass("CreateValuesVisitorConstructor");
- }
-
- [Test]
- [Category("P1")]
[Description("CreateValuesVisitor VisitingMode")]
[Property("SPEC", "Tizen.NUI.CreateValuesVisitor.VisitingMode A")]
[Property("SPEC_URL", "-")]
try
{
- TreeVisitingMode t1 = c1.VisitingMode;
+ var result = visitor.VisitingMode;
+ tlog.Debug(tag, "VisitingMode : " + result);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"CreateValuesVisitorVisitingMode END (OK)");
- Assert.Pass("CreateValuesVisitorVisitingMode");
+ tlog.Debug(tag, $"CreateValuesVisitorVisitingMode END");
}
[Test]
try
{
- bool b1 = c1.StopOnDataTemplate;
+ var result = visitor.StopOnDataTemplate;
+ tlog.Debug(tag, "StopOnDataTemplate : " + result);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"CreateValuesVisitorStopOnDataTemplate END (OK)");
- Assert.Pass("CreateValuesVisitorStopOnDataTemplate");
+ tlog.Debug(tag, $"CreateValuesVisitorStopOnDataTemplate END");
}
[Test]
try
{
- bool b1 = c1.StopOnResourceDictionary;
+ var result = visitor.StopOnResourceDictionary;
+ tlog.Debug(tag, "StopOnResourceDictionary : " + result);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"CreateValuesVisitorStopOnResourceDictionary END (OK)");
- Assert.Pass("CreateValuesVisitorStopOnResourceDictionary");
+ tlog.Debug(tag, $"CreateValuesVisitorStopOnResourceDictionary END");
}
[Test]
try
{
- bool b1 = c1.VisitNodeOnDataTemplate;
+ var result = visitor.VisitNodeOnDataTemplate;
+ tlog.Debug(tag, "VisitNodeOnDataTemplate : " + result);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
- }
-
- tlog.Debug(tag, $"CreateValuesVisitorVisitNodeOnDataTemplate END (OK)");
- Assert.Pass("CreateValuesVisitorVisitNodeOnDataTemplate");
- }
-
- internal class INodeImplement : INode
- {
- public global::System.Collections.Generic.List<string> IgnorablePrefixes { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
-
- public global::System.Xml.IXmlNamespaceResolver NamespaceResolver => throw new NotImplementedException();
-
- public INode Parent { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
-
- public void Accept(IXamlNodeVisitor visitor, INode parentNode)
- {
- throw new NotImplementedException();
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- public INode Clone()
- {
- throw new NotImplementedException();
- }
+ tlog.Debug(tag, $"CreateValuesVisitorVisitNodeOnDataTemplate END");
}
[Test]
try
{
- INodeImplement node = new INodeImplement();
- INodeImplement nodeParent = new INodeImplement();
- bool b1 = c1.SkipChildren(node, nodeParent);
- }
- catch (Exception e)
- {
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
- }
+ var child = new INodeImpl();
+ Assert.IsNotNull(child, "null INodeImpl");
- tlog.Debug(tag, $"CreateValuesVisitorSkipChildren END (OK)");
- Assert.Pass("CreateValuesVisitorSkipChildren");
- }
+ var parent = new INodeImpl();
+ Assert.IsNotNull(parent, "null INodeImpl");
- public class IXmlNamespaceResolverImplement : IXmlNamespaceResolver
- {
- public IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope)
- {
- throw new NotImplementedException();
+ var result = visitor.SkipChildren(child, parent);
+ tlog.Debug(tag, "SkipChildren : " + result);
}
-
- public string LookupNamespace(string prefix)
+ catch (Exception e)
{
- throw new NotImplementedException();
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- public string LookupPrefix(string namespaceName)
- {
- throw new NotImplementedException();
- }
+ tlog.Debug(tag, $"CreateValuesVisitorSkipChildren END");
}
-
- //[Test]
- //[Category("P1")]
- //[Description("CreateValuesVisitor IsResourceDictionary")]
- //[Property("SPEC", "Tizen.NUI.CreateValuesVisitor.IsResourceDictionary M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void CreateValuesVisitorIsResourceDictionary()
- //{
- // tlog.Debug(tag, $"CreateValuesVisitorIsResourceDictionary START");
-
- // try
- // {
- // IList<XmlType> list = null;
- // XmlType xmlType = new XmlType("myNameSpace", "myName", list);
-
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
- // ElementNode n1 = new ElementNode(xmlType, "myNameSpace", i1);
-
- // bool b1 = c1.IsResourceDictionary(n1);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"CreateValuesVisitorIsResourceDictionary END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
-
- //public class RootNodeImplement : RootNode
- //{
- // public RootNodeImplement(XmlType xmlType, IXmlNamespaceResolver nsResolver) : base(xmlType, nsResolver)
- // {
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("CreateValuesVisitor Visit")]
- //[Property("SPEC", "Tizen.NUI.CreateValuesVisitor.Visit M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void CreateValuesVisitorVisit1()
- //{
- // tlog.Debug(tag, $"CreateValuesVisitorVisit START");
-
- // try
- // {
- // object o1 = new object();
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
- // ValueNode node = new ValueNode(o1, i1);
- // INodeImplement parentNode = new INodeImplement();
- // c1.Visit(node, parentNode);
- // }
- // catch (Exception e)
- // {
- // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- // Assert.Fail("Caught Exception" + e.ToString());
- // }
-
- // tlog.Debug(tag, $"CreateValuesVisitorVisit END (OK)");
- // Assert.Pass("CreateValuesVisitorVisit");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("CreateValuesVisitor Visit")]
- //[Property("SPEC", "Tizen.NUI.CreateValuesVisitor.Visit M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void CreateValuesVisitorVisit2()
- //{
- // tlog.Debug(tag, $"CreateValuesVisitorVisit START");
-
- // try
- // {
- // INodeImplement parentNode = new INodeImplement();
-
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
- // IList<XmlType> list = null;
- // XmlType xmlType = new XmlType("myNameSpace", "myName", list);
-
- // ElementNode n1 = new ElementNode(xmlType, "myNameSpace", i1);
-
- // c1.Visit(n1, parentNode);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"CreateValuesVisitorVisit END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("CreateValuesVisitor Visit")]
- //[Property("SPEC", "Tizen.NUI.CreateValuesVisitor.Visit M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void CreateValuesVisitorVisit3()
- //{
- // tlog.Debug(tag, $"CreateValuesVisitorVisit START");
-
- // try
- // {
- // INodeImplement parentNode = new INodeImplement();
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
- // IList<XmlType> list = null;
- // XmlType xmlType = new XmlType("myNameSpace", "myName", list);
- // RootNodeImplement rootNode = new RootNodeImplement(xmlType, i1);
- // c1.Visit(rootNode, parentNode);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"CreateValuesVisitorVisit END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
-
- //}
-
- //public class IElementNodeImplement : IElementNode
- //{
- // public Dictionary<XmlName, INode> Properties => throw new NotImplementedException();
-
- // public List<XmlName> SkipProperties => throw new NotImplementedException();
-
- // public INameScope Namescope => throw new NotImplementedException();
-
- // public XmlType XmlType => throw new NotImplementedException();
-
- // public string NamespaceURI => throw new NotImplementedException();
-
- // public List<INode> CollectionItems => throw new NotImplementedException();
-
- // public List<string> IgnorablePrefixes { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
-
- // public IXmlNamespaceResolver NamespaceResolver => throw new NotImplementedException();
-
- // public INode Parent { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
-
- // public void Accept(IXamlNodeVisitor visitor, INode parentNode)
- // {
- // throw new NotImplementedException();
- // }
-
- // public INode Clone()
- // {
- // throw new NotImplementedException();
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("CreateValuesVisitor CreateFromParameterizedConstructor")]
- //[Property("SPEC", "Tizen.NUI.CreateValuesVisitor.CreateFromParameterizedConstructor M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void CreateValuesVisitorCreateFromParameterizedConstructor()
- //{
- // tlog.Debug(tag, $"CreateValuesVisitorCreateFromParameterizedConstructor START");
-
- // try
- // {
- // Type type = typeof(string);
- // IElementNodeImplement i1 = new IElementNodeImplement();
- // c1.CreateFromParameterizedConstructor(type, i1);
- // }
- // catch (Exception e)
- // {
- // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- // Assert.Fail("Caught Exception" + e.ToString());
- // }
-
- // tlog.Debug(tag, $"CreateValuesVisitorCreateFromParameterizedConstructor END (OK)");
- // Assert.Pass("CreateValuesVisitorCreateFromParameterizedConstructor");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("CreateValuesVisitor CreateFromFactory")]
- //[Property("SPEC", "Tizen.NUI.CreateValuesVisitor.CreateFromFactory M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void CreateValuesVisitorCreateFromFactory()
- //{
- // tlog.Debug(tag, $"CreateValuesVisitorCreateFromFactory START");
-
- // try
- // {
- // Type type = typeof(string);
- // IElementNodeImplement i1 = new IElementNodeImplement();
- // c1.CreateFromFactory(type, i1);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"CreateValuesVisitorCreateFromFactory END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("CreateValuesVisitor CreateArgumentsArray")]
- //[Property("SPEC", "Tizen.NUI.CreateValuesVisitor.CreateArgumentsArray M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void CreateValuesVisitorCreateArgumentsArray()
- //{
- // tlog.Debug(tag, $"CreateValuesVisitorCreateArgumentsArray START");
-
- // try
- // {
- // IElementNodeImplement i1 = new IElementNodeImplement();
- // c1.CreateArgumentsArray(i1);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"CreateValuesVisitorCreateArgumentsArray END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
}
}
\ No newline at end of file
[TestFixture]
[Description("internal/Xaml/DesignMode")]
- public class InternalXamlDesignModeTest
+ public class InternalDesignModeTest
{
private const string tag = "NUITEST";
try
{
- bool b1 = DesignMode.IsDesignModeEnabled;
- DesignMode.IsDesignModeEnabled = b1;
+ var mode = DesignMode.IsDesignModeEnabled;
+ DesignMode.IsDesignModeEnabled = mode;
+ Assert.AreEqual(mode, DesignMode.IsDesignModeEnabled, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"DesignModeIsDesignModeEnabled END (OK)");
- Assert.Pass("DesignModeIsDesignModeEnabled");
+ tlog.Debug(tag, $"DesignModeIsDesignModeEnabled END");
}
}
}
\ No newline at end of file
public class InternalExpandMarkupsVisitorTest
{
private const string tag = "NUITEST";
- private ExpandMarkupsVisitor e1;
+ private ExpandMarkupsVisitor visitor;
+
+ internal class INodeImpl : INode
+ {
+ public global::System.Collections.Generic.List<string> IgnorablePrefixes { get; set; }
+ public global::System.Xml.IXmlNamespaceResolver NamespaceResolver => new INodeImpl().NamespaceResolver;
+ public INode Parent { get; set; }
+ public void Accept(IXamlNodeVisitor visitor, INode parentNode) { }
+ public INode Clone() { return new INodeImpl(); }
+ }
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- HydrationContext context = new HydrationContext();
-
- e1 = new ExpandMarkupsVisitor(context);
+ visitor = new ExpandMarkupsVisitor(new HydrationContext());
}
[TearDown]
public void Destroy()
{
- e1 = null;
+ visitor = null;
tlog.Info(tag, "Destroy() is called!");
}
[Test]
[Category("P1")]
- [Description("ExpandMarkupsVisitor ExpandMarkupsVisitor")]
- [Property("SPEC", "Tizen.NUI.ExpandMarkupsVisitor.ExpandMarkupsVisitor C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- public void ExpandMarkupsVisitorConstructor()
- {
- tlog.Debug(tag, $"ApplyPropertiesVisitorConstructor START");
-
- HydrationContext context = new HydrationContext();
-
- ExpandMarkupsVisitor expandMarkupsVisitor = new ExpandMarkupsVisitor(context);
-
- tlog.Debug(tag, $"ExpandMarkupsVisitorConstructor END (OK)");
- Assert.Pass("ExpandMarkupsVisitorConstructor");
- }
-
- [Test]
- [Category("P1")]
- [Description("ExpandMarkupsVisitor Skips")]
- [Property("SPEC", "Tizen.NUI.ExpandMarkupsVisitor.Skips A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- public void ExpandMarkupsVisitorSkips()
- {
- tlog.Debug(tag, $"ExpandMarkupsVisitorSkips START");
-
- try
- {
- IList<XmlName> l1 = ExpandMarkupsVisitor.Skips;
- }
- catch (Exception e)
- {
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
- }
-
- tlog.Debug(tag, $"ExpandMarkupsVisitorSkips END (OK)");
- Assert.Pass("ExpandMarkupsVisitorSkips");
- }
-
- [Test]
- [Category("P1")]
[Description("ExpandMarkupsVisitor VisitingMode")]
[Property("SPEC", "Tizen.NUI.ExpandMarkupsVisitor.VisitingMode A")]
[Property("SPEC_URL", "-")]
try
{
- TreeVisitingMode t1 = e1.VisitingMode;
+ var result = visitor.VisitingMode;
+ tlog.Debug(tag, "VisitingMode : " + result);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"ExpandMarkupsVisitorVisitingMode END (OK)");
- Assert.Pass("ExpandMarkupsVisitorVisitingMode");
+ tlog.Debug(tag, $"ExpandMarkupsVisitorVisitingMode END");
}
[Test]
try
{
- bool b1 = e1.StopOnDataTemplate;
+ var result = visitor.StopOnDataTemplate;
+ tlog.Debug(tag, "StopOnDataTemplate : " + result);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"ExpandMarkupsVisitorStopOnDataTemplate END (OK)");
- Assert.Pass("ExpandMarkupsVisitorStopOnDataTemplate");
+ tlog.Debug(tag, $"ExpandMarkupsVisitorStopOnDataTemplate END");
}
[Test]
try
{
- bool b1 = e1.StopOnResourceDictionary;
+ var result = visitor.StopOnResourceDictionary;
+ tlog.Debug(tag, "StopOnResourceDictionary : " + result);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"ExpandMarkupsVisitorStopOnResourceDictionary END (OK)");
- Assert.Pass("ExpandMarkupsVisitorStopOnResourceDictionary");
+ tlog.Debug(tag, $"ExpandMarkupsVisitorStopOnResourceDictionary END");
}
[Test]
try
{
- bool b1 = e1.VisitNodeOnDataTemplate;
+ var result = visitor.VisitNodeOnDataTemplate;
+ tlog.Debug(tag, "VisitNodeOnDataTemplate : " + result);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
- }
-
- tlog.Debug(tag, $"ExpandMarkupsVisitorVisitNodeOnDataTemplate END (OK)");
- Assert.Pass("ExpandMarkupsVisitorVisitNodeOnDataTemplate");
- }
-
- internal class INodeImplement : INode
- {
- public global::System.Collections.Generic.List<string> IgnorablePrefixes { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
-
- public global::System.Xml.IXmlNamespaceResolver NamespaceResolver => throw new NotImplementedException();
-
- public INode Parent { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
-
- public void Accept(IXamlNodeVisitor visitor, INode parentNode)
- {
- throw new NotImplementedException();
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- public INode Clone()
- {
- throw new NotImplementedException();
- }
+ tlog.Debug(tag, $"ExpandMarkupsVisitorVisitNodeOnDataTemplate END");
}
[Test]
try
{
- INodeImplement node = new INodeImplement();
- INodeImplement nodeParent = new INodeImplement();
- bool b1 = e1.SkipChildren(node, nodeParent);
- }
- catch (Exception e)
- {
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
- }
+ var child = new INodeImpl();
+ Assert.IsNotNull(child, "null INodeImpl");
- tlog.Debug(tag, $"ExpandMarkupsVisitorSkipChildren END (OK)");
- Assert.Pass("ExpandMarkupsVisitorSkipChildren");
- }
+ var parent = new INodeImpl();
+ Assert.IsNotNull(parent, "null INodeImpl");
- public class IXmlNamespaceResolverImplement : IXmlNamespaceResolver
- {
- public IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope)
- {
- throw new NotImplementedException();
+ var result = visitor.SkipChildren(child, parent);
+ tlog.Debug(tag, "SkipChildren : " + result);
}
-
- public string LookupNamespace(string prefix)
+ catch (Exception e)
{
- throw new NotImplementedException();
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- public string LookupPrefix(string namespaceName)
- {
- throw new NotImplementedException();
- }
+ tlog.Debug(tag, $"ExpandMarkupsVisitorSkipChildren END");
}
-
- //[Test]
- //[Category("P1")]
- //[Description("ExpandMarkupsVisitor IsResourceDictionary")]
- //[Property("SPEC", "Tizen.NUI.ExpandMarkupsVisitor.IsResourceDictionary M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void ExpandMarkupsVisitorIsResourceDictionary()
- //{
- // tlog.Debug(tag, $"ExpandMarkupsVisitorIsResourceDictionary START");
-
- // try
- // {
- // IList<XmlType> list = null;
- // XmlType xmlType = new XmlType("myNameSpace", "myName", list);
-
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
- // ElementNode n1 = new ElementNode(xmlType, "myNameSpace", i1);
-
- // bool b1 = e1.IsResourceDictionary(n1);
- // }
- // catch (Exception e)
- // {
- // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- // Assert.Fail("Caught Exception" + e.ToString());
- // }
-
- // tlog.Debug(tag, $"ExpandMarkupsVisitorIsResourceDictionary END (OK)");
- // Assert.Pass("ExpandMarkupsVisitorIsResourceDictionary");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("ExpandMarkupsVisitor Visit")]
- //[Property("SPEC", "Tizen.NUI.ExpandMarkupsVisitor.Visit M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void ExpandMarkupsVisitorVisit()
- //{
- // tlog.Debug(tag, $"ExpandMarkupsVisitorVisit START");
-
- // try
- // {
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
- // MarkupNode markupnode = new MarkupNode("markup", i1);
- // INodeImplement parentNode = new INodeImplement();
- // e1.Visit(markupnode, parentNode);
- // }
- // catch (Exception e)
- // {
- // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- // Assert.Fail("Caught Exception" + e.ToString());
- // }
-
- // tlog.Debug(tag, $"ExpandMarkupsVisitorVisit END (OK)");
- // Assert.Pass("ExpandMarkupsVisitorVisit");
- //}
-
- //public class IServiceProviderImplement : IServiceProvider
- //{
- // public object GetService(Type serviceType)
- // {
- // throw new NotImplementedException();
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("ExpandMarkupsVisitor Parse")]
- //[Property("SPEC", "Tizen.NUI.ExpandMarkupsVisitor.MarkupExpansionParser.Parse M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void ExpandMarkupsVisitorParse()
- //{
- // tlog.Debug(tag, $"ExpandMarkupsVisitorParse START");
-
- // try
- // {
- // MarkupExpansionParser markupExpansionParser = new MarkupExpansionParser();
- // IServiceProviderImplement serviceProviderImplement = new IServiceProviderImplement();
-
- // string s1 = new string('a', 4);
- // markupExpansionParser.Parse("matchString", ref s1, serviceProviderImplement);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"ExpandMarkupsVisitorParse END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
}
}
\ No newline at end of file
[TestFixture]
[Description("internal/Xaml/FillResourceDictionariesVisitor")]
- public class InternalXamlFillResourceDictionariesVisitorTest
+ public class InternalFillResourceDictionariesVisitorTest
{
private const string tag = "NUITEST";
- private FillResourceDictionariesVisitor f1;
+ private FillResourceDictionariesVisitor visitor;
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- HydrationContext context = new HydrationContext();
- f1 = new FillResourceDictionariesVisitor(context);
+ visitor = new FillResourceDictionariesVisitor(new HydrationContext());
}
[TearDown]
public void Destroy()
{
+ visitor = null;
tlog.Info(tag, "Destroy() is called!");
}
[Test]
[Category("P1")]
- [Description("FillResourceDictionariesVisitor FillResourceDictionariesVisitor")]
- [Property("SPEC", "Tizen.NUI.FillResourceDictionariesVisitor.FillResourceDictionariesVisitor C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- public void FillResourceDictionariesVisitorConstructor()
- {
- tlog.Debug(tag, $"FillResourceDictionariesVisitorConstructor START");
-
- HydrationContext context = new HydrationContext();
-
- FillResourceDictionariesVisitor fillResourceDictionariesVisitor = new FillResourceDictionariesVisitor(context);
-
- tlog.Debug(tag, $"FillResourceDictionariesVisitorConstructor END (OK)");
- Assert.Pass("FillResourceDictionariesVisitorConstructor");
- }
-
- [Test]
- [Category("P1")]
[Description("FillResourceDictionariesVisitor VisitingMode")]
[Property("SPEC", "Tizen.NUI.FillResourceDictionariesVisitor.VisitingMode A")]
[Property("SPEC_URL", "-")]
try
{
- TreeVisitingMode t1 = f1.VisitingMode;
+ var result = visitor.VisitingMode;
+ tlog.Debug(tag, "VisitingMode : " + result);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"FillResourceDictionariesVisitorVisitingMode END (OK)");
- Assert.Pass("FillResourceDictionariesVisitorVisitingMode");
+ tlog.Debug(tag, $"FillResourceDictionariesVisitorVisitingMode END");
}
[Test]
try
{
- bool b1 = f1.StopOnDataTemplate;
+ var result = visitor.StopOnDataTemplate;
+ tlog.Debug(tag, "StopOnDataTemplate : " + result);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"FillResourceDictionariesVisitorStopOnDataTemplate END (OK)");
- Assert.Pass("FillResourceDictionariesVisitorStopOnDataTemplate");
+ tlog.Debug(tag, $"FillResourceDictionariesVisitorStopOnDataTemplate END");
}
[Test]
try
{
- bool b1 = f1.StopOnResourceDictionary;
+ var result = visitor.StopOnResourceDictionary;
+ tlog.Debug(tag, "StopOnResourceDictionary : " + result);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"FillResourceDictionariesVisitorStopOnResourceDictionary END (OK)");
- Assert.Pass("FillResourceDictionariesVisitorStopOnResourceDictionary");
+ tlog.Debug(tag, $"FillResourceDictionariesVisitorStopOnResourceDictionary END");
}
[Test]
try
{
- var result = f1.VisitNodeOnDataTemplate;
+ var result = visitor.VisitNodeOnDataTemplate;
tlog.Debug(tag, "VisitNodeOnDataTemplate : " + result);
+
}
catch (Exception e)
{
tlog.Debug(tag, e.Message.ToString());
- Assert.Fail("Caught Exception : falied!");
+ Assert.Fail("Caught Exception : Failed!");
}
+ tlog.Debug(tag, $"FillResourceDictionariesVisitorVisitNodeOnDataTemplate END");
- tlog.Debug(tag, $"FillResourceDictionariesVisitorVisitNodeOnDataTemplate END (OK)");
}
-
- public class IXmlNamespaceResolverImplement : IXmlNamespaceResolver
- {
- public IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope)
- {
- throw new NotImplementedException();
- }
-
- public string LookupNamespace(string prefix)
- {
- throw new NotImplementedException();
- }
-
- public string LookupPrefix(string namespaceName)
- {
- throw new NotImplementedException();
- }
- }
-
- //[Test]
- //[Category("P1")]
- //[Description("FillResourceDictionariesVisitor IsResourceDictionary")]
- //[Property("SPEC", "Tizen.NUI.FillResourceDictionariesVisitor.IsResourceDictionary M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void FillResourceDictionariesVisitorIsResourceDictionary()
- //{
- // tlog.Debug(tag, $"FillResourceDictionariesVisitorVisitNodeOnDataTemplate START");
-
- // try
- // {
- // IList<XmlType> list = null;
- // XmlType xmlType = new XmlType("myNameSpace", "myName", list);
-
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
- // ElementNode n1 = new ElementNode(xmlType, "myNameSpace", i1);
-
- // bool b1 = f1.IsResourceDictionary(n1);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"FillResourceDictionariesVisitorVisitNodeOnDataTemplate END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
-
- //public class INodeImplement : INode
- //{
- // public List<string> IgnorablePrefixes { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
-
- // public IXmlNamespaceResolver NamespaceResolver => throw new NotImplementedException();
-
- // public INode Parent { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
-
- // public void Accept(IXamlNodeVisitor visitor, INode parentNode)
- // {
- // throw new NotImplementedException();
- // }
-
- // public INode Clone()
- // {
- // throw new NotImplementedException();
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("FillResourceDictionariesVisitor Visit")]
- //[Property("SPEC", "Tizen.NUI.FillResourceDictionariesVisitor.Visit M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void FillResourceDictionariesVisitorVisit1()
- //{
- // tlog.Debug(tag, $"FillResourceDictionariesVisitorVisit START");
-
- // try
- // {
- // object o1 = new object();
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
- // ValueNode node = new ValueNode(o1, i1);
-
- // INodeImplement parentNode = new INodeImplement();
-
- // f1.Visit(node, parentNode);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"FillResourceDictionariesVisitorVisit END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("FillResourceDictionariesVisitor Visit")]
- //[Property("SPEC", "Tizen.NUI.FillResourceDictionariesVisitor.Visit M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void FillResourceDictionariesVisitorVisit2()
- //{
- // tlog.Debug(tag, $"FillResourceDictionariesVisitorVisit START");
-
- // try
- // {
-
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
-
- // INodeImplement parentNode = new INodeImplement();
-
- // IList<XmlType> list = null;
- // XmlType xmlType = new XmlType("myNameSpace", "myName", list);
-
- // ElementNode n1 = new ElementNode(xmlType, "myNameSpace", i1);
-
- // f1.Visit(n1, parentNode);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"FillResourceDictionariesVisitorVisit END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
-
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("FillResourceDictionariesVisitor SkipChildren")]
- //[Property("SPEC", "Tizen.NUI.FillResourceDictionariesVisitor.SkipChildren M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void FillResourceDictionariesVisitorSkipChildren()
- //{
- // tlog.Debug(tag, $"FillResourceDictionariesVisitorSkipChildren START");
-
- // try
- // {
- // INodeImplement nodeImplement = new INodeImplement();
- // INodeImplement parentNode = new INodeImplement();
-
- // f1.SkipChildren(nodeImplement, parentNode);
-
- // }
- // catch (Exception e)
- // {
- // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- // Assert.Fail("Caught Exception" + e.ToString());
- // }
-
- // tlog.Debug(tag, $"FillResourceDictionariesVisitorSkipChildren END (OK)");
- // Assert.Pass("FillResourceDictionariesVisitorSkipChildren");
- //}
}
}
\ No newline at end of file
[TestFixture]
[Description("internal/Xaml/HydrationContext")]
- public class InternalXamlHydrationContextTest
+ public class InternalHydrationContextTest
{
private const string tag = "NUITEST";
- private HydrationContext h1;
+ private HydrationContext context;
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- h1 = new HydrationContext();
+ context = new HydrationContext();
}
[TearDown]
public void Destroy()
{
+ context = null;
tlog.Info(tag, "Destroy() is called!");
}
try
{
- Dictionary<INode, object> d1 = h1.Values;
+ var dic = context.Values;
+ Assert.AreEqual(0, dic.Count, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"HydrationContextValues END (OK)");
- Assert.Pass("HydrationContextValues");
+ tlog.Debug(tag, $"HydrationContextValues END");
}
[Test]
try
{
- Dictionary<IElementNode, Type> d1 = h1.Types;
+ var dic = context.Types;
+ Assert.AreEqual(0, dic.Count, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"HydrationContextTypes END (OK)");
- Assert.Pass("HydrationContextTypes");
+ tlog.Debug(tag, $"HydrationContextTypes END");
}
[Test]
try
{
- HydrationContext hy1 = h1.ParentContext;
- h1.ParentContext = hy1;
+ var testingTarget = context.ParentContext;
+ context.ParentContext = testingTarget;
+ Assert.AreEqual(testingTarget, context.ParentContext, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"HydrationContextParentContext END (OK)");
- Assert.Pass("HydrationContextParentContext");
+ tlog.Debug(tag, $"HydrationContextParentContext END");
}
[Test]
try
{
- Action<Exception> a1 = h1.ExceptionHandler;
- h1.ExceptionHandler = a1;
+ var action = context.ExceptionHandler;
+ context.ExceptionHandler = action;
+ Assert.AreEqual(action, context.ExceptionHandler, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"HydrationContextExceptionHandler END (OK)");
- Assert.Pass("HydrationContextExceptionHandler");
+ tlog.Debug(tag, $"HydrationContextExceptionHandler END");
}
}
}
\ No newline at end of file
[TestFixture]
[Description("internal/Xaml/IDictionaryExtensions")]
- public class InternalXamlIDictionaryExtensionsTest
+ public class InternalIDictionaryExtensionsTest
{
private const string tag = "NUITEST";
{
tlog.Info(tag, "Destroy() is called!");
}
-
- //[Test]
- //[Category("P1")]
- //[Description("HydrationContext Values")]
- //[Property("SPEC", "Tizen.NUI.HydrationContext.Values A")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "PRW")]
- //public void IDictionaryExtensionsAddRange()
- //{
- // tlog.Debug(tag, $"HydrationContextValues START");
-
- // try
- // {
- // IDictionary<string, string> dic = new Dictionary<string, string>();
- // IEnumerable<KeyValuePair<string, string>> keyValuePairs = new IEnumerable<KeyValuePair<string, string>>();
- // IDictionaryExtensions.AddRange<string, string>(dic, keyValuePairs);
- // }
- // catch (Exception e)
- // {
- // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- // Assert.Fail("Caught Exception" + e.ToString());
- // }
-
- // tlog.Debug(tag, $"HydrationContextValues END (OK)");
- // Assert.Pass("HydrationContextValues");
- //}
}
}
\ No newline at end of file
[TestFixture]
[Description("internal/Xaml/MarkupExpressionParser")]
- public class InternalXamlMarkupExpressionParserTest
+ public class InternalMarkupExpressionParserTest
{
private const string tag = "NUITEST";
- private MarkupExpressionParserImplement m1;
+ private MarkupExpressionParserImpl expParser;
- [SetUp]
- public void Init()
- {
- tlog.Info(tag, "Init() is called!");
- m1 = new MarkupExpressionParserImplement();
- }
-
- [TearDown]
- public void Destroy()
+ internal class MarkupExpressionParserImpl : MarkupExpressionParser
{
- m1 = null;
- tlog.Info(tag, "Destroy() is called!");
- }
-
- private class MarkupExpressionParserImplement : MarkupExpressionParser
- {
- protected override void SetPropertyValue(string prop, string strValue, object value, IServiceProvider serviceProvider)
- {
- return;
- }
-
+ protected override void SetPropertyValue(string prop, string strValue, object value, IServiceProvider serviceProvider) { }
+
public void CallHandleProperty()
{
- IServiceProviderImplement serviceProviderImplement = new IServiceProviderImplement();
- string s1 = new string('a', 1);
- HandleProperty("length", serviceProviderImplement, ref s1, true);
+ IServiceProviderImpl provider = new IServiceProviderImpl();
+
+ string str = new string('a', 1);
+ HandleProperty("length", provider, ref str, true);
}
public void CallGetNextPiece()
{
- string s1 = new string('a', 4);
-
- GetNextPiece(ref s1, out char next);
+ string str = new string('a', 4);
+ GetNextPiece(ref str, out char next);
}
}
- public class IServiceProviderImplement : IServiceProvider
+ public class IServiceProviderImpl : IServiceProvider
{
- public object GetService(Type serviceType)
- {
- return null;
- }
+ public object GetService(Type serviceType) { return null; }
}
- [Test]
- [Category("P1")]
- [Description("MarkupExpressionParser ParseExpression")]
- [Property("SPEC", "Tizen.NUI.MarkupExpressionParser.ParseExpression M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- public void MarkupExpressionParserParseExpression()
+ [SetUp]
+ public void Init()
{
- tlog.Debug(tag, $"MarkupExpressionParserParseExpression START");
-
- try
- {
- string s1 = new string('a', 4);
+ tlog.Info(tag, "Init() is called!");
+ expParser = new MarkupExpressionParserImpl();
+ }
- IServiceProviderImplement serviceProviderImplement = new IServiceProviderImplement();
- m1.ParseExpression(ref s1, serviceProviderImplement);
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"MarkupExpressionParserParseExpression END (OK)");
- Assert.Pass("Caught Exception : passed!");
- }
+ [TearDown]
+ public void Destroy()
+ {
+ expParser = null;
+ tlog.Info(tag, "Destroy() is called!");
}
[Test]
try
{
- string s1 = new string('a', 1);
- MarkupExpressionParser.MatchMarkup(out s1, "a+b", out int i1);
+ string str = new string('a', 1);
+ MarkupExpressionParser.MatchMarkup(out str, "a+b", out int result);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"MarkupExpressionParserMatchMarkup END (OK)");
- Assert.Pass("MarkupExpressionParserMatchMarkup");
+ tlog.Debug(tag, $"MarkupExpressionParserMatchMarkup END");
}
[Test]
try
{
- m1.CallHandleProperty();
- }
- catch (Exception e)
- {
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
- }
-
- tlog.Debug(tag, $"MarkupExpressionParserHandleProperty END (OK)");
- Assert.Pass("MarkupExpressionParserHandleProperty");
- }
-
- [Test]
- [Category("P1")]
- [Description("MarkupExpressionParser GetNextPiece")]
- [Property("SPEC", "Tizen.NUI.MarkupExpressionParser.GetNextPiece M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- public void MarkupExpressionParserGetNextPiece()
- {
- tlog.Debug(tag, $"MarkupExpressionParserGetNextPiece START");
-
- try
- {
- m1.CallGetNextPiece();
+ expParser.CallHandleProperty();
}
catch (Exception e)
{
tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"MarkupExpressionParserGetNextPiece END (OK)");
- Assert.Pass("Caught Exception : passed!");
+ Assert.Fail("Caught Exception : Failed!");
}
+ tlog.Debug(tag, $"MarkupExpressionParserHandleProperty END");
}
}
}
\ No newline at end of file
[TestFixture]
[Description("internal/Xaml/MarkupExtensionParser")]
- public class InternalXamlMarkupExtensionParserTest
+ public class InternalMarkupExtensionParserTest
{
private const string tag = "NUITEST";
- private MarkupExtensionParser m1;
+ private MarkupExtensionParser extParser;
+
+ internal class IServiceProviderImpl : IServiceProvider
+ {
+ public object GetService(Type serviceType) { return null; }
+ }
+
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- m1 = new MarkupExtensionParser();
+ extParser = new MarkupExtensionParser();
}
[TearDown]
public void Destroy()
{
- m1 = null;
+ extParser = null;
tlog.Info(tag, "Destroy() is called!");
}
- private class IServiceProviderImplement : IServiceProvider
- {
- public object GetService(Type serviceType)
- {
- return null;
- }
- }
-
[Test]
[Category("P1")]
[Description("MarkupExtensionParser Parse")]
try
{
- string s1 = new string('a', 4);
- IServiceProviderImplement serviceProviderImplement = new IServiceProviderImplement();
- m1.Parse("myMatch", ref s1, serviceProviderImplement);
+ string str = new string('a', 4);
+ IServiceProviderImpl provider = new IServiceProviderImpl();
+ extParser.Parse("myMatch", ref str, provider);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"MarkupExtensionParserParse END (OK)");
- Assert.Pass("MarkupExtensionParserParse");
+ tlog.Debug(tag, $"MarkupExtensionParserParse END");
}
}
}
\ No newline at end of file
[TestFixture]
[Description("internal/Xaml/NamescopingVisitor")]
- public class InternalXamlNamescopingVisitorTest
+ public class InternalNamescopingVisitorTest
{
private const string tag = "NUITEST";
- private NamescopingVisitor n1;
+ private NamescopingVisitor visitor;
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- HydrationContext context = new HydrationContext();
- NamescopingVisitor n1 = new NamescopingVisitor(context);
+ visitor = new NamescopingVisitor(new HydrationContext());
}
[TearDown]
public void Destroy()
{
- n1 = null;
+ visitor = null;
tlog.Info(tag, "Destroy() is called!");
}
-
- [Test]
- [Category("P1")]
- [Description("NamescopingVisitor NamescopingVisitor")]
- [Property("SPEC", "Tizen.NUI.NamescopingVisitor.NamescopingVisitor C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- public void NamescopingVisitorConstructor()
- {
- tlog.Debug(tag, $"NamescopingVisitorConstructor START");
-
- HydrationContext context = new HydrationContext();
-
- NamescopingVisitor namescoping = new NamescopingVisitor(context);
-
- tlog.Debug(tag, $"NamescopingVisitorConstructor END (OK)");
- Assert.Pass("NamescopingVisitorConstructor");
- }
-
- [Test]
- [Category("P1")]
- [Description("NamescopingVisitor VisitingMode")]
- [Property("SPEC", "Tizen.NUI.NamescopingVisitor.VisitingMode A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- public void NamescopingVisitorVisitingMode()
- {
- tlog.Debug(tag, $"NamescopingVisitorVisitingMode START");
-
- try
- {
- TreeVisitingMode t1 = n1.VisitingMode;
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"NamescopingVisitorVisitingMode END (OK)");
- Assert.Pass("Caught Exception : passed!");
- }
-
- }
-
- [Test]
- [Category("P1")]
- [Description("NamescopingVisitor StopOnDataTemplate")]
- [Property("SPEC", "Tizen.NUI.NamescopingVisitor.StopOnDataTemplate A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- public void NamescopingVisitorStopOnDataTemplate()
- {
- tlog.Debug(tag, $"NamescopingVisitorStopOnDataTemplate START");
-
- try
- {
- bool b1 = n1.StopOnDataTemplate;
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"NamescopingVisitorStopOnDataTemplate END (OK)");
- Assert.Pass("Caught Exception : passed!");
- }
-
- }
-
- [Test]
- [Category("P1")]
- [Description("NamescopingVisitor StopOnResourceDictionary")]
- [Property("SPEC", "Tizen.NUI.NamescopingVisitor.StopOnResourceDictionary A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- public void NamescopingVisitorStopOnResourceDictionary()
- {
- tlog.Debug(tag, $"NamescopingVisitorStopOnResourceDictionary START");
-
- try
- {
- bool b1 = n1.StopOnResourceDictionary;
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"NamescopingVisitorStopOnResourceDictionary END (OK)");
- Assert.Pass("Caught Exception : passed!");
- }
-
- }
-
- [Test]
- [Category("P1")]
- [Description("NamescopingVisitor VisitNodeOnDataTemplate")]
- [Property("SPEC", "Tizen.NUI.NamescopingVisitor.VisitNodeOnDataTemplate A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- public void NamescopingVisitorVisitNodeOnDataTemplate()
- {
- tlog.Debug(tag, $"NamescopingVisitorVisitNodeOnDataTemplate START");
-
- try
- {
- bool b1 = n1.VisitNodeOnDataTemplate;
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"NamescopingVisitorVisitNodeOnDataTemplate END (OK)");
- Assert.Pass("Caught Exception : passed!");
- }
-
- }
-
- internal class INodeImplement : INode
- {
- public List<string> IgnorablePrefixes { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
-
- public IXmlNamespaceResolver NamespaceResolver => throw new NotImplementedException();
-
- public INode Parent { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
-
- public void Accept(IXamlNodeVisitor visitor, INode parentNode)
- {
- throw new NotImplementedException();
- }
-
- public INode Clone()
- {
- throw new NotImplementedException();
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("NamescopingVisitor SkipChildren")]
- [Property("SPEC", "Tizen.NUI.NamescopingVisitor.SkipChildren M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- public void NamescopingVisitorSkipChildren()
- {
- tlog.Debug(tag, $"NamescopingVisitorSkipChildren START");
-
- try
- {
- INodeImplement nodeImplement = new INodeImplement();
- INodeImplement parentNode = new INodeImplement();
-
- n1.SkipChildren(nodeImplement, parentNode);
-
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"NamescopingVisitorSkipChildren END (OK)");
- Assert.Pass("Caught Exception : passed!");
- }
-
- }
-
- public class IXmlNamespaceResolverImplement : IXmlNamespaceResolver
- {
- public IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope)
- {
- return null;
- }
-
- public string LookupNamespace(string prefix)
- {
- return "mynamespaceName";
- }
-
- public string LookupPrefix(string namespaceName)
- {
- return "myPrefix";
- }
- }
-
- //[Test]
- //[Category("P1")]
- //[Description("NamescopingVisitor IsResourceDictionary")]
- //[Property("SPEC", "Tizen.NUI.NamescopingVisitor.IsResourceDictionary M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void NamescopingVisitorIsResourceDictionary()
- //{
- // tlog.Debug(tag, $"NamescopingVisitorIsResourceDictionary START");
-
- // try
- // {
- // IList<XmlType> list = null;
- // XmlType xmlType = new XmlType("myNameSpace", "myName", list);
-
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
- // ElementNode e1 = new ElementNode(xmlType, "myNameSpace", i1);
-
- // bool b1 = n1.IsResourceDictionary(e1);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"NamescopingVisitorIsResourceDictionary END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
-
- //public class RootNodeImplement : RootNode
- //{
- // public RootNodeImplement(XmlType xmlType, IXmlNamespaceResolver nsResolver) : base(xmlType, nsResolver)
- // {
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("NamescopingVisitor Visit")]
- //[Property("SPEC", "Tizen.NUI.NamescopingVisitor.Visit M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void NamescopingVisitorVisit1()
- //{
- // tlog.Debug(tag, $"NamescopingVisitorVisit START");
-
- // try
- // {
- // object o1 = new object();
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
- // ValueNode node = new ValueNode(o1, i1);
-
- // INodeImplement parentNode = new INodeImplement();
- // n1.Visit(node, parentNode);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"NamescopingVisitorVisit END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("NamescopingVisitor Visit")]
- //[Property("SPEC", "Tizen.NUI.NamescopingVisitor.Visit M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void NamescopingVisitorVisit2()
- //{
- // tlog.Debug(tag, $"NamescopingVisitorVisit START");
-
- // try
- // {
- // INodeImplement parentNode = new INodeImplement();
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
- // MarkupNode markupnode = new MarkupNode("markup", i1);
- // n1.Visit(markupnode, parentNode);
-
-
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"NamescopingVisitorVisit END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("NamescopingVisitor Visit")]
- //[Property("SPEC", "Tizen.NUI.NamescopingVisitor.Visit M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void NamescopingVisitorVisit3()
- //{
- // tlog.Debug(tag, $"NamescopingVisitorVisit START");
-
- // try
- // {
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
- // INodeImplement parentNode = new INodeImplement();
-
- // IList<XmlType> list = null;
- // XmlType xmlType = new XmlType("myNameSpace", "myName", list);
-
- // ElementNode e1 = new ElementNode(xmlType, "myNameSpace", i1);
-
- // n1.Visit(e1, parentNode);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"NamescopingVisitorVisit END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("NamescopingVisitor Visit")]
- //[Property("SPEC", "Tizen.NUI.NamescopingVisitor.Visit M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void NamescopingVisitorVisit4()
- //{
- // tlog.Debug(tag, $"NamescopingVisitorVisit START");
-
- // try
- // {
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
-
- // INodeImplement parentNode = new INodeImplement();
-
- // IList<XmlType> list = null;
- // XmlType xmlType = new XmlType("myNameSpace", "myName", list);
- // RootNodeImplement rootNode = new RootNodeImplement(xmlType, i1);
- // n1.Visit(rootNode, parentNode);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"NamescopingVisitorVisit END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("NamescopingVisitor Visit")]
- //[Property("SPEC", "Tizen.NUI.NamescopingVisitor.Visit M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void NamescopingVisitorVisit5()
- //{
- // tlog.Debug(tag, $"NamescopingVisitorVisit START");
-
- // try
- // {
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
- // INodeImplement parentNode = new INodeImplement();
-
- // IList<INode> nodes = null;
- // ListNode li = new ListNode(nodes, i1);
- // n1.Visit(li, parentNode);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"NamescopingVisitorVisit END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
}
}
\ No newline at end of file
[TestFixture]
[Description("internal/Xaml/PruneIgnoredNodesVisitor")]
- public class InternalXamlPruneIgnoredNodesVisitorTest
+ public class InternalPruneIgnoredNodesVisitorTest
{
private const string tag = "NUITEST";
- private PruneIgnoredNodesVisitor p1;
+ private PruneIgnoredNodesVisitor visitor;
+
+ internal class INodeImpl : INode
+ {
+ public global::System.Collections.Generic.List<string> IgnorablePrefixes { get; set; }
+ public global::System.Xml.IXmlNamespaceResolver NamespaceResolver => new INodeImpl().NamespaceResolver;
+ public INode Parent { get; set; }
+ public void Accept(IXamlNodeVisitor visitor, INode parentNode) { }
+ public INode Clone() { return new INodeImpl(); }
+ }
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- p1 = new PruneIgnoredNodesVisitor();
+ visitor = new PruneIgnoredNodesVisitor();
}
[TearDown]
public void Destroy()
{
- p1 = null;
+ visitor = null;
tlog.Info(tag, "Destroy() is called!");
}
try
{
- TreeVisitingMode t1 = p1.VisitingMode;
+ var result = visitor.VisitingMode;
+ tlog.Debug(tag, "VisitingMode : " + result);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"PruneIgnoredNodesVisitorVisitingMode END (OK)");
- Assert.Pass("PruneIgnoredNodesVisitorVisitingMode");
+ tlog.Debug(tag, $"PruneIgnoredNodesVisitorVisitingMode END");
}
[Test]
[Category("P1")]
- [Description("PruneIgnoredNodesVisitor StopOnDataTemplate")]
- [Property("SPEC", "Tizen.NUI.PruneIgnoredNodesVisitor.StopOnDataTemplate A")]
+ [Description("NamescopingVisitor StopOnDataTemplate")]
+ [Property("SPEC", "Tizen.NUI.NamescopingVisitor.StopOnDataTemplate A")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PRW")]
- public void PruneIgnoredNodesVisitorStopOnDataTemplate()
+ public void NamescopingVisitorStopOnDataTemplate()
{
- tlog.Debug(tag, $"PruneIgnoredNodesVisitorStopOnDataTemplate START");
+ tlog.Debug(tag, $"NamescopingVisitorStopOnDataTemplate START");
try
{
- bool b1 = p1.StopOnDataTemplate;
+ var result = visitor.StopOnDataTemplate;
+ tlog.Debug(tag, "StopOnDataTemplate : " + result);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"PruneIgnoredNodesVisitorStopOnDataTemplate END (OK)");
- Assert.Pass("PruneIgnoredNodesVisitorStopOnDataTemplate");
+ tlog.Debug(tag, $"NamescopingVisitorStopOnDataTemplate END");
}
[Test]
[Category("P1")]
- [Description("PruneIgnoredNodesVisitor StopOnResourceDictionary")]
- [Property("SPEC", "Tizen.NUI.PruneIgnoredNodesVisitor.StopOnResourceDictionary A")]
+ [Description("NamescopingVisitor StopOnResourceDictionary")]
+ [Property("SPEC", "Tizen.NUI.NamescopingVisitor.StopOnResourceDictionary A")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PRW")]
- public void PruneIgnoredNodesVisitorStopOnResourceDictionary()
+ public void NamescopingVisitorStopOnResourceDictionary()
{
- tlog.Debug(tag, $"PruneIgnoredNodesVisitorStopOnResourceDictionary START");
+ tlog.Debug(tag, $"NamescopingVisitorStopOnResourceDictionary START");
try
{
- bool b1 = p1.StopOnResourceDictionary;
+ var result = visitor.StopOnResourceDictionary;
+ tlog.Debug(tag, "StopOnResourceDictionary : " + result);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"PruneIgnoredNodesVisitorStopOnResourceDictionary END (OK)");
- Assert.Pass("PruneIgnoredNodesVisitorStopOnResourceDictionary");
+ tlog.Debug(tag, $"NamescopingVisitorStopOnResourceDictionary END");
}
[Test]
[Category("P1")]
- [Description("PruneIgnoredNodesVisitor VisitNodeOnDataTemplate")]
- [Property("SPEC", "Tizen.NUI.PruneIgnoredNodesVisitor.VisitNodeOnDataTemplate A")]
+ [Description("NamescopingVisitor VisitNodeOnDataTemplate")]
+ [Property("SPEC", "Tizen.NUI.NamescopingVisitor.VisitNodeOnDataTemplate A")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PRW")]
- public void PruneIgnoredNodesVisitorVisitNodeOnDataTemplate()
+ public void NamescopingVisitorVisitNodeOnDataTemplate()
{
- tlog.Debug(tag, $"PruneIgnoredNodesVisitorVisitNodeOnDataTemplate START");
+ tlog.Debug(tag, $"NamescopingVisitorVisitNodeOnDataTemplate START");
try
{
- bool b1 = p1.VisitNodeOnDataTemplate;
+ var result = visitor.VisitNodeOnDataTemplate;
+ tlog.Debug(tag, "VisitNodeOnDataTemplate : " + result);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
- }
-
- tlog.Debug(tag, $"PruneIgnoredNodesVisitorVisitNodeOnDataTemplate END (OK)");
- Assert.Pass("PruneIgnoredNodesVisitorVisitNodeOnDataTemplate");
- }
-
- internal class INodeImplement : INode
- {
- public global::System.Collections.Generic.List<string> IgnorablePrefixes { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
-
- public global::System.Xml.IXmlNamespaceResolver NamespaceResolver => throw new NotImplementedException();
-
- public INode Parent { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
-
- public void Accept(IXamlNodeVisitor visitor, INode parentNode)
- {
- throw new NotImplementedException();
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- public INode Clone()
- {
- throw new NotImplementedException();
- }
+ tlog.Debug(tag, $"NamescopingVisitorVisitNodeOnDataTemplate END");
}
[Test]
[Category("P1")]
- [Description("PruneIgnoredNodesVisitor SkipChildren")]
+ [Description("NamescopingVisitor SkipChildren")]
[Property("SPEC", "Tizen.NUI.NamescopingVisitor.SkipChildren M")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "MR")]
- public void PruneIgnoredNodesVisitorSkipChildren()
+ public void NamescopingVisitorSkipChildren()
{
- tlog.Debug(tag, $"PruneIgnoredNodesVisitorSkipChildren START");
+ tlog.Debug(tag, $"NamescopingVisitorSkipChildren START");
try
{
- INodeImplement node = new INodeImplement();
- INodeImplement nodeParent = new INodeImplement();
- bool b1 = p1.SkipChildren(node, nodeParent);
- }
- catch (Exception e)
- {
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
- }
+ var child = new INodeImpl();
+ Assert.IsNotNull(child, "null INodeImpl object.");
- tlog.Debug(tag, $"PruneIgnoredNodesVisitorSkipChildren END (OK)");
- Assert.Pass("PruneIgnoredNodesVisitorSkipChildren");
- }
+ var parent = new INodeImpl();
+ Assert.IsNotNull(parent, "null INodeImpl object.");
- public class IXmlNamespaceResolverImplement : IXmlNamespaceResolver
- {
- public IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope)
- {
- throw new NotImplementedException();
+ var result = visitor.SkipChildren(child, parent);
+ tlog.Debug(tag, "SkipChildren : " + result);
}
-
- public string LookupNamespace(string prefix)
+ catch (Exception e)
{
- throw new NotImplementedException();
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- public string LookupPrefix(string namespaceName)
- {
- throw new NotImplementedException();
- }
+ tlog.Debug(tag, $"NamescopingVisitorSkipChildren END");
}
-
- //[Test]
- //[Category("P1")]
- //[Description("NamescopingVisitor IsResourceDictionary")]
- //[Property("SPEC", "Tizen.NUI.NamescopingVisitor.IsResourceDictionary M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void NamescopingVisitorIsResourceDictionary()
- //{
- // tlog.Debug(tag, $"NamescopingVisitorIsResourceDictionary START");
-
- // try
- // {
- // IList<XmlType> list = null;
- // XmlType xmlType = new XmlType("myNameSpace", "myName", list);
-
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
- // ElementNode n1 = new ElementNode(xmlType, "myNameSpace", i1);
-
- // bool b1 = p1.IsResourceDictionary(n1);
- // }
- // catch (Exception e)
- // {
- // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- // Assert.Fail("Caught Exception" + e.ToString());
- // }
-
- // tlog.Debug(tag, $"NamescopingVisitorIsResourceDictionary END (OK)");
- // Assert.Pass("NamescopingVisitorIsResourceDictionary");
- //}
-
- //public class RootNodeImplement : RootNode
- //{
- // public RootNodeImplement(XmlType xmlType, IXmlNamespaceResolver nsResolver) : base(xmlType, nsResolver)
- // {
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("NamescopingVisitor Visit")]
- //[Property("SPEC", "Tizen.NUI.NamescopingVisitor.Visit M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void NamescopingVisitorVisit1()
- //{
- // tlog.Debug(tag, $"NamescopingVisitorVisit START");
-
- // try
- // {
- // IList<XmlType> list = null;
- // XmlType xmlType = new XmlType("myNameSpace", "myName", list);
-
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
- // ElementNode n1 = new ElementNode(xmlType, "myNameSpace", i1);
-
- // INodeImplement parentNode = new INodeImplement();
- // p1.Visit(n1, parentNode);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"NamescopingVisitorVisit END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("NamescopingVisitor Visit")]
- //[Property("SPEC", "Tizen.NUI.NamescopingVisitor.Visit M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void NamescopingVisitorVisit2()
- //{
- // tlog.Debug(tag, $"NamescopingVisitorVisit START");
-
- // try
- // {
- // IList<XmlType> list = null;
- // XmlType xmlType = new XmlType("myNameSpace", "myName", list);
-
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
-
- // INodeImplement parentNode = new INodeImplement();
-
- // RootNodeImplement rootNode = new RootNodeImplement(xmlType, i1);
- // p1.Visit(rootNode, parentNode);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"NamescopingVisitorVisit END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("NamescopingVisitor Visit")]
- //[Property("SPEC", "Tizen.NUI.NamescopingVisitor.Visit M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void NamescopingVisitorVisit3()
- //{
- // tlog.Debug(tag, $"NamescopingVisitorVisit START");
-
- // try
- // {
- // IXmlNamespaceResolverImplement i1 = new IXmlNamespaceResolverImplement();
-
- // INodeImplement parentNode = new INodeImplement();
- // IList<INode> nodes = null;
- // ListNode li = new ListNode(nodes, i1);
- // p1.Visit(li, parentNode);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"NamescopingVisitorVisit END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
}
}
\ No newline at end of file
[TestFixture]
[Description("internal/Xaml/ReflectionExtensions")]
- public class InternalXamlReflectionExtensionsTest
+ public class InternalReflectionExtensionsTest
{
private const string tag = "NUITEST";
tlog.Info(tag, "Destroy() is called!");
}
- private class TypeImplement : Type
+ internal class TypeImpl : Type
{
- public override global::System.Reflection.Assembly Assembly => throw new NotImplementedException();
-
- public override string AssemblyQualifiedName => throw new NotImplementedException();
-
- public override Type BaseType => throw new NotImplementedException();
-
- public override string FullName => throw new NotImplementedException();
-
- public override Guid GUID => throw new NotImplementedException();
-
- public override global::System.Reflection.Module Module => throw new NotImplementedException();
-
- public override string Namespace => throw new NotImplementedException();
-
- public override Type UnderlyingSystemType => throw new NotImplementedException();
-
- public override string Name => throw new NotImplementedException();
-
- public override global::System.Reflection.ConstructorInfo[] GetConstructors(global::System.Reflection.BindingFlags bindingAttr)
- {
- throw new NotImplementedException();
- }
-
- public override object[] GetCustomAttributes(bool inherit)
- {
- throw new NotImplementedException();
- }
-
- public override object[] GetCustomAttributes(Type attributeType, bool inherit)
- {
- throw new NotImplementedException();
- }
-
- public override Type GetElementType()
- {
- throw new NotImplementedException();
- }
-
- public override global::System.Reflection.EventInfo GetEvent(string name, global::System.Reflection.BindingFlags bindingAttr)
- {
- throw new NotImplementedException();
- }
-
- public override global::System.Reflection.EventInfo[] GetEvents(global::System.Reflection.BindingFlags bindingAttr)
- {
- throw new NotImplementedException();
- }
-
- public override global::System.Reflection.FieldInfo GetField(string name, global::System.Reflection.BindingFlags bindingAttr)
- {
- throw new NotImplementedException();
- }
-
- public override global::System.Reflection.FieldInfo[] GetFields(global::System.Reflection.BindingFlags bindingAttr)
- {
- throw new NotImplementedException();
- }
-
- public override Type GetInterface(string name, bool ignoreCase)
- {
- throw new NotImplementedException();
- }
-
- public override Type[] GetInterfaces()
- {
- throw new NotImplementedException();
- }
-
- public override global::System.Reflection.MemberInfo[] GetMembers(global::System.Reflection.BindingFlags bindingAttr)
- {
- throw new NotImplementedException();
- }
-
- public override global::System.Reflection.MethodInfo[] GetMethods(global::System.Reflection.BindingFlags bindingAttr)
- {
- throw new NotImplementedException();
- }
-
- public override Type GetNestedType(string name, global::System.Reflection.BindingFlags bindingAttr)
- {
- throw new NotImplementedException();
- }
-
- public override Type[] GetNestedTypes(global::System.Reflection.BindingFlags bindingAttr)
- {
- throw new NotImplementedException();
- }
-
- public override global::System.Reflection.PropertyInfo[] GetProperties(global::System.Reflection.BindingFlags bindingAttr)
- {
- throw new NotImplementedException();
- }
-
- public override object InvokeMember(string name, global::System.Reflection.BindingFlags invokeAttr, global::System.Reflection.Binder binder, object target, object[] args, global::System.Reflection.ParameterModifier[] modifiers, global::System.Globalization.CultureInfo culture, string[] namedParameters)
- {
- throw new NotImplementedException();
- }
-
- public override bool IsDefined(Type attributeType, bool inherit)
- {
- throw new NotImplementedException();
- }
-
- protected override global::System.Reflection.TypeAttributes GetAttributeFlagsImpl()
- {
- throw new NotImplementedException();
- }
-
- protected override global::System.Reflection.ConstructorInfo GetConstructorImpl(global::System.Reflection.BindingFlags bindingAttr, global::System.Reflection.Binder binder, global::System.Reflection.CallingConventions callConvention, Type[] types, global::System.Reflection.ParameterModifier[] modifiers)
- {
- throw new NotImplementedException();
- }
-
- protected override global::System.Reflection.MethodInfo GetMethodImpl(string name, global::System.Reflection.BindingFlags bindingAttr, global::System.Reflection.Binder binder, global::System.Reflection.CallingConventions callConvention, Type[] types, global::System.Reflection.ParameterModifier[] modifiers)
- {
- throw new NotImplementedException();
- }
-
- protected override global::System.Reflection.PropertyInfo GetPropertyImpl(string name, global::System.Reflection.BindingFlags bindingAttr, global::System.Reflection.Binder binder, Type returnType, Type[] types, global::System.Reflection.ParameterModifier[] modifiers)
- {
- throw new NotImplementedException();
- }
-
- protected override bool HasElementTypeImpl()
- {
- throw new NotImplementedException();
- }
-
- protected override bool IsArrayImpl()
- {
- throw new NotImplementedException();
- }
-
- protected override bool IsByRefImpl()
- {
- throw new NotImplementedException();
- }
-
- protected override bool IsCOMObjectImpl()
- {
- throw new NotImplementedException();
- }
-
- protected override bool IsPointerImpl()
- {
- throw new NotImplementedException();
- }
-
- protected override bool IsPrimitiveImpl()
- {
- throw new NotImplementedException();
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("ReflectionExtensions GetField")]
- [Property("SPEC", "Tizen.NUI.ReflectionExtensions.GetField M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- public void ReflectionExtensionsGetField()
- {
- tlog.Debug(tag, $"ReflectionExtensionsGetField START");
-
- try
- {
- TypeImplement type = new TypeImplement();
-
- ReflectionExtensions.GetField(type, "myName");
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"ReflectionExtensionsGetField END (OK)");
- Assert.Pass("Caught Exception : passed!");
- }
+ public override global::System.Reflection.Assembly Assembly => global::System.Reflection.Assembly.LoadFile(AppDomain.CurrentDomain.BaseDirectory + "WeGanttGmTask.dll");
+ public override string AssemblyQualifiedName => null;
+ public override Type BaseType => null;
+ public override string FullName => null;
+ public override Guid GUID => new Guid("ebc600a9-4fa4-4bc4-88a9-0dd8d57f0076");
+ public override global::System.Reflection.Module Module => this.GetType().Module;
+ public override string Namespace => "http://www.w3school.com.cn/children/";
+ public override Type UnderlyingSystemType => null;
+ public override string Name => null;
+ public override global::System.Reflection.ConstructorInfo[] GetConstructors(global::System.Reflection.BindingFlags bindingAttr) { return null; }
+ public override object[] GetCustomAttributes(bool inherit) { return null; }
+ public override object[] GetCustomAttributes(Type attributeType, bool inherit) { return null; }
+ public override Type GetElementType() { return null; }
+ public override global::System.Reflection.EventInfo GetEvent(string name, global::System.Reflection.BindingFlags bindingAttr) { return null; }
+ public override global::System.Reflection.EventInfo[] GetEvents(global::System.Reflection.BindingFlags bindingAttr) { return null; }
+ public override global::System.Reflection.FieldInfo GetField(string name, global::System.Reflection.BindingFlags bindingAttr) { return null; }
+ public override global::System.Reflection.FieldInfo[] GetFields(global::System.Reflection.BindingFlags bindingAttr) { return null; }
+ public override Type GetInterface(string name, bool ignoreCase) { return null; }
+ public override Type[] GetInterfaces() { return null; }
+ public override global::System.Reflection.MemberInfo[] GetMembers(global::System.Reflection.BindingFlags bindingAttr) { return null; }
+ public override global::System.Reflection.MethodInfo[] GetMethods(global::System.Reflection.BindingFlags bindingAttr) { return null; }
+ public override Type GetNestedType(string name, global::System.Reflection.BindingFlags bindingAttr) { return null; }
+ public override Type[] GetNestedTypes(global::System.Reflection.BindingFlags bindingAttr) { return null; }
+ public override global::System.Reflection.PropertyInfo[] GetProperties(global::System.Reflection.BindingFlags bindingAttr) { return null; }
+ public override object InvokeMember(string name, global::System.Reflection.BindingFlags invokeAttr, global::System.Reflection.Binder binder, object target, object[] args, global::System.Reflection.ParameterModifier[] modifiers, global::System.Globalization.CultureInfo culture, string[] namedParameters) { return null; }
+ public override bool IsDefined(Type attributeType, bool inherit) { return true; }
+ protected override global::System.Reflection.TypeAttributes GetAttributeFlagsImpl() { return global::System.Reflection.TypeAttributes.Public; }
+ protected override global::System.Reflection.ConstructorInfo GetConstructorImpl(global::System.Reflection.BindingFlags bindingAttr, global::System.Reflection.Binder binder, global::System.Reflection.CallingConventions callConvention, Type[] types, global::System.Reflection.ParameterModifier[] modifiers) { return null; }
+ protected override global::System.Reflection.MethodInfo GetMethodImpl(string name, global::System.Reflection.BindingFlags bindingAttr, global::System.Reflection.Binder binder, global::System.Reflection.CallingConventions callConvention, Type[] types, global::System.Reflection.ParameterModifier[] modifiers) { return null; }
+ protected override global::System.Reflection.PropertyInfo GetPropertyImpl(string name, global::System.Reflection.BindingFlags bindingAttr, global::System.Reflection.Binder binder, Type returnType, Type[] types, global::System.Reflection.ParameterModifier[] modifiers) { return null; }
+ protected override bool HasElementTypeImpl() { return true; }
+ protected override bool IsArrayImpl() { return true; }
+ protected override bool IsByRefImpl() { return true; }
+ protected override bool IsCOMObjectImpl() { return true; }
+ protected override bool IsPointerImpl() { return true; }
+ protected override bool IsPrimitiveImpl() { return true; }
}
[Test]
try
{
- TypeImplement type = new TypeImplement();
-
- ReflectionExtensions.GetFields(type);
+ ReflectionExtensions.GetFields(new TypeImpl());
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"ReflectionExtensionsGetFields END (OK)");
- Assert.Pass("ReflectionExtensionsGetFields");
+ tlog.Debug(tag, $"ReflectionExtensionsGetFields END");
}
[Test]
try
{
- TypeImplement type = new TypeImplement();
-
- ReflectionExtensions.GetProperties(type);
- }
- catch (Exception e)
- {
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
- }
-
- tlog.Debug(tag, $"ReflectionExtensionsGetProperties END (OK)");
- Assert.Pass("ReflectionExtensionsGetProperties");
- }
-
- [Test]
- [Category("P1")]
- [Description("ReflectionExtensions GetProperty")]
- [Property("SPEC", "Tizen.NUI.ReflectionExtensions.GetProperty M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- public void ReflectionExtensionsGetProperty()
- {
- tlog.Debug(tag, $"ReflectionExtensionsGetProperty START");
-
- try
- {
- TypeImplement type = new TypeImplement();
-
- ReflectionExtensions.GetProperty(type, "myName");
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"ReflectionExtensionsGetProperty END (OK)");
- Assert.Pass("Caught Exception : passed!");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("ReflectionExtensions IsAssignableFrom")]
- [Property("SPEC", "Tizen.NUI.ReflectionExtensions.IsAssignableFrom M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- public void ReflectionExtensionsIsAssignableFrom()
- {
- tlog.Debug(tag, $"ReflectionExtensionsIsAssignableFrom START");
-
- try
- {
- TypeImplement type = new TypeImplement();
- TypeImplement c = new TypeImplement();
-
- ReflectionExtensions.IsAssignableFrom(type, c);
+ ReflectionExtensions.GetProperties(new TypeImpl());
}
catch (Exception e)
{
tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"ReflectionExtensionsIsAssignableFrom END (OK)");
- Assert.Pass("Caught Exception : passed!");
+ Assert.Fail("Caught Exception : Failed!");
}
- }
- [Test]
- [Category("P1")]
- [Description("ReflectionExtensions IsInstanceOfType")]
- [Property("SPEC", "Tizen.NUI.ReflectionExtensions.IsInstanceOfType M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- public void ReflectionExtensionsIsInstanceOfType()
- {
- tlog.Debug(tag, $"ReflectionExtensionsIsInstanceOfType START");
-
- try
- {
- TypeImplement type = new TypeImplement();
- object o1 = new object();
-
- ReflectionExtensions.IsInstanceOfType(type, o1);
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"ReflectionExtensionsIsInstanceOfType END (OK)");
- Assert.Pass("Caught Exception : passed!");
- }
+ tlog.Debug(tag, $"ReflectionExtensionsGetProperties END");
}
}
}
\ No newline at end of file
[Test]
[Category("P1")]
+ [Description("FrameUpdateCallbackInterface getCPtr.")]
+ [Property("SPEC", "Tizen.NUI.FrameUpdateCallbackInterface.getCPtr C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void FrameUpdateCallbackInterfaceGetCPtr()
+ {
+ tlog.Debug(tag, $"FrameUpdateCallbackInterfaceGetCPtr START");
+
+ var testingTarget = new FrameUpdateCallbackInterface();
+ Assert.IsNotNull(testingTarget, "Can't create success object FrameUpdateCallbackInterface");
+ Assert.IsInstanceOf<FrameUpdateCallbackInterface>(testingTarget, "Should return FrameUpdateCallbackInterface instance.");
+
+ tlog.Debug(tag, "getCPtr : " + FrameUpdateCallbackInterface.getCPtr(testingTarget));
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"FrameUpdateCallbackInterfaceGetCPtr END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FrameUpdateCallbackInterface OnUpdate.")]
+ [Property("SPEC", "Tizen.NUI.FrameUpdateCallbackInterface.OnUpdate M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void FrameUpdateCallbackInterfaceOnUpdate()
+ {
+ tlog.Debug(tag, $"FrameUpdateCallbackInterfaceOnUpdate START");
+
+ var testingTarget = new MyFrameUpdateCallbackInterface();
+ Assert.IsNotNull(testingTarget, "Can't create success object FrameUpdateCallbackInterface");
+ Assert.IsInstanceOf<FrameUpdateCallbackInterface>(testingTarget, "Should return FrameUpdateCallbackInterface instance.");
+
+ try
+ {
+ testingTarget.OnUpdate(300);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"FrameUpdateCallbackInterfaceOnUpdate END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
[Description("FrameUpdateCallbackInterface AddFrameUpdateCallback.")]
[Property("SPEC", "Tizen.NUI.FrameUpdateCallbackInterface.AddFrameUpdateCallback M")]
[Property("SPEC_URL", "-")]
try
{
NUIApplication.GetDefaultWindow().AddFrameUpdateCallback(testingTarget);
+ NUIApplication.GetDefaultWindow().RemoveFrameUpdateCallback(testingTarget);
}
catch (Exception e)
{
Assert.Fail("Caught Exception" + e.ToString());
}
- NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(testingTarget.view);
-
testingTarget.Dispose();
tlog.Debug(tag, $"FrameUpdateCallbackInterfaceAddFrameUpdateCallback END (OK)");
}
var testingTarget = new Layer();
Assert.IsNotNull(testingTarget, "null handle");
Assert.IsInstanceOf<Layer>(testingTarget, "Should return Layer instance.");
+
+ tlog.Debug(tag, "ID : " + testingTarget.ID);
+ tlog.Debug(tag, "GetId : " + testingTarget.GetId());
+
+ testingTarget.SetHoverConsumed(true);
+ tlog.Debug(tag, "IsHoverConsumed : " + testingTarget.IsHoverConsumed());
+
+ testingTarget.SetTouchConsumed(true);
+ tlog.Debug(tag, "IsTouchConsumed : " + testingTarget.IsTouchConsumed());
testingTarget.Dispose();
tlog.Debug(tag, $"LayerConstructor END (OK)");
[Test]
[Category("P1")]
+ [Description("Layer DownCast.")]
+ [Property("SPEC", "Tizen.NUI.Layer.DownCast M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void LayerDownCast()
+ {
+ tlog.Debug(tag, $"LayerDownCast START");
+
+ var testingTarget = new Layer();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<Layer>(testingTarget, "Should return Layer instance.");
+
+ try
+ {
+ Layer.DownCast(testingTarget);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"LayerDownCast END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Layer SetSize.")]
+ [Property("SPEC", "Tizen.NUI.Layer.SetSize M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void LayerSetSize()
+ {
+ tlog.Debug(tag, $"LayerSetSize START");
+
+ var testingTarget = new Layer();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<Layer>(testingTarget, "Should return Layer instance.");
+
+ try
+ {
+ testingTarget.SetSize(30.0f, 85.0f);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"LayerSetSetSize END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Layer SetParentOrigin.")]
+ [Property("SPEC", "Tizen.NUI.Layer.SetParentOrigin M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void LayerSetParentOrigin()
+ {
+ tlog.Debug(tag, $"LayerSetParentOrigin START");
+
+ var testingTarget = new Layer();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<Layer>(testingTarget, "Should return Layer instance.");
+
+ try
+ {
+ using (Vector3 parentOrigin = new Vector3(100.0f, 30.0f, 0.0f))
+ {
+ testingTarget.SetParentOrigin(parentOrigin);
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"LayerSetParentOrigin END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
[Description("Layer add.")]
[Property("SPEC", "Tizen.NUI.Layer.Add M")]
[Property("SPEC_URL", "-")]
Assert.IsNotNull(testingTarget, "null handle");
Assert.IsInstanceOf<Layer>(testingTarget, "Should return Layer instance.");
- using (View view = new View())
+ using (View view = new View() { Name = "childView" })
{
testingTarget.Add(view);
Assert.AreEqual(1, testingTarget.ChildCount, "Should be equal!");
+
+ var result = testingTarget.FindChildByName(view.Name);
+ tlog.Debug(tag, "FindChildByName : " + result);
}
testingTarget.Dispose();
testingTarget.Dispose();
tlog.Debug(tag, $"LayerName END (OK)");
}
+
[Test]
[Category("P1")]
[Description("Layer Viewport.")]
[Test]
[Category("P1")]
+ [Description("Layer Viewport.")]
+ [Property("SPEC", "Tizen.NUI.Layer.Viewport A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void LayerViewportWithFalseClippingEnabled()
+ {
+ tlog.Debug(tag, $"LayerViewportWithFalseClippingEnabled START");
+
+ var testingTarget = new Layer();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<Layer>(testingTarget, "Should return Layer instance.");
+
+ testingTarget.ClippingEnabled = false;
+
+ using (Rectangle rec = new Rectangle(0, 0, 1, 1))
+ {
+ testingTarget.Viewport = rec;
+ tlog.Debug(tag, "Viewport.X : " + testingTarget.Viewport.X);
+ tlog.Debug(tag, "Viewport.Y : " + testingTarget.Viewport.Y);
+ tlog.Debug(tag, "Viewport.Width : " + testingTarget.Viewport.Width);
+ tlog.Debug(tag, "Viewport.Height : " + testingTarget.Viewport.Height);
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"LayerViewportWithFalseClippingEnabled END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
[Description("Layer GetChildCount.")]
[Property("SPEC", "Tizen.NUI.Layer.GetChildCount C")]
[Property("SPEC_URL", "-")]
Assert.IsNotNull(testingTarget, "Should be not null!");
Assert.IsInstanceOf<Property>(testingTarget, "Should return PropertyValue instance.");
+ tlog.Debug(tag, "InvalidKey : " + Property.InvalidKey);
+ tlog.Debug(tag, "InvalidComponentIndex : " + Property.InvalidComponentIndex);
+
+ using (Animatable ani = new Animatable())
+ {
+ testingTarget.Object = ani;
+ tlog.Debug(tag, "Object : " + testingTarget.Object);
+ }
+
testingTarget.Dispose();
animatable.Dispose();
tlog.Debug(tag, $"PropertyConstructor END (OK)");
testingTarget.Dispose();
tlog.Debug(tag, $"Vector3GetHashCode END (OK)");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Vector3 Clone.")]
+ [Property("SPEC", "Tizen.NUI.Vector3.Clone M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void Vector3Clone()
+ {
+ tlog.Debug(tag, $"Vector3Clone START");
+
+ var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
+ Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
+ Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
+
+ var result = testingTarget.Clone();
+ Assert.IsInstanceOf<Vector3>(result, "Should be an instance of Vector3 type.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"Vector3Clone END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Vector3 GetVector3FromPtr.")]
+ [Property("SPEC", "Tizen.NUI.Vector3.GetVector3FromPtr M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void Vector3GetVector3FromPtr()
+ {
+ tlog.Debug(tag, $"Vector3GetVector3FromPtr START");
+
+ var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
+ Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
+ Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
+
+ var result = Vector3.GetVector3FromPtr(testingTarget.SwigCPtr.Handle);
+ Assert.IsInstanceOf<Vector3>(result, "Should be an instance of Vector3 type.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"Vector3Clone END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Vector3 AsFloat.")]
+ [Property("SPEC", "Tizen.NUI.Vector3.AsFloat M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void Vector3AsFloat()
+ {
+ tlog.Debug(tag, $"Vector3AsFloat START");
+
+ var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
+ Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
+ Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
+
+ var result = testingTarget.AsFloat();
+ Assert.IsInstanceOf<SWIGTYPE_p_float>(result, "Should be an instance of SWIGTYPE_p_float type.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"Vector3AsFloat END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Vector3 Dot.")]
+ [Property("SPEC", "Tizen.NUI.Vector3.Dot M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void Vector3Dot()
+ {
+ tlog.Debug(tag, $"Vector3Dot START");
+
+ var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
+ Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
+ Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
+
+ var result = testingTarget.Dot(testingTarget);
+ tlog.Debug(tag, "Dot : " + result);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"Vector3Dot END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Vector3 Cross.")]
+ [Property("SPEC", "Tizen.NUI.Vector3.Cross M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void Vector3Cross()
+ {
+ tlog.Debug(tag, $"Vector3Cross START");
+
+ var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
+ Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
+ Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
+
+ var result = testingTarget.Cross(testingTarget);
+ Assert.IsInstanceOf<Vector3>(result, "Should be an instance of Vector3 type.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"Vector3Cross END (OK)");
+ }
}
}
testingTarget.Dispose();
tlog.Debug(tag, $"Vector4GetHashCode END (OK)");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Vector4 AsFloat.")]
+ [Property("SPEC", "Tizen.NUI.Vector4.AsFloat M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void Vector4AsFloat()
+ {
+ tlog.Debug(tag, $"Vector4AsFloat START");
+
+ var testingTarget = new Vector4(10.0f, 20.0f, 30.0f, 40.0f);
+ Assert.IsNotNull(testingTarget, "Can't create success object Vector4");
+ Assert.IsInstanceOf<Vector4>(testingTarget, "Should be an instance of Vector4 type.");
+
+ var result = testingTarget.AsFloat();
+ Assert.IsInstanceOf<SWIGTYPE_p_float>(result, "Should be an instance of SWIGTYPE_p_float type.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"Vector4GetHashCode END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Vector4 Cross.")]
+ [Property("SPEC", "Tizen.NUI.Vector4.Cross M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void Vector4Cross()
+ {
+ tlog.Debug(tag, $"Vector4Cross START");
+
+ var testingTarget = new Vector4(10.0f, 20.0f, 30.0f, 40.0f);
+ Assert.IsNotNull(testingTarget, "Can't create success object Vector4");
+ Assert.IsInstanceOf<Vector4>(testingTarget, "Should be an instance of Vector4 type.");
+
+ var result = testingTarget.Cross(testingTarget);
+ Assert.IsInstanceOf<Vector4>(testingTarget, "Should be an instance of Vector4 type.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"Vector4Cross END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Vector4 Dot.")]
+ [Property("SPEC", "Tizen.NUI.Vector4.Dot M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void Vector4Dot()
+ {
+ tlog.Debug(tag, $"Vector4Dot START");
+
+ var testingTarget = new Vector4(10.0f, 20.0f, 30.0f, 40.0f);
+ Assert.IsNotNull(testingTarget, "Can't create success object Vector4");
+ Assert.IsInstanceOf<Vector4>(testingTarget, "Should be an instance of Vector4 type.");
+
+ var result = testingTarget.Dot(testingTarget);
+ tlog.Debug(tag, "Dot : " + result);
+
+ result = testingTarget.Dot4(testingTarget);
+ tlog.Debug(tag, "Dot4 : " + result);
+
+ using (Vector3 vector = new Vector3(10.0f, 20.0f, 30.0f))
+ {
+ result = testingTarget.Dot(vector);
+ tlog.Debug(tag, "Dot Vector3 : " + result);
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"Vector4Dot END (OK)");
+ }
}
}
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Events;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/CustomView/CustomViewRegistry")]
+ public class PublicCustomViewRegistryTest
+ {
+ private const string tag = "NUITEST";
+ public static Func<CustomView> CreateInstance { get; private set; }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScriptableProperty Type")]
+ [Property("SPEC", "Tizen.NUI.ScriptableProperty.Type A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScriptablePropertyType()
+ {
+ tlog.Debug(tag, $"ScriptablePropertyType START");
+
+ var testingTarget = new ScriptableProperty();
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ScriptableProperty>(testingTarget, "should be an instance of testing target class!");
+
+ var result = testingTarget.Type;
+ tlog.Debug(tag, "Type : " + result);
+
+ tlog.Debug(tag, $"ScriptablePropertyType END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("CustomViewRegistry Register")]
+ [Property("SPEC", "Tizen.NUI.CustomViewRegistry.Register M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CustomViewRegistryRegisterNullViewType()
+ {
+ tlog.Debug(tag, $"CustomViewRegistryRegisterNullViewType START");
+
+ try
+ {
+ CustomViewRegistry.Instance.Register(CreateInstance, null);
+ }
+ catch (ArgumentNullException e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"CustomViewRegistryRegisterNullViewType END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
+ }
+ }
+}
private void OnDetected(object obj, LongPressGestureDetector.DetectedEventArgs e)
{ }
- }
+
+ [Test]
+ [Category("P1")]
+ [Description("LongPressGestureDetector Assign")]
+ [Property("SPEC", "Tizen.NUI.LongPressGestureDetector.Assign M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void LongPressGestureDetectorAssign()
+ {
+ tlog.Debug(tag, $"LongPressGestureDetectorAssign START");
+
+ using (LongPressGestureDetector detector = new LongPressGestureDetector())
+ {
+ var testingTarget = detector.Assign(detector);
+ Assert.IsInstanceOf<LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type.");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"LongPressGestureDetectorAssign END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DetectedEventArgs View.")]
+ [Property("SPEC", "Tizen.NUI.DetectedEventArgs.View A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void LongPressGestureDetectedEventArgsView()
+ {
+ tlog.Debug(tag, $"LongPressGestureDetectedEventArgsView START");
+
+ var testingTarget = new Tizen.NUI.LongPressGestureDetector.DetectedEventArgs();
+ Assert.IsNotNull(testingTarget, "Can't create success object DetectedEventArgs.");
+ Assert.IsInstanceOf<Tizen.NUI.LongPressGestureDetector.DetectedEventArgs>(testingTarget, "Should return DetectedEventArgs instance.");
+
+ using (View view = new View() { Size = new Size(100, 50) })
+ {
+ testingTarget.View = view;
+ Assert.AreEqual(100, testingTarget.View.Size.Width, "Should be equal!");
+ }
+
+ testingTarget.LongPressGesture = new LongPressGesture(Gesture.StateType.Possible);
+ Assert.AreEqual(Gesture.StateType.Possible, testingTarget.LongPressGesture.State, "Should be equal!");
+
+ tlog.Debug(tag, $"LongPressGestureDetectedEventArgsView END (OK)");
+ }
+ }
}
public void PinchGestureDetectorAssign()
{
tlog.Debug(tag, $"PinchGestureDetectorAssign START");
- PinchGestureDetector a1 = new PinchGestureDetector();
- PinchGestureDetector b1 = a1;
-
- a1.Dispose();
- b1.Dispose();
-
- tlog.Debug(tag, $"PinchGestureDetectorAssign END (OK)");
- Assert.Pass("PinchGestureDetectorAssign");
+ using (PinchGestureDetector detector = new PinchGestureDetector())
+ {
+ var testingTarget = detector.Assign(detector);
+ Assert.IsInstanceOf<PinchGestureDetector>(testingTarget, "Should be an instance of PinchGestureDetector type.");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"PinchGestureDetectorAssign END (OK)");
}
[Test]
}
private void OnDetected(object obj, PinchGestureDetector.DetectedEventArgs e)
- { }
+ { }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test DetectedEventArgs View.")]
+ [Property("SPEC", "Tizen.NUI.DetectedEventArgs.View A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PinchGestureDetectedEventArgsView()
+ {
+ tlog.Debug(tag, $"PinchGestureDetectedEventArgsView START");
+
+ var testingTarget = new Tizen.NUI.PinchGestureDetector.DetectedEventArgs();
+ Assert.IsNotNull(testingTarget, "Can't create success object DetectedEventArgs.");
+ Assert.IsInstanceOf<Tizen.NUI.PinchGestureDetector.DetectedEventArgs>(testingTarget, "Should return DetectedEventArgs instance.");
+
+ using (View view = new View() { Size = new Size(100, 50) })
+ {
+ testingTarget.View = view;
+ Assert.AreEqual(100, testingTarget.View.Size.Width, "Should be equal!");
+ }
+
+ testingTarget.PinchGesture = new PinchGesture(Gesture.StateType.Possible);
+ Assert.AreEqual(Gesture.StateType.Possible, testingTarget.PinchGesture.State, "Should be equal!");
+
+ tlog.Debug(tag, $"PinchGestureDetectedEventArgsView END (OK)");
+ }
}
}
\ No newline at end of file
public void RotationGestureDetectorAssign()
{
tlog.Debug(tag, $"RotationGestureDetectorAssign START");
- RotationGestureDetector a1 = new RotationGestureDetector();
- RotationGestureDetector b1 = a1;
+ using (RotationGestureDetector detector = new RotationGestureDetector())
+ {
+ var testingTarget = detector.Assign(detector);
+ Assert.IsInstanceOf<RotationGestureDetector>(testingTarget, "Should be an instance of RotationGestureDetector type.");
+
+ testingTarget.Dispose();
+ }
- b1.Dispose();
- a1.Dispose();
-
tlog.Debug(tag, $"RotationGestureDetectorAssign END (OK)");
- Assert.Pass("RotationGestureDetectorAssign");
}
[Test]
}
private void OnDetected(object obj, TapGestureDetector.DetectedEventArgs e)
- { }
+ { }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test DetectedEventArgs View.")]
+ [Property("SPEC", "Tizen.NUI.DetectedEventArgs.View A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TapGestureDetectedEventArgsView()
+ {
+ tlog.Debug(tag, $"TapGestureDetectedEventArgsView START");
+
+ var testingTarget = new Tizen.NUI.TapGestureDetector.DetectedEventArgs();
+ Assert.IsNotNull(testingTarget, "Can't create success object DetectedEventArgs.");
+ Assert.IsInstanceOf<Tizen.NUI.TapGestureDetector.DetectedEventArgs>(testingTarget, "Should return DetectedEventArgs instance.");
+
+ using (View view = new View() { Size = new Size(100, 50) })
+ {
+ testingTarget.View = view;
+ Assert.AreEqual(100, testingTarget.View.Size.Width, "Should be equal!");
+ }
+
+ testingTarget.TapGesture = new TapGesture();
+ tlog.Debug(tag, "TapGesture : " + testingTarget.TapGesture);
+
+ tlog.Debug(tag, $"TapGestureDetectedEventArgsView END (OK)");
+ }
}
}
\ No newline at end of file
byte[] buffer = new byte[1024];
- var testingTarget = new PixelData(buffer, 1024, 100, 150, PixelFormat.L8);
+ var testingTarget = new PixelData(buffer, 1024, 100, 150, PixelFormat.L8, PixelData.ReleaseFunction.Free);
Assert.IsNotNull(testingTarget, "Can't create success object PixelData");
Assert.IsInstanceOf<PixelData>(testingTarget, "Should be an instance of PixelData type.");
byte[] buffer = new byte[10];
- using (PixelData pixelData = new PixelData(buffer, 10, 1, 2, PixelFormat.L8))
+ using (PixelData pixelData = new PixelData(buffer, 10, 1, 2, PixelFormat.L8, PixelData.ReleaseFunction.Free))
{
var testingTarget = new PixelData(PixelData.getCPtr(pixelData).Handle, true);
Assert.IsNotNull(testingTarget, "Can't create success object PixelData");
byte[] buffer = new byte[10];
- var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.L8);
+ var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.L8, PixelData.ReleaseFunction.Free);
Assert.IsNotNull(testingTarget, "Can't create success object PixelData");
Assert.IsInstanceOf<PixelData>(testingTarget, "Should be an instance of PixelData type.");
byte[] buffer = new byte[10];
- var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.L8);
+ var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.L8, PixelData.ReleaseFunction.Free);
Assert.IsNotNull(testingTarget, "Can't create success object PixelData");
Assert.IsInstanceOf<PixelData>(testingTarget, "Should be an instance of PixelData type.");
byte[] buffer = new byte[10];
- var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.L8);
+ var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.L8, PixelData.ReleaseFunction.Free);
Assert.IsNotNull(testingTarget, "Can't create success object PixelData");
Assert.IsInstanceOf<PixelData>(testingTarget, "Should be an instance of PixelData type.");
byte[] buffer = new byte[10];
- var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.BGR8888);
+ var testingTarget = new PixelData(buffer, 10, 1, 2, PixelFormat.BGR8888, PixelData.ReleaseFunction.Free);
Assert.IsNotNull(testingTarget, "Can't create success object PixelData");
Assert.IsInstanceOf<PixelData>(testingTarget, "Should be an instance of PixelData type.");
internal class PublicExternalThemeManagerTest
{
private const string tag = "NUITEST";
- private string path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
+ private string path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Test_Theme.xaml";
[SetUp]
public void Init()
tlog.Debug(tag, $"ExternalThemeManagerInitialize END (OK)");
Assert.Pass("ExternalThemeManagerInitialize");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("test ExternalThemeManager SetTheme")]
+ [Property("SPEC", "Tizen.NUI.ExternalThemeManager.SetTheme M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ public void ExternalThemeManagerSetTheme()
+ {
+ tlog.Debug(tag, $"ExternalThemeManagerSetTheme START");
+
+ try
+ {
+ ExternalThemeManager.SetTheme("Tizen.NUI.Theme.Common");
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, "SetTheme : " + e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ tlog.Debug(tag, $"ExternalThemeManagerSetTheme END (OK)");
+ }
}
}
\ No newline at end of file
internal class PublicThemeTest
{
private const string tag = "NUITEST";
+ private Theme theme = null;
+ private string path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Test_Theme.xaml";
+ private string image = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
+ private string IOException_file = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "1.xaml";
+ private string ParseException_file = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Test_View.xaml";
+ private IEnumerable<KeyValuePair<string, string>> changedResources = new List<KeyValuePair<string, string>>() { new KeyValuePair<string, string>("Version", "2.0") };
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
+ theme = new Theme(path);
}
[TearDown]
public void Destroy()
{
+ theme = null;
tlog.Info(tag, "Destroy() is called!");
}
try
{
- Theme a1 = new Theme("");
+ var testingTarget = new Theme("");
}
catch (ArgumentNullException e)
{
}
[Test]
+ [Category("P2")]
+ [Description("Theme construcotr. Could not parse.")]
+ [Property("SPEC", "Tizen.NUI.Theme.Theme C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ public void ThemeConstructorWithFileCouldNotBeParsed()
+ {
+ tlog.Debug(tag, $"ThemeConstructorWithFileCouldNotBeParsed START");
+
+ try
+ {
+ var testingTarget = new Theme(image);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"ThemeConstructorWithFileCouldNotBeParsed END (OK)");
+ Assert.Pass("Caught Exception : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Theme construcotr. IOException.")]
+ [Property("SPEC", "Tizen.NUI.Theme.Theme C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ public void ThemeConstructorIOException()
+ {
+ tlog.Debug(tag, $"ThemeConstructorIOException START");
+
+ try
+ {
+ var testingTarget = new Theme(IOException_file);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"ThemeConstructorIOException END (OK)");
+ Assert.Pass("Caught IOException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Theme construcotr. XamlParseException.")]
+ [Property("SPEC", "Tizen.NUI.Theme.Theme C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ public void ThemeConstructorXamlParseException()
+ {
+ tlog.Debug(tag, $"ThemeConstructorXamlParseException START");
+
+ try
+ {
+ var testingTarget = new Theme(ParseException_file);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"ThemeConstructorXamlParseException END (OK)");
+ Assert.Pass("Caught XamlParseException : Passed!");
+ }
+ }
+
+ [Test]
[Category("P1")]
[Description("test Theme BasedOn.")]
[Property("SPEC", "Tizen.NUI.Theme.BasedOn A")]
public void ThemeBasedOn()
{
tlog.Debug(tag, $"ThemeBasedOn START");
- Theme a1 = new Theme();
- string b1 = a1.BasedOn;
- a1.BasedOn = b1;
+ var baseOn = "Tizen.NUI.Theme.Common";
+ theme.BasedOn = baseOn;
+ tlog.Debug(tag, "BaseOn : " + theme.BasedOn);
tlog.Debug(tag, $"ThemeBasedOn END (OK)");
- Assert.Pass("ThemeBasedOn");
}
[Test]
public void ThemeIsResourcesCreated()
{
tlog.Debug(tag, $"ThemeIsResourcesCreated START");
- Theme a1 = new Theme();
- bool b1 = a1.IsResourcesCreated;
+ var result = theme.IsResourcesCreated;
+ tlog.Debug(tag, "IsResourcesCreated : " + result);
tlog.Debug(tag, $"ThemeIsResourcesCreated END (OK)");
- Assert.Pass("ThemeIsResourcesCreated");
}
[Test]
public void ThemeResources()
{
tlog.Debug(tag, $"ThemeResources START");
- Theme a1 = new Theme();
- ResourceDictionary b1 = a1.Resources;
+ var result = theme.Resources;
+ tlog.Debug(tag, "Resources : " + result);
+
+ theme.SetChangedResources(changedResources);
+
+ // resources == value
+ theme.Resources = result;
+ tlog.Debug(tag, "Resouces : " + theme.Resources);
+
+ // resources != null
+ ResourceDictionary dic = new ResourceDictionary();
+ theme.Resources = dic;
+ tlog.Debug(tag, "Resouces : " + theme.Resources);
tlog.Debug(tag, $"ThemeResources END (OK)");
- Assert.Pass("ThemeResources");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("test Theme this .")]
+ [Property("SPEC", "Tizen.NUI.Theme.this A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ public void ThemeThis()
+ {
+ tlog.Debug(tag, $"ThemeThis START");
+
+ ViewStyle style = new ViewStyle()
+ {
+ Color = Color.Cyan,
+ };
+
+ theme.AddStyle("style", style);
+
+ tlog.Debug(tag, "Count : " + theme.Count);
+ tlog.Debug(tag, "theme[\"style\"] : " + theme["style"]);
+
+ ViewStyle newStyle = new ViewStyle()
+ {
+ Size = new Size(100, 50),
+ Color = Color.Red
+ };
+
+ theme["Style"] = newStyle;
+ tlog.Debug(tag, "theme[\"style\"] : " + theme["style"]);
+
+ tlog.Debug(tag, $"ThemeThis END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("test Theme this .")]
+ [Property("SPEC", "Tizen.NUI.Theme.this A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ public void ThemeThisSetVauleIsNUll()
+ {
+ tlog.Debug(tag, $"ThemeThisSetVauleIsNUll START");
+
+ ViewStyle style = new ViewStyle()
+ {
+ Color = Color.Cyan,
+ };
+
+ theme.AddStyle("style", style);
+
+ tlog.Debug(tag, "Count : " + theme.Count);
+ tlog.Debug(tag, "theme[\"style\"] : " + theme["style"]);
+
+ ViewStyle newStyle = null;
+
+ theme["Style"] = newStyle;
+ tlog.Debug(tag, "theme[\"style\"] : " + theme["style"]);
+
+ tlog.Debug(tag, $"ThemeThisSetVauleIsNUll END (OK)");
}
[Test]
public void ThemeClear()
{
tlog.Debug(tag, $"ThemeClear START");
- Theme a1 = new Theme();
-
- a1.Clear();
-
+
+ try
+ {
+ theme.Clear();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
tlog.Debug(tag, $"ThemeClear END (OK)");
- Assert.Pass("ThemeClear");
}
[Test]
[Category("P1")]
- [Description("test Theme HasStyle .")]
- [Property("SPEC", "Tizen.NUI.Theme.HasStyle M")]
+ [Description("test Theme AddStyle .")]
+ [Property("SPEC", "Tizen.NUI.Theme.AddStyle M")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "MR")]
[Property("COVPARAM", "")]
- public void ThemeHasStyle()
+ public void ThemeAddStyle()
{
- tlog.Debug(tag, $"ThemeHasStyle START");
- Theme a1 = new Theme();
+ tlog.Debug(tag, $"ThemeAddStyle START");
+
+ ViewStyle style = new ViewStyle()
+ {
+ Color = Color.Cyan,
+ };
- a1.HasStyle("red");
+ try
+ {
+ theme.AddStyle("style", style);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ tlog.Debug(tag, "HasStyle : " + theme.HasStyle("style"));
+ tlog.Debug(tag, "RemoveStyle : " + theme.RemoveStyle("style"));
- tlog.Debug(tag, $"ThemeHasStyle END (OK)");
- Assert.Pass("ThemeHasStyle");
+ tlog.Debug(tag, $"ThemeAddStyle END (OK)");
}
[Test]
- [Category("P1")]
- [Description("test Theme RemoveStyle .")]
- [Property("SPEC", "Tizen.NUI.Theme.RemoveStyle M")]
+ [Category("P2")]
+ [Description("test Theme AddStyle .")]
+ [Property("SPEC", "Tizen.NUI.Theme.AddStyle M")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "MR")]
[Property("COVPARAM", "")]
- public void ThemeRemoveStyle()
+ public void ThemeAddStyleNullStyleName()
{
- tlog.Debug(tag, $"ThemeRemoveStyle START");
- Theme a1 = new Theme();
+ tlog.Debug(tag, $"ThemeAddStyleNullStyleName START");
- a1.RemoveStyle("red");
+ ViewStyle style = new ViewStyle()
+ {
+ Color = Color.Cyan,
+ };
- tlog.Debug(tag, $"ThemeRemoveStyle END (OK)");
- Assert.Pass("ThemeRemoveStyle");
+ try
+ {
+ theme.AddStyle(null, style);
+ }
+ catch (ArgumentNullException e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"ThemeAddStyleNullStyleName END (OK)");
+ Assert.Pass("Caught Exception : Passed!");
+ }
}
[Test]
public void ThemeClone()
{
tlog.Debug(tag, $"ThemeClone START");
- Theme a1 = new Theme();
- a1.Clone();
+ try
+ {
+ theme.Clone();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
- tlog.Debug(tag, $"ThemeAddStyle END (OK)");
- Assert.Pass("ThemeAddStyle");
+ tlog.Debug(tag, $"ThemeClone END (OK)");
}
[Test]
{
tlog.Debug(tag, $"ThemeMerge START");
+ var testingTarget = new Theme();
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<Theme>(testingTarget, "should be an instance of testing target class!");
+
ViewStyle style = new ViewStyle()
{
Size = new Size2D(100, 30),
Focusable = true
};
- Theme a1 = new Theme();
- a1.Version = "0.1";
- a1.AddStyle("myStyle", style);
-
- ViewStyle style1 = new ViewStyle()
- {
- Margin = new Extents(4, 2, 3, 7)
- };
- Theme t1 = new Theme();
- t1.Id = "t1";
- t1.Version = "1.0";
- t1.AddStyle("myStyle", style1);
+ testingTarget.Version = "0.1";
+ testingTarget.AddStyle("myStyle", style);
try
{
- a1.Merge(t1);
+ theme.Merge(testingTarget); // merge with Theme
+ theme.Merge(path); // merge with xaml file
}
catch (Exception e)
{
public void ThemeMergeWithNullParameter()
{
tlog.Debug(tag, $"ThemeMergeWithNullParameter START");
- Theme a1 = new Theme();
- Theme b1 = new Theme();
- Theme t2 = null;
try
{
- a1.Merge(t2);
+ Theme newtheme = null;
+ theme.Merge(newtheme);
}
catch (ArgumentNullException e)
{
tlog.Debug(tag, $"ThemeMergeWithNullParameter END (OK)");
Assert.Pass("Caught ArgumentNullException: Passed!");
}
-
-
- string tmp = a1.Id;
- a1.Id = null;
-
- a1.Merge(b1);
-
- a1.Id = tmp;
- tmp = a1.Version;
- a1.Version = null;
- a1.Merge(b1);
}
[Test]
[Category("P2")]
- [Description("Theme Merge. Id is null.")]
+ [Description("Theme Merge.")]
[Property("SPEC", "Tizen.NUI.Theme.Merge M")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "MR")]
[Property("COVPARAM", "")]
- public void ThemeMergeWithNullId()
+ public void ThemeMergeIdAndVersionIsNull()
{
- tlog.Debug(tag, $"ThemeMergeWithNullId START");
- Theme a1 = new Theme();
- Theme b1 = new Theme();
-
- a1.Id = null;
- a1.Merge(b1);
- Assert.AreEqual(a1.Id, b1.Id, "Should be equal!");
-
- tlog.Debug(tag, $"ThemeMergeWithNullId END (OK)");
- }
-
- [Test]
- [Category("P2")]
- [Description("Theme Merge. Version is null.")]
- [Property("SPEC", "Tizen.NUI.Theme.Merge M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("COVPARAM", "")]
- public void ThemeMergeWithNullVersion()
- {
- tlog.Debug(tag, $"ThemeMergeWithNullVersion START");
- Theme a1 = new Theme();
- Theme b1 = new Theme();
-
- a1.Version = null;
- a1.Merge(b1);
- Assert.AreEqual(a1.Version, b1.Version, "Should be equal!");
+ tlog.Debug(tag, $"ThemeMergeIdAndVersionIsNull START");
+
+ var testingTarget = new Theme();
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<Theme>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Merge(theme);
+ Assert.AreEqual(testingTarget.Id, theme.Id, "Should be equal!");
+ Assert.AreEqual(testingTarget.Version, theme.Version, "Should be equal!");
- tlog.Debug(tag, $"ThemeMergeWithNullVersion END (OK)");
+ testingTarget = null;
+ tlog.Debug(tag, $"ThemeMergeIdAndVersionIsNull END (OK)");
}
[Test]
public void ThemeHasSameIdAndVersion()
{
tlog.Debug(tag, $"ThemeHasSameIdAndVersion START");
- Theme a1 = new Theme();
- a1.HasSameIdAndVersion("themeid", "1.0");
- tlog.Debug(tag, $"ThemeHasSameIdAndVersion END (OK)");
- Assert.Pass("ThemeHasSameIdAndVersion");
- }
- [Test]
- [Category("P1")]
- [Description("test Theme OnThemeResourcesChanged .")]
- [Property("SPEC", "Tizen.NUI.Theme.OnThemeResourcesChanged M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("COVPARAM", "")]
- public void ThemeOnThemeResourcesChanged()
- {
- tlog.Debug(tag, $"ThemeOnThemeResourcesChanged START");
- Theme a1 = new Theme();
+ var result = theme.HasSameIdAndVersion("Tizen.NUI.Theme.Wearable", "1.0");
+ tlog.Debug(tag, "HasSameIdAndVersion : " + result);
- a1.OnThemeResourcesChanged();
-
- tlog.Debug(tag, $"ThemeOnThemeResourcesChanged END (OK)");
- Assert.Pass("ThemeOnThemeResourcesChanged");
+ tlog.Debug(tag, $"ThemeHasSameIdAndVersion END (OK)");
}
}
}
internal class PublicThemeManagerTest
{
private const string tag = "NUITEST";
+ private string path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Test_Theme.xaml";
[SetUp]
public void Init()
[Test]
[Category("P1")]
- [Description("Test ThemeManager CurrentTheme.")]
+ [Description("ThemeManager CurrentTheme.")]
[Property("SPEC", "Tizen.NUI.ThemeManager.CurrentTheme A")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PRW")]
{
tlog.Debug(tag, $"ThemeManagerCurrentTheme START");
- Theme a1 = ThemeManager.CurrentTheme;
- ThemeManager.CurrentTheme = a1;
+ Theme theme = new Theme(path);
+ ThemeManager.CurrentTheme = theme;
+ tlog.Debug(tag, "CurrentTheme : " + ThemeManager.CurrentTheme);
+
+ tlog.Debug(tag, "ThemeId : " + ThemeManager.ThemeId);
+ tlog.Debug(tag, "BaseTheme : " + ThemeManager.BaseTheme);
tlog.Debug(tag, $"ThemeManagerCurrentTheme END (OK)");
- Assert.Pass("ThemeManagerCurrentTheme");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ThemeManager PlatformThemeEnabled.")]
+ [Property("SPEC", "Tizen.NUI.ThemeManager.PlatformThemeEnabled A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ public void ThemeManagerplatformThemeEnabled()
+ {
+ tlog.Debug(tag, $"ThemeManagerplatformThemeEnabled START");
+
+ ThemeManager.PlatformThemeEnabled = true;
+ tlog.Debug(tag, "PlatformThemeEnabled : " + ThemeManager.PlatformThemeEnabled);
+
+ var result = ThemeManager.ApplyPlatformTheme("Tizen.NUI.Theme.Common");
+ tlog.Debug(tag, "ApplyPlatformTheme : " + result);
+ tlog.Debug(tag, "GetPlatformStyle : " + ThemeManager.GetPlatformStyle("style"));
+ tlog.Debug(tag, "GetPlatformStyle : " + ThemeManager.GetPlatformStyle(typeof(ViewStyle)));
+
+ tlog.Debug(tag, $"ThemeManagerplatformThemeEnabled END (OK)");
}
[Test]
{
tlog.Debug(tag, $"ThemeManagerApplyTheme START");
- Theme a1 = new Theme();
- ThemeManager.ApplyTheme(a1);
+ var testingTarget = new Theme(path);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<Theme>(testingTarget, "should be an instance of testing target class!");
- a1.Id = null;
- ThemeManager.ApplyTheme(a1);
+ try
+ {
+ ThemeManager.ApplyTheme(testingTarget);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
tlog.Debug(tag, $"ThemeManagerApplyTheme END (OK)");
- Assert.Pass("ThemeManagerApplyTheme");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ThemeManager ApplyTheme.")]
+ [Property("SPEC", "Tizen.NUI.ThemeManager.ApplyTheme M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ public void ThemeManagerApplyThemeNullThemeId()
+ {
+ tlog.Debug(tag, $"ThemeManagerApplyThemeNullThemeId START");
+
+ var testingTarget = new Theme();
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<Theme>(testingTarget, "should be an instance of testing target class!");
+
+ try
+ {
+ ThemeManager.ApplyTheme(testingTarget);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ tlog.Debug(tag, $"ThemeManagerApplyThemeNullThemeId END (OK)");
}
[Test]
{
tlog.Debug(tag, $"ThemeManagerGetStyle START");
+ var testingTarget = new Theme(path);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<Theme>(testingTarget, "should be an instance of testing target class!");
- ThemeManager.GetStyle("styleName");
+ ViewStyle style = new ViewStyle()
+ {
+ Color = Color.Cyan,
+ };
+ testingTarget.AddStyle("style", style);
+ ThemeManager.CurrentTheme = testingTarget;
- Type viewType = typeof(string);
- ThemeManager.GetStyle(viewType);
+ tlog.Debug(tag, "GetStyle : " + ThemeManager.GetStyle("style"));
+ tlog.Debug(tag, "GetStyle : " + ThemeManager.GetStyle(typeof(View)));
+ tlog.Debug(tag, "GetUpdateStyleWithoutClone : " + ThemeManager.GetUpdateStyleWithoutClone("style"));
+ tlog.Debug(tag, "GetUpdateStyleWithoutClone : " + ThemeManager.GetUpdateStyleWithoutClone(typeof(ViewStyle)));
tlog.Debug(tag, $"ThemeManagerGetStyle END (OK)");
- Assert.Pass("ThemeManagerGetStyle");
}
[Test]
{
tlog.Debug(tag, $"ThemeManagerApplyFallbackTheme START");
- Theme a1 = new Theme();
- ThemeManager.ApplyFallbackTheme(a1);
+ var testingTarget = new Theme(path);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<Theme>(testingTarget, "should be an instance of testing target class!");
+
+ try
+ {
+ ThemeManager.ApplyFallbackTheme(testingTarget);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
tlog.Debug(tag, $"ThemeManagerApplyFallbackTheme END (OK)");
- Assert.Pass("ThemeManagerApplyFallbackTheme");
}
}
}
tlog.Debug(tag, e.Message.ToString());
Assert.Fail("Caught Exception : Failed!");
}
+
tlog.Debug(tag, $"WindowRequestMoveToServer END (OK)");
}
tlog.Debug(tag, e.Message.ToString());
Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"WindowRequestMoveToServer END (OK)");
- }
-
- [Test]
- [Category("P1")]
- [Description("Window IncludeInputRegion Test")]
- [Property("SPEC", "Tizen.NUI.Window.IncludeInputRegion M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- public void IncludeInputRegionTest()
- {
- try
- {
- var window = Window.Instance;
- Rectangle inputRegion = new Rectangle(0, 0, 720, 640);
- window.IncludeInputRegion(inputRegion);
- }
- catch (Exception e)
- {
- Assert.Fail("Caught Exception : Failed!");
- }
- }
- [Test]
- [Category("P1")]
- [Description("Window ExcludeInputRegion Test")]
- [Property("SPEC", "Tizen.NUI.Window.ExcludeInputRegion M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- public void ExcludeInputRegionTest()
- {
- try
- {
- var window = Window.Instance;
- Rectangle includeInputRegion = new Rectangle(0, 0, 720, 1280);
- window.IncludeInputRegion(includeInputRegion);
-
- Rectangle excludeInputRegion = new Rectangle(0, 641, 720, 640);
- window.ExcludeInputRegion(excludeInputRegion);
- }
- catch (Exception e)
- {
- Assert.Fail("Caught Exception : Failed!");
- }
+ tlog.Debug(tag, $"WindowRequestResizeToServer END (OK)");
}
}
}
public class PublicApplicationResourcePathExtensionTest
{
private const string tag = "NUITEST";
- private ApplicationResourcePathExtension a1;
+ private ApplicationResourcePathExtension path;
+
+ internal class IServiceProviderImpl : IServiceProvider
+ {
+ public object GetService(Type serviceType) { return null; }
+ }
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- a1 = new ApplicationResourcePathExtension();
+ path = new ApplicationResourcePathExtension();
}
[TearDown]
public void Destroy()
{
- a1 = null;
+ path = null;
tlog.Info(tag, "Destroy() is called!");
}
[Test]
[Category("P1")]
- [Description("ApplicationResourcePathExtension ApplicationResourcePathExtension")]
- [Property("SPEC", "Tizen.NUI.ApplicationResourcePathExtension.ApplicationResourcePathExtension C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- public void ApplicationResourcePathExtensionConstructor()
- {
- tlog.Debug(tag, $"ApplicationResourcePathExtensionConstructor START");
-
- ApplicationResourcePathExtension applicationResourcePathExtension = new ApplicationResourcePathExtension();
-
- tlog.Debug(tag, $"ApplicationResourcePathExtensionConstructor END (OK)");
- Assert.Pass("ApplicationResourcePathExtensionConstructor");
- }
-
- [Test]
- [Category("P1")]
[Description("ApplicationResourcePathExtension FilePath ")]
[Property("SPEC", "Tizen.NUI.ApplicationResourcePathExtension.FilePath A")]
[Property("SPEC_URL", "-")]
try
{
- string s1 = a1.FilePath;
- a1.FilePath = s1;
+ string file = path.FilePath;
+ path.FilePath = file;
+ Assert.AreEqual(file, path.FilePath, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"ApplicationResourcePathExtensionFilePath END (OK)");
- Assert.Pass("ApplicationResourcePathExtensionFilePath");
- }
-
- private class IServiceProviderimplement : IServiceProvider
- {
- public object GetService(Type serviceType)
- {
- return null;
- }
+ tlog.Debug(tag, $"ApplicationResourcePathExtensionFilePath END");
}
[Test]
try
{
- IServiceProviderimplement serviceProviderimplement = new IServiceProviderimplement();
- a1.ProvideValue(serviceProviderimplement);
+ path.ProvideValue(new IServiceProviderImpl());
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"ApplicationResourcePathExtensionProvideValue END (OK)");
- Assert.Pass("ApplicationResourcePathExtensionProvideValue");
+ tlog.Debug(tag, $"ApplicationResourcePathExtensionProvideValue END");
}
+
+
}
}
\ No newline at end of file
public class PublicArrayExtensionTest
{
private const string tag = "NUITEST";
- private static ArrayExtension a1;
+ private ArrayExtension array;
- internal class IServiceProviderimplement : IServiceProvider
+ internal class IServiceProviderImpl : IServiceProvider
{
- public object GetService(Type serviceType)
- {
- return null;
- }
+ public object GetService(Type serviceType) { return null; }
}
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- a1 = new ArrayExtension();
+ array = new ArrayExtension();
}
[TearDown]
public void Destroy()
{
- a1 = null;
+ array = null;
tlog.Info(tag, "Destroy() is called!");
}
[Test]
[Category("P1")]
- [Description("ArrayExtension ArrayExtension")]
- [Property("SPEC", "Tizen.NUI.ArrayExtension.ArrayExtension C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- public void ArrayExtensionConstructor()
- {
- tlog.Debug(tag, $"ArrayExtensionConstructor START");
-
- ArrayExtension arrayExtension = new ArrayExtension();
-
- tlog.Debug(tag, $"ArrayExtensionConstructor END (OK)");
- Assert.Pass("ArrayExtensionConstructor");
- }
-
- [Test]
- [Category("P1")]
[Description("ArrayExtension Items")]
[Property("SPEC", "Tizen.NUI.ArrayExtension.Items A")]
[Property("SPEC_URL", "-")]
try
{
- IList i1 = a1.Items;
+ var item = array.Items;
+ tlog.Debug(tag, "Items : " + item);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"ArrayExtensionItems END (OK)");
- Assert.Pass("ArrayExtensionItems");
+ tlog.Debug(tag, $"ArrayExtensionItems END");
}
[Test]
try
{
- Type t1 = a1.Type;
- a1.Type = t1;
+ var type = array.Type;
+ array.Type = type;
+ Assert.AreEqual(type, array.Type, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"ArrayExtensionType END (OK)");
- Assert.Pass("ArrayExtensionType");
+ tlog.Debug(tag, $"ArrayExtensionType END");
}
[Test]
try
{
- IServiceProviderimplement serviceProviderimplement = new IServiceProviderimplement();
- a1.Type = typeof(string);
-
- a1.ProvideValue(serviceProviderimplement);
+ array.Type = typeof(string);
+ array.ProvideValue(new IServiceProviderImpl());
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"ArrayExtensionProvideValue END (OK)");
- Assert.Pass("ArrayExtensionProvideValue");
+ tlog.Debug(tag, $"ArrayExtensionProvideValue END");
}
}
}
\ No newline at end of file
public class PublicBindingExtensionTest
{
private const string tag = "NUITEST";
- private BindingExtension b1;
+ private BindingExtension binding;
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- b1 = new BindingExtension();
+ binding = new BindingExtension();
}
[TearDown]
public void Destroy()
{
- b1 = null;
+ binding = null;
tlog.Info(tag, "Destroy() is called!");
}
[Test]
[Category("P1")]
- [Description("BindingExtension BindingExtension")]
- [Property("SPEC", "Tizen.NUI.BindingExtension.BindingExtension C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- public void BindingExtensionConstructor()
- {
- tlog.Debug(tag, $"BindingExtensionConstructor START");
-
- BindingExtension binding = new BindingExtension();
-
- tlog.Debug(tag, $"BindingExtensionConstructor END (OK)");
- Assert.Pass("BindingExtensionConstructor");
- }
-
- [Test]
- [Category("P1")]
[Description("BindingExtension Path")]
[Property("SPEC", "Tizen.NUI.BindingExtension.Path A")]
[Property("SPEC_URL", "-")]
try
{
- string s1 = b1.Path;
- b1.Path = s1;
+ string str = binding.Path;
+ binding.Path = str;
+ Assert.AreEqual(str, binding.Path, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"BindingExtensionPath END (OK)");
- Assert.Pass("BindingExtensionPath");
+ tlog.Debug(tag, $"BindingExtensionPath END");
}
[Test]
try
{
- BindingMode tmp = b1.Mode;
- b1.Mode = tmp;
+ var mode = binding.Mode;
+ binding.Mode = mode;
+ Assert.AreEqual(mode, binding.Mode, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"BindingExtensionMode END (OK)");
- Assert.Pass("BindingExtensionMode");
+ tlog.Debug(tag, $"BindingExtensionMode END");
}
[Test]
try
{
- IValueConverter tmp = b1.Converter;
- b1.Converter = tmp;
+ var converter = binding.Converter;
+ binding.Converter = converter;
+ Assert.AreEqual(converter, binding.Converter, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"BindingExtensionConverter END (OK)");
- Assert.Pass("BindingExtensionConverter");
+ tlog.Debug(tag, $"BindingExtensionConverter END");
}
[Test]
try
{
- object tmp = b1.ConverterParameter;
- b1.ConverterParameter = tmp;
+ var param = binding.ConverterParameter;
+ binding.ConverterParameter = param;
+ Assert.AreEqual(param, binding.ConverterParameter, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"BindingExtensionConverterParameter END (OK)");
- Assert.Pass("BindingExtensionConverterParameter");
+ tlog.Debug(tag, $"BindingExtensionConverterParameter END");
}
[Test]
try
{
- string tmp = b1.StringFormat;
- b1.StringFormat = tmp;
+ var format = binding.StringFormat;
+ binding.StringFormat = format;
+ Assert.AreEqual(format, binding.StringFormat, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"BindingExtensionStringFormat END (OK)");
- Assert.Pass("BindingExtensionStringFormat");
+ tlog.Debug(tag, $"BindingExtensionStringFormat END");
}
[Test]
try
{
- object tmp = b1.Source;
- b1.Source = tmp;
+ var source = binding.Source;
+ binding.Source = source;
+ Assert.AreEqual(source, binding.Source, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"BindingExtensionSource END (OK)");
- Assert.Pass("BindingExtensionSource");
+ tlog.Debug(tag, $"BindingExtensionSource END");
}
[Test]
try
{
- string tmp = b1.UpdateSourceEventName;
- b1.UpdateSourceEventName = tmp;
+ var name = binding.UpdateSourceEventName;
+ binding.UpdateSourceEventName = name;
+ Assert.AreEqual(name, binding.UpdateSourceEventName, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"BindingExtensionUpdateSourceEventName END (OK)");
- Assert.Pass("BindingExtensionUpdateSourceEventName");
+ tlog.Debug(tag, $"BindingExtensionUpdateSourceEventName END");
}
[Test]
try
{
- object tmp = b1.TargetNullValue;
- b1.TargetNullValue = tmp;
+ var value = binding.TargetNullValue;
+ binding.TargetNullValue = value;
+ Assert.AreEqual(value, binding.TargetNullValue, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"BindingExtensionTargetNullValue END (OK)");
- Assert.Pass("BindingExtensionTargetNullValue");
+ tlog.Debug(tag, $"BindingExtensionTargetNullValue END");
}
[Test]
try
{
- object tmp = b1.FallbackValue;
- b1.FallbackValue = tmp;
+ var value = binding.FallbackValue;
+ binding.FallbackValue = value;
+ Assert.AreEqual(value, binding.FallbackValue, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"BindingExtensionFallbackValue END (OK)");
- Assert.Pass("BindingExtensionFallbackValue");
+ tlog.Debug(tag, $"BindingExtensionFallbackValue END");
}
[Test]
try
{
- TypedBindingBase tmp = b1.TypedBinding;
- b1.TypedBinding = tmp;
+ var type = binding.TypedBinding;
+ binding.TypedBinding = type;
+ Assert.AreEqual(type, binding.TypedBinding, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"BindingExtensionTypedBinding END (OK)");
- Assert.Pass("BindingExtensionTypedBinding");
+ tlog.Debug(tag, $"BindingExtensionTypedBinding END");
}
}
}
\ No newline at end of file
public class PublicDynamicResourceExtensionTest
{
private const string tag = "NUITEST";
- private static DynamicResourceExtension d1;
+ private DynamicResourceExtension resExtension;
- internal class IServiceProviderimplement : IServiceProvider
+ internal class IServiceProviderImpl : IServiceProvider
{
- public object GetService(Type serviceType)
- {
- return null;
- }
+ public object GetService(Type serviceType) { return null; }
}
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- d1 = new DynamicResourceExtension();
+ resExtension = new DynamicResourceExtension();
}
[TearDown]
public void Destroy()
{
- d1 = null;
+ resExtension = null;
tlog.Info(tag, "Destroy() is called!");
}
try
{
- string tmp = d1.Key;
- d1.Key = tmp;
+ string key = resExtension.Key;
+ resExtension.Key = key;
+ Assert.AreEqual(key, resExtension.Key, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"DynamicResourceExtensionKey END (OK)");
- Assert.Pass("DynamicResourceExtensionKey");
+ tlog.Debug(tag, $"DynamicResourceExtensionKey END");
}
[Test]
try
{
- IServiceProviderimplement serviceProviderimplement = new IServiceProviderimplement();
- d1.Key = "myKey";
- d1.ProvideValue(serviceProviderimplement);
+ resExtension.Key = "Key";
+ resExtension.ProvideValue(new IServiceProviderImpl());
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"DynamicResourceExtensionProvideValue END (OK)");
- Assert.Pass("DynamicResourceExtensionProvideValue");
+ tlog.Debug(tag, $"DynamicResourceExtensionProvideValue END");
}
}
}
\ No newline at end of file
[TestFixture]
[Description("public/xaml/MarkupExtensions/NUIResourcePathExtension")]
- internal class PublicNUIResourcePathExtensionTest
+ public class PublicNUIResourcePathExtensionTest
{
private const string tag = "NUITEST";
- private static NUIResourcePathExtension n1;
+ private NUIResourcePathExtension resPath;
+
+ internal class IServiceProviderImpl : IServiceProvider
+ {
+ public object GetService(Type serviceType) { return null; }
+ }
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- n1 = new NUIResourcePathExtension();
+ resPath = new NUIResourcePathExtension();
}
[TearDown]
public void Destroy()
{
- n1 = null;
+ resPath = null;
tlog.Info(tag, "Destroy() is called!");
}
[Test]
[Category("P1")]
- [Description("NUIResourcePathExtension NUIResourcePathExtension")]
- [Property("SPEC", "Tizen.NUI.NUIResourcePathExtension.NUIResourcePathExtension C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- public void NUIResourcePathExtensionConstructor()
- {
- tlog.Debug(tag, $"NUIResourcePathExtensionConstructor START");
-
- NUIResourcePathExtension nUIResourcePathExtension = new NUIResourcePathExtension();
-
- tlog.Debug(tag, $"NUIResourcePathExtensionConstructor END (OK)");
- Assert.Pass("NUIResourcePathExtensionConstructor");
- }
-
- [Test]
- [Category("P1")]
[Description("NUIResourcePathExtension FilePath")]
[Property("SPEC", "Tizen.NUI.NUIResourcePathExtension.FilePath A")]
[Property("SPEC_URL", "-")]
try
{
- string tmp = n1.FilePath;
- n1.FilePath = tmp;
+ string tmp = resPath.FilePath;
+ resPath.FilePath = tmp;
+ Assert.AreEqual(tmp, resPath.FilePath, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"NUIResourcePathExtensionFilePath END (OK)");
- Assert.Pass("NUIResourcePathExtensionFilePath");
- }
-
- private class IServiceProviderimplement : IServiceProvider
- {
- public object GetService(Type serviceType)
- {
- return null;
- }
+ tlog.Debug(tag, $"NUIResourcePathExtensionFilePath END");
}
[Test]
try
{
- IServiceProviderimplement serviceProviderimplement = new IServiceProviderimplement();
- n1.ProvideValue(serviceProviderimplement);
+ resPath.ProvideValue(new IServiceProviderImpl());
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"NUIResourcePathExtensionProvideValue END (OK)");
- Assert.Pass("NUIResourcePathExtensionProvideValue");
+ tlog.Debug(tag, $"NUIResourcePathExtensionProvideValue END");
}
}
}
\ No newline at end of file
{
private const string tag = "NUITEST";
- internal class IServiceProviderimplement : IServiceProvider
+ internal class IServiceProviderImpl : IServiceProvider
{
- public object GetService(Type serviceType)
- {
- return null;
- }
+ public object GetService(Type serviceType) { return null; }
}
[SetUp]
try
{
- IServiceProviderimplement serviceProviderimplement = new IServiceProviderimplement();
- NullExtension n1 = new NullExtension();
-
- n1.ProvideValue(serviceProviderimplement);
+ var testingTarget = new NullExtension();
+ Assert.IsNotNull(testingTarget, "null NullExtension");
- n1 = null;
+ testingTarget.ProvideValue(new IServiceProviderImpl());
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"NullExtensionProvideValue END (OK)");
- Assert.Pass("NullExtensionProvideValue");
+ tlog.Debug(tag, $"NullExtensionProvideValue END");
}
}
}
\ No newline at end of file
public class PublicReferenceExtensionTest
{
private const string tag = "NUITEST";
- private static ReferenceExtension r1;
-
- internal class IServiceProviderimplement : IServiceProvider
- {
- public object GetService(Type serviceType)
- {
- return null;
- }
- }
+ private ReferenceExtension reference;
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- r1 = new ReferenceExtension();
+ reference = new ReferenceExtension();
}
[TearDown]
public void Destroy()
{
- r1 = null;
+ reference = null;
tlog.Info(tag, "Destroy() is called!");
}
try
{
- string tmp = r1.Name;
- r1.Name = tmp;
- }
- catch (Exception e)
- {
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
- }
-
- tlog.Debug(tag, $"ReferenceExtensionName END (OK)");
- Assert.Pass("ReferenceExtensionName");
- }
-
- [Test]
- [Category("P1")]
- [Description("ReferenceExtension ProvideValue")]
- [Property("SPEC", "Tizen.NUI.ReferenceExtension.ProvideValue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- public void ReferenceExtensionProvideValue()
- {
- tlog.Debug(tag, $"ReferenceExtensionProvideValue START");
-
- try
- {
- IServiceProviderimplement serviceProviderimplement = new IServiceProviderimplement();
- r1.ProvideValue(serviceProviderimplement);
+ var name = reference.Name;
+ reference.Name = name;
+ Assert.AreEqual(name, reference.Name, "Should be equal");
}
catch (Exception e)
{
tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"ReferenceExtensionProvideValue END (OK)");
- Assert.Pass("Caught Exception : passed!");
+ Assert.Fail("Caught Exception : Failed!");
}
+
+ tlog.Debug(tag, $"ReferenceExtensionName END");
}
}
}
\ No newline at end of file
public class PublicStaticExtensionTest
{
private const string tag = "NUITEST";
- private static StaticExtension s1;
-
- internal class IServiceProviderimplement : IServiceProvider
- {
- public object GetService(Type serviceType)
- {
- return null;
- }
- }
+ private StaticExtension sExtention;
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- s1 = new StaticExtension();
+ sExtention = new StaticExtension();
}
[TearDown]
public void Destroy()
{
- s1 = null;
+ sExtention = null;
tlog.Info(tag, "Destroy() is called!");
}
try
{
- string tmp = s1.Member;
- s1.Member = tmp;
- }
- catch (Exception e)
- {
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
- }
-
- tlog.Debug(tag, $"StaticExtensionMember END (OK)");
- Assert.Pass("StaticExtensionMember");
- }
-
- [Test]
- [Category("P1")]
- [Description("StaticExtension ProvideValue")]
- [Property("SPEC", "Tizen.NUI.StaticExtension.ProvideValue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- public void StaticExtensionProvideValue()
- {
- tlog.Debug(tag, $"StaticExtensionProvideValue START");
-
- try
- {
- IServiceProviderimplement serviceProviderimplement = new IServiceProviderimplement();
- s1.ProvideValue(serviceProviderimplement);
+ var member = sExtention.Member;
+ sExtention.Member = member;
+ Assert.AreEqual(member, sExtention.Member, "Should be equal");
}
catch (Exception e)
{
tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"StaticExtensionProvideValue END (OK)");
- Assert.Pass("Caught Exception : passed!");
+ Assert.Fail("Caught Exception : Failed!");
}
+
+ tlog.Debug(tag, $"StaticExtensionMember END");
}
}
}
\ No newline at end of file
public class PublicTemplateBindingExtensionTest
{
private const string tag = "NUITEST";
- private static TemplateBindingExtension t1;
+ private TemplateBindingExtension tExtension;
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- t1 = new TemplateBindingExtension();
+ tExtension = new TemplateBindingExtension();
}
[TearDown]
public void Destroy()
{
- t1 = null;
+ tExtension = null;
tlog.Info(tag, "Destroy() is called!");
}
[Test]
[Category("P1")]
- [Description("TemplateBindingExtension TemplateBindingExtension")]
- [Property("SPEC", "Tizen.NUI.TemplateBindingExtension.TemplateBindingExtension C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- public void TemplateBindingExtensionConstructor()
- {
- tlog.Debug(tag, $"TemplateBindingExtensionConstructor START");
-
- TemplateBindingExtension templateBindingExtension = new TemplateBindingExtension();
-
- tlog.Debug(tag, $"TemplateBindingExtensionConstructor END (OK)");
- Assert.Pass("TemplateBindingExtensionConstructor");
- }
-
- [Test]
- [Category("P1")]
[Description("TemplateBindingExtension Path")]
[Property("SPEC", "Tizen.NUI.TemplateBindingExtension.Path A")]
[Property("SPEC_URL", "-")]
try
{
- string tmp = t1.Path;
- t1.Path = tmp;
+ var path = tExtension.Path;
+ tExtension.Path = path;
+ Assert.AreEqual(path, tExtension.Path, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"TemplateBindingExtensionPath END (OK)");
- Assert.Pass("TemplateBindingExtensionPath");
+ tlog.Debug(tag, $"TemplateBindingExtensionPath END");
}
[Test]
try
{
- BindingMode tmp = t1.Mode;
- t1.Mode = tmp;
+ var mode = tExtension.Mode;
+ tExtension.Mode = mode;
+ Assert.AreEqual(mode, tExtension.Mode, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"TemplateBindingExtensionMode END (OK)");
- Assert.Pass("TemplateBindingExtensionMode");
+ tlog.Debug(tag, $"TemplateBindingExtensionMode END");
}
[Test]
try
{
- IValueConverter tmp = t1.Converter;
- t1.Converter = tmp;
+ var converter = tExtension.Converter;
+ tExtension.Converter = converter;
+ Assert.AreEqual(converter, tExtension.Converter, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"TemplateBindingExtensionConverter END (OK)");
- Assert.Pass("TemplateBindingExtensionConverter");
+ tlog.Debug(tag, $"TemplateBindingExtensionConverter END");
}
[Test]
try
{
- object tmp = t1.ConverterParameter;
- t1.ConverterParameter = tmp;
+ var param = tExtension.ConverterParameter;
+ tExtension.ConverterParameter = param;
+ Assert.AreEqual(param, tExtension.ConverterParameter, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"TemplateBindingExtensionConverterParameter END (OK)");
- Assert.Pass("TemplateBindingExtensionConverterParameter");
+ tlog.Debug(tag, $"TemplateBindingExtensionConverterParameter END");
}
[Test]
try
{
- string tmp = t1.StringFormat;
- t1.StringFormat = tmp;
+ var format = tExtension.StringFormat;
+ tExtension.StringFormat = format;
+ Assert.AreEqual(format, tExtension.StringFormat, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"TemplateBindingExtensionStringFormat END (OK)");
- Assert.Pass("TemplateBindingExtensionStringFormat");
+ tlog.Debug(tag, $"TemplateBindingExtensionStringFormat END");
}
}
}
\ No newline at end of file
public class PublicTypeExtensionTest
{
private const string tag = "NUITEST";
- private static TypeExtension t1;
-
- internal class IServiceProviderimplement : IServiceProvider
- {
- public object GetService(Type serviceType)
- {
- return null;
- }
- }
-
+ private TypeExtension tExtension;
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- t1 = new TypeExtension();
+ tExtension = new TypeExtension();
}
[TearDown]
public void Destroy()
{
+ tExtension = null;
tlog.Info(tag, "Destroy() is called!");
}
try
{
- string tmp = t1.TypeName;
- t1.TypeName = tmp;
- }
- catch (Exception e)
- {
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
- }
-
- tlog.Debug(tag, $"TypeExtensionTypeName END (OK)");
- Assert.Pass("TypeExtensionTypeName");
- }
-
- [Test]
- [Category("P1")]
- [Description("TypeExtension ProvideValue")]
- [Property("SPEC", "Tizen.NUI.TypeExtension.ProvideValue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- public void TypeExtensionProvideValue()
- {
- tlog.Debug(tag, $"TypeExtensionProvideValue START");
-
- try
- {
- IServiceProviderimplement serviceProviderimplement = new IServiceProviderimplement();
- t1.TypeName = "myTypeName";
- t1.ProvideValue(serviceProviderimplement);
+ var name = tExtension.TypeName;
+ tExtension.TypeName = name;
+ Assert.AreEqual(name, tExtension.TypeName, "Should be equal");
}
catch (Exception e)
{
tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"TypeExtensionProvideValue END (OK)");
- Assert.Pass("Caught Exception : passed!");
+ Assert.Fail("Caught Exception : Failed!");
}
+
+ tlog.Debug(tag, $"TypeExtensionTypeName END");
}
}
}
\ No newline at end of file
public class PublicProvideCompiledAttributeTest
{
private const string tag = "NUITEST";
- private static ProvideCompiledAttribute p1;
[SetUp]
public void Init()
{
- p1 = new ProvideCompiledAttribute("mytestAttribute");
tlog.Info(tag, "Init() is called!");
}
[TearDown]
public void Destroy()
{
- p1 = null;
tlog.Info(tag, "Destroy() is called!");
}
public void ProvideCompiledAttributeConstructor()
{
tlog.Debug(tag, $"ProvideCompiledAttributeConstructor START");
- ProvideCompiledAttribute p2 = new ProvideCompiledAttribute("testAttribute");
- p2 = null;
- tlog.Debug(tag, $"ProvideCompiledAttributeConstructor END (OK)");
- Assert.Pass("ProvideCompiledAttributeConstructor");
+ var testingTarget = new ProvideCompiledAttribute("testAttribute");
+ Assert.IsNotNull(testingTarget, "null ProvideCompiledAttribute");
+ Assert.IsInstanceOf<ProvideCompiledAttribute>(testingTarget, "Should return ProvideCompiledAttribute instance.");
+
+ testingTarget = null;
+ tlog.Debug(tag, $"ProvideCompiledAttributeConstructor END");
}
[Test]
tlog.Debug(tag, $"ProvideCompiledAttributeCompiledVersion START");
try
{
- string attribute = p1.CompiledVersion;
+ var testingTarget = new ProvideCompiledAttribute("testAttribute");
+ Assert.IsNotNull(testingTarget, "null ProvideCompiledAttribute");
+ Assert.IsInstanceOf<ProvideCompiledAttribute>(testingTarget, "Should return ProvideCompiledAttribute instance.");
+
+ string result = testingTarget.CompiledVersion;
+ tlog.Debug(tag, "CompiledVersion : " + result);
+
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"ProvideCompiledAttributeCompiledVersion END (OK)");
- Assert.Pass("ProvideCompiledAttributeCompiledVersion");
+ tlog.Debug(tag, $"ProvideCompiledAttributeCompiledVersion END");
}
}
}
\ No newline at end of file
public class PublicStaticResourceExtensionTest
{
private const string tag = "NUITEST";
- private static StaticResourceExtension resourceExtension;
-
- internal class XmlLineInfoImplent : IXmlLineInfo
- {
- public int LineNumber => 16;
-
- public int LinePosition => 8;
-
- public bool HasLineInfo()
- {
- return true;
- }
- }
-
- internal class ServiceProviderImplemente : IServiceProvider
- {
- private static readonly object service = new object();
-
- public object GetService(Type type)
- {
- return service;
- }
- }
-
+ private StaticResourceExtension staticRes;
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- resourceExtension = new StaticResourceExtension();
+ staticRes = new StaticResourceExtension();
}
[TearDown]
public void Destroy()
{
- resourceExtension = null;
+ staticRes = null;
tlog.Info(tag, "Destroy() is called!");
}
[Property("SPEC", "Tizen.NUI.StaticResourceExtension.Key A")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
public void StaticResourceExtensionKey()
{
tlog.Debug(tag, $"StaticResourceExtensionKey START");
try
{
- var result = resourceExtension.Key;
- tlog.Debug(tag, "Key : " + result);
- resourceExtension.Key = "size";
- tlog.Debug(tag, "Key : " + result);
- }
- catch (Exception e)
- {
- tlog.Debug(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception : Failed!");
- }
- tlog.Debug(tag, $"StaticResourceExtensionKey END (OK)");
- Assert.Pass("StaticResourceExtensionKey");
- }
-
- [Test]
- [Category("P1")]
- [Description("StaticResourceExtension ProvideValue")]
- [Property("SPEC", "Tizen.NUI.StaticResourceExtension.ProvideValue M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- public void StaticResourceExtensionProvideValue()
- {
- tlog.Debug(tag, $"StaticResourceExtensionProvideValue START");
-
- try
- {
- ServiceProviderImplemente ss = new ServiceProviderImplemente();
-
- resourceExtension.Key = "myKey";
- resourceExtension.ProvideValue(ss);
+ string key = staticRes.Key;
+ staticRes.Key = key;
+ Assert.AreEqual(key, staticRes.Key, "Should be equal");
}
catch (Exception e)
{
tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"StaticResourceExtensionProvideValue END (OK)");
- Assert.Pass("Caught Exception : passed!");
- }
- }
-
- [Test]
- [Category("P2")]
- [Description("StaticResourceExtension ProvideValue. Null serviceProvider.")]
- [Property("SPEC", "Tizen.NUI.StaticResourceExtension.ProvideValue M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
- public void StaticResourceExtensionProvideValueWithNullServiceProvder()
- {
- tlog.Debug(tag, $"StaticResourceExtensionProvideValueWithNullServiceProvder START");
- try
- {
- resourceExtension.ProvideValue(null);
- }
- catch (ArgumentNullException e)
- {
- tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"StaticResourceExtensionProvideValueWithNullServiceProvder END (OK)");
- Assert.Pass("Caught ArgumentNullException : passed!");
- }
- }
-
- [Test]
- [Category("P2")]
- [Description("StaticResourceExtension ProvideValue. Null Key.")]
- [Property("SPEC", "Tizen.NUI.StaticResourceExtension.ProvideValue M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
- public void StaticResourceExtensionProvideValueWithNullKey()
- {
- tlog.Debug(tag, $"StaticResourceExtensionProvideValueWithNullKey START");
-
- var serviceProvider = new ServiceProviderImplemente();
- Assert.IsNotNull(serviceProvider, "Can't create success object IServiceProvider");
- Assert.IsInstanceOf<IServiceProvider>(serviceProvider, "Should be an instance of IServiceProvider type.");
-
- resourceExtension.Key = null;
-
- try
- {
- resourceExtension.ProvideValue(serviceProvider);
- }
- catch (XamlParseException e)
- {
- tlog.Debug(tag, $"StaticResourceExtensionProvideValueWithNullKey END (OK)");
- Assert.Pass("Caught XamlParseException : passed!");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("StaticResourceExtension GetApplicationLevelResource")]
- [Property("SPEC", "Tizen.NUI.StaticResourceExtension.GetApplicationLevelResource M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- public void StaticResourceExtensionGetApplicationLevelResource()
- {
- tlog.Debug(tag, $"StaticResourceExtensionGetApplicationLevelResource START");
-
- try
- {
- XmlLineInfoImplent xx = new XmlLineInfoImplent();
- resourceExtension.GetApplicationLevelResource("mykey", xx);
- }
- catch (Exception e)
- {
- tlog.Debug(tag, $"StaticResourceExtensionGetApplicationLevelResource END (OK)");
- Assert.Pass("StaticResource not found for key mykey : Passed!");
+ Assert.Fail("Caught Exception : Failed!");
}
+ tlog.Debug(tag, $"StaticResourceExtensionKey END");
}
}
}
\ No newline at end of file
[TestFixture]
[Description("public/xaml/TypeConversionAttribute")]
- internal class PublicTypeConversionAttributeTest
+ public class PublicTypeConversionAttributeTest
{
private const string tag = "NUITEST";
- private static TypeConversionAttribute t1;
+ private TypeConversionAttribute conversionAttr;
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- Type type = typeof(string);
- TypeConversionAttribute t1 = new TypeConversionAttribute(type);
+ TypeConversionAttribute conversionAttr = new TypeConversionAttribute(typeof(string));
}
[TearDown]
public void Destroy()
{
- t1 = null;
+ conversionAttr = null;
tlog.Info(tag, "Destroy() is called!");
}
-
- [Test]
- [Category("P1")]
- [Description("TypeConversionAttribute TypeConversionAttribute")]
- [Property("SPEC", "Tizen.NUI.TypeConversionAttribute.TypeConversionAttribute C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- public void TypeConversionAttributeConstructor()
- {
- tlog.Debug(tag, $"TypeConversionAttributeConstructor START");
- Type type = typeof(string);
- TypeConversionAttribute t2 = new TypeConversionAttribute(type);
-
- tlog.Debug(tag, $"TypeConversionAttributeConstructor END (OK)");
- Assert.Pass("TypeConversionAttributeConstructor");
- }
-
- [Test]
- [Category("P1")]
- [Description("TypeConversionAttribute TargetType")]
- [Property("SPEC", "Tizen.NUI.TypeConversionAttribute.TargetType A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- public void TypeConversionAttributeTargetType()
- {
- tlog.Debug(tag, $"TypeConversionAttributeTargetType START");
- try
- {
- Type type = t1.TargetType;
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"TypeConversionAttributeTargetType END (OK)");
- Assert.Pass("Caught Exception : passed!");
- }
- }
}
}
\ No newline at end of file
[TestFixture]
[Description("public/xaml/ViewExtensions")]
-
public class PublicViewExtensionsTest
{
private const string tag = "NUITEST";
- private string path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
-
+
[SetUp]
public void Init()
{
public void ExtensionsLoadFromXaml1()
{
tlog.Debug(tag, $"ExtensionsLoadFromXaml START");
- try
- {
- Tizen.NUI.Xaml.Extensions.LoadFromXaml<string>("mystring", typeof(string));
- }
- catch (Exception e)
- {
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
- }
- tlog.Debug(tag, $"ExtensionsLoadFromXaml END (OK)");
- Assert.Pass("ExtensionsLoadFromXaml");
- }
- [Test]
- [Category("P1")]
- [Description("Extensions LoadFromXaml")]
- [Property("SPEC", "Tizen.NUI.Extensions.LoadFromXaml M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("COVPARAM", "string,string")]
- public void ExtensionsLoadFromXaml2()
- {
- tlog.Debug(tag, $"ExtensionsLoadFromXaml START");
try
{
- Tizen.NUI.Xaml.Extensions.LoadFromXaml<string>("mystring", "/home/owner/apps_rw/Tizen.NUI.Devel.Tests/tizen-manifest.xml");
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"ExtensionsLoadFromXaml END (OK)");
- Assert.Pass("Caught Exception : passed!");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("Extensions LoadObject")]
- [Property("SPEC", "Tizen.NUI.Extensions.LoadObject M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- public void ExtensionsLoadObject()
- {
- tlog.Debug(tag, $"ExtensionsLoadObject START");
-
- try
- {
- Tizen.NUI.Xaml.Extensions.LoadObject<string>(path);
-
+ Tizen.NUI.Xaml.Extensions.LoadFromXaml<string>("mystring", typeof(string));
}
catch (Exception e)
{
tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"ExtensionsLoadObject END (OK)");
- Assert.Pass("Caught Exception : passed!");
+ Assert.Fail("Caught Exception : Failed!");
}
- }
-
- [Test]
- [Category("P1")]
- [Description("Extensions LoadFromXamlFile")]
- [Property("SPEC", "Tizen.NUI.Extensions.LoadFromXamlFile M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- public void ExtensionsLoadFromXamlFile()
- {
- tlog.Debug(tag, $"ExtensionsLoadFromXamlFile START");
- try
- {
- Tizen.NUI.Xaml.Extensions.LoadFromXamlFile<string>("myview", "/home/owner/apps_rw/Tizen.NUI.Devel.Tests/tizen-manifest.xml");
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"ExtensionsLoadFromXamlFile END (OK)");
- Assert.Pass("Caught Exception : passed!");
- }
+ tlog.Debug(tag, $"ExtensionsLoadFromXaml END");
}
}
}
\ No newline at end of file
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using System.Collections.Generic;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Xaml")]
+ public class PublicXamlTest
+ {
+ private const string tag = "NUITEST";
+ private string path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "index.xml";
+ private string eXamlString = "<?xml?><?xml-stylesheet?>";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("EXamlExtensions LoadFromXamlPath.")]
+ [Property("SPEC", "Tizen.NUI.XamlExtensions.LoadFromXamlPath M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void EXamlExtensionsLoadFromEXamlPath()
+ {
+ tlog.Debug(tag, $"EXamlExtensionsLoadFromEXamlPath START");
+
+ using (View view = new View())
+ {
+ try
+ {
+ var testcase = new TotalSample();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+ }
+
+ tlog.Debug(tag, $"EXamlExtensionsLoadFromEXamlPath END (OK)");
+ }
+ }
+}
[TestFixture]
[Description("public/xaml/XamlCompilationAttribute")]
- internal class PublicXamlCompilationAttributeTest
+ public class PublicXamlCompilationAttributeTest
{
private const string tag = "NUITEST";
- private static XamlCompilationAttribute x1;
+ private XamlCompilationAttribute compilationAttr;
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- XamlCompilationOptions xamlCompilationOptions = new XamlCompilationOptions();
-
- x1 = new XamlCompilationAttribute(xamlCompilationOptions);
+ compilationAttr = new XamlCompilationAttribute(new XamlCompilationOptions());
}
[TearDown]
public void Destroy()
{
- x1 = null;
+ compilationAttr = null;
tlog.Info(tag, "Destroy() is called!");
}
XamlCompilationOptions xamlCompilationOptions = new XamlCompilationOptions();
- XamlCompilationAttribute x2 = new XamlCompilationAttribute(xamlCompilationOptions);
+ var testingTarget = new XamlCompilationAttribute(xamlCompilationOptions);
+ Assert.IsNotNull(testingTarget, "null XamlCompilationAttribute");
+ Assert.IsInstanceOf<XamlCompilationAttribute>(testingTarget, "Should return XamlCompilationAttribute instance.");
- x2 = null;
+ testingTarget = null;
tlog.Debug(tag, $"XamlCompilationAttributeConstructor END (OK)");
- Assert.Pass("XamlCompilationAttributeConstructor");
}
[Test]
public void XamlCompilationAttributeXamlCompilationOptions()
{
tlog.Debug(tag, $"XamlCompilationAttributeXamlCompilationOptions START");
+
try
{
- XamlCompilationOptions option = x1.XamlCompilationOptions;
- x1.XamlCompilationOptions = option;
+ XamlCompilationOptions option = compilationAttr.XamlCompilationOptions;
+ compilationAttr.XamlCompilationOptions = option;
+ Assert.AreEqual(option, compilationAttr.XamlCompilationOptions, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlCompilationAttributeXamlCompilationOptions END (OK)");
- Assert.Pass("XamlCompilationAttributeXamlCompilationOptions");
+
+ tlog.Debug(tag, $"XamlCompilationAttributeXamlCompilationOptions END");
}
[Test]
public void XamlCompilationAttributeIsCompiled()
{
tlog.Debug(tag, $"XamlCExtensionsIsCompiled START");
+
try
{
Tizen.NUI.Xaml.XamlCExtensions.IsCompiled(typeof(string));
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlCExtensionsIsCompiled END (OK)");
- Assert.Pass("XamlCExtensionsIsCompiled");
+
+ tlog.Debug(tag, $"XamlCExtensionsIsCompiled END");
}
}
}
\ No newline at end of file
{
tlog.Debug(tag, $"XamlFilePathAttributeConstructor START");
- XamlFilePathAttribute x1 = new XamlFilePathAttribute("myPath");
+ var testingTarget = new XamlFilePathAttribute("myPath");
+ Assert.IsNotNull(testingTarget, "null XamlFilePathAttribute");
+ Assert.IsInstanceOf<XamlFilePathAttribute>(testingTarget, "Should return XamlFilePathAttribute instance.");
- tlog.Debug(tag, $"XamlFilePathAttributeConstructor END (OK)");
- Assert.Pass("XamlFilePathAttributeConstructor");
+ testingTarget = null;
+ tlog.Debug(tag, $"XamlFilePathAttributeConstructor END");
}
}
}
\ No newline at end of file
[TestFixture]
[Description("public/xaml/XamlParseException ")]
- internal class PublicXamlParseExceptionTest
+ public class PublicXamlParseExceptionTest
{
private const string tag = "NUITEST";
- private XamlParseException xamlParseException;
+ private XamlParseException xamlParse;
+
+ internal class XmlLineInfoImpl : IXmlLineInfo
+ {
+ public int LineNumber => 0;
+ public int LinePosition => 0;
+ public bool HasLineInfo() => false;
+ }
+
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- xamlParseException = new XamlParseException("Parse Exception!");
+ xamlParse = new XamlParseException("myMessage");
}
[TearDown]
public void Destroy()
{
- xamlParseException = null;
+ xamlParse = null;
tlog.Info(tag, "Destroy() is called!");
}
- internal class XmlLineInfoImplement : IXmlLineInfo
- {
- public int LineNumber => 0;
-
- public int LinePosition => 0;
-
- public bool HasLineInfo() => false;
- }
-
[Test]
[Category("P1")]
[Description("XamlParseException XamlParseException")]
[Property("SPEC", "Tizen.NUI.XamlParseException.XamlParseException C")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
public void XamlParseExceptionConstructor()
{
tlog.Debug(tag, $"XamlParseExceptionConstructor START");
var testingTarget = new XamlParseException();
- Assert.IsNotNull(testingTarget, "should be not null");
- Assert.IsInstanceOf<XamlParseException>(testingTarget, "should be an instance of XamlParseException class!");
-
- tlog.Debug(tag, $"XamlParseExceptionConstructor END (OK)");
+ Assert.IsNotNull(testingTarget, "null XamlParseException");
+ Assert.IsInstanceOf<XamlParseException>(testingTarget, "Should return XamlParseException instance.");
+
+ testingTarget = null;
+ tlog.Debug(tag, $"XamlParseExceptionConstructor END");
}
[Test]
[Category("P1")]
- [Description("XamlParseException constructor. With message.")]
+ [Description("XamlParseException XamlParseException")]
[Property("SPEC", "Tizen.NUI.XamlParseException.XamlParseException C")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
public void XamlParseExceptionConstructorWithMessage()
{
tlog.Debug(tag, $"XamlParseExceptionConstructorWithMessage START");
- var testingTarget = new XamlParseException("Xaml Parsed Failed!");
- Assert.IsNotNull(testingTarget, "should be not null");
- Assert.IsInstanceOf<XamlParseException>(testingTarget, "should be an instance of XamlParseException class!");
-
- tlog.Debug(tag, $"XamlParseExceptionConstructorWithMessage END (OK)");
- }
-
- [Test]
- [Category("P1")]
- [Description("XamlParseException constructor. With innerException.")]
- [Property("SPEC", "Tizen.NUI.XamlParseException.XamlParseException C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
- public void XamlParseExceptionConstructorWithInnerException()
- {
- tlog.Debug(tag, $"XamlParseExceptionConstructorWithInnerException START");
-
var testingTarget = new XamlParseException("myMessage", new Exception());
- Assert.IsNotNull(testingTarget, "should be not null");
- Assert.IsInstanceOf<XamlParseException>(testingTarget, "should be an instance of XamlParseException class!");
-
- tlog.Debug(tag, $"XamlParseExceptionConstructorWithInnerException END (OK)");
- }
-
- [Test]
- [Category("P1")]
- [Description("XamlParseException constructor. With IXmlLineInfo.")]
- [Property("SPEC", "Tizen.NUI.XamlParseException.XamlParseException C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
- public void XamlParseExceptionConstructorWithIXmlLineInfo()
- {
- tlog.Debug(tag, $"XamlParseExceptionConstructorWithIXmlLineInfo START");
-
- var testingTarget = new XamlParseException("Xaml Parsed Failed!", new XmlLineInfoImplement(), new Exception());
- Assert.IsNotNull(testingTarget, "should be not null");
- Assert.IsInstanceOf<XamlParseException>(testingTarget, "should be an instance of XamlParseException class!");
+ Assert.IsNotNull(testingTarget, "null XamlParseException");
+ Assert.IsInstanceOf<XamlParseException>(testingTarget, "Should return XamlParseException instance.");
- tlog.Debug(tag, $"XamlParseExceptionConstructorWithIXmlLineInfo END (OK)");
+ testingTarget = null;
+ tlog.Debug(tag, $"XamlParseExceptionConstructorWithMessage END");
}
[Test]
[Property("SPEC", "Tizen.NUI.XamlParseException.XmlInfo A")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
public void XamlParseExceptionXmlInfo()
{
tlog.Debug(tag, $"XamlParseExceptionXmlInfo START");
try
{
- var result = xamlParseException.XmlInfo;
- tlog.Debug(tag, "XmlInfo :" + result);
+ var result = (XmlLineInfoImpl)xamlParse.XmlInfo;
+ tlog.Debug(tag, "XmlInfo : " + result);
}
catch (Exception e)
{
tlog.Debug(tag, e.Message.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlParseExceptionXmlInfo END (OK)");
+ tlog.Debug(tag, $"XamlParseExceptionXmlInfo END");
}
[Test]
[Property("SPEC", "Tizen.NUI.XamlParseException.UnformattedMessage A")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
public void XamlParseExceptionUnformattedMessage()
{
tlog.Debug(tag, $"XamlParseExceptionUnformattedMessage START");
-
+
try
{
- var result = xamlParseException.UnformattedMessage;
- tlog.Debug(tag, "UnformattedMessage :" + result);
+ var result = xamlParse.UnformattedMessage;
+ tlog.Debug(tag, "UnformattedMessage : " + result);
}
catch (Exception e)
{
Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlParseExceptionUnformattedMessage END (OK)");
+ tlog.Debug(tag, $"XamlParseExceptionUnformattedMessage END");
}
}
}
\ No newline at end of file
public class PublicXamlResourceIdAttributeTest
{
private const string tag = "NUITEST";
- private static XamlResourceIdAttribute resourceIdAttribute;
-
- internal class AssemblyImplent : Assembly
- {
- public override object[] GetCustomAttributes(bool inherit)
- {
- return null;
- }
- }
-
+ private XamlResourceIdAttribute resourceId;
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- resourceIdAttribute = new XamlResourceIdAttribute("myId", "myPath", typeof(string));
+ resourceId = new XamlResourceIdAttribute("myId", "myPath", typeof(string));
}
[TearDown]
public void Destroy()
{
- resourceIdAttribute = null;
+ resourceId = null;
tlog.Info(tag, "Destroy() is called!");
}
[Test]
[Category("P1")]
- [Description("XamlResourceIdAttribute XamlResourceIdAttribute")]
- [Property("SPEC", "Tizen.NUI.XamlResourceIdAttribute.XamlResourceIdAttribute C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- public void XamlResourceIdAttributeConstructor()
- {
- tlog.Debug(tag, $"XamlResourceIdAttributeConstructor START");
-
- XamlResourceIdAttribute x1 = new XamlResourceIdAttribute("myId", "myPath", typeof(string));
-
- tlog.Debug(tag, $"XamlResourceIdAttributeConstructor END (OK)");
- Assert.Pass("XamlResourceIdAttributeConstructor");
- }
-
- [Test]
- [Category("P1")]
[Description("XamlResourceIdAttribute ResourceId")]
[Property("SPEC", "Tizen.NUI.XamlResourceIdAttribute.ResourceId A")]
[Property("SPEC_URL", "-")]
try
{
- string s1 = resourceIdAttribute.ResourceId;
- resourceIdAttribute.ResourceId = s1;
+ var id = resourceId.ResourceId;
+ resourceId.ResourceId = id;
+ Assert.AreEqual(id, resourceId.ResourceId, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlResourceIdAttributeResourceId END (OK)");
- Assert.Pass("XamlResourceIdAttributeResourceId");
+ tlog.Debug(tag, $"XamlResourceIdAttributeResourceId END");
}
[Test]
try
{
- string s1 = resourceIdAttribute.Path;
- resourceIdAttribute.Path = s1;
+ var path = resourceId.Path;
+ resourceId.Path = path;
+ Assert.AreEqual(path, resourceId.Path, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlResourceIdAttributePath END (OK)");
- Assert.Pass("XamlResourceIdAttributePath");
+ tlog.Debug(tag, $"XamlResourceIdAttributePath END");
}
[Test]
try
{
- Type t1 = resourceIdAttribute.Type;
- resourceIdAttribute.Type = t1;
+ var type = resourceId.Type;
+ resourceId.Type = type;
+ Assert.AreEqual(type, resourceId.Type, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlResourceIdAttributeType END (OK)");
+ tlog.Debug(tag, $"XamlResourceIdAttributeType END");
Assert.Pass("XamlResourceIdAttributeType");
}
Assert.Fail("Caught Exception" + e.ToString());
}
- tlog.Debug(tag, $"XamlResourceIdAttributeGetResourceIdForType END (OK)");
- Assert.Pass("XamlResourceIdAttributeGetResourceIdForType");
+ tlog.Debug(tag, $"XamlResourceIdAttributeGetResourceIdForType END");
}
[Test]
Assert.Fail("Caught Exception" + e.ToString());
}
- tlog.Debug(tag, $"XamlResourceIdAttributeGetPathForType END (OK)");
- Assert.Pass("XamlResourceIdAttributeGetPathForType");
- }
-
- [Test]
- [Category("P1")]
- [Description("XamlResourceIdAttribute GetTypeForResourceId")]
- [Property("SPEC", "Tizen.NUI.XamlResourceIdAttribute.GetTypeForResourceId M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- public void XamlResourceIdAttributeGetTypeForResourceId()
- {
- tlog.Debug(tag, $"XamlResourceIdAttributeGetTypeForResourceId START");
-
- try
- {
- AssemblyImplent assembly = new AssemblyImplent();
- XamlResourceIdAttribute.GetTypeForResourceId(assembly, "myResourceId");
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"XamlResourceIdAttributeGetTypeForResourceId END (OK)");
- Assert.Pass("Caught Exception : passed!");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("XamlResourceIdAttribute GetResourceIdForPath")]
- [Property("SPEC", "Tizen.NUI.XamlResourceIdAttribute.GetResourceIdForPath M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- public void XamlResourceIdAttributeGetResourceIdForPath()
- {
- tlog.Debug(tag, $"XamlResourceIdAttributeGetResourceIdForPath START");
-
- try
- {
- AssemblyImplent assembly = new AssemblyImplent();
- XamlResourceIdAttribute.GetResourceIdForPath(assembly, "myPath");
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"XamlResourceIdAttributeGetResourceIdForPath END (OK)");
- Assert.Pass("Caught Exception : passed!");
- }
- }
-
- [Test]
- [Category("P1")]
- [Description("XamlResourceIdAttribute GetTypeForPath")]
- [Property("SPEC", "Tizen.NUI.XamlResourceIdAttribute.GetTypeForPath M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- public void XamlResourceIdAttributeGetTypeForPath()
- {
- tlog.Debug(tag, $"XamlResourceIdAttributeGetTypeForPath START");
-
- try
- {
- AssemblyImplent assembly = new AssemblyImplent();
- XamlResourceIdAttribute.GetTypeForPath(assembly, "myPath");
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- tlog.Debug(tag, $"XamlResourceIdAttributeGetTypeForPath END (OK)");
- Assert.Pass("Caught Exception : passed!");
- }
+ tlog.Debug(tag, $"XamlResourceIdAttributeGetPathForType END");
}
}
}
\ No newline at end of file
[TestFixture]
[Description("public/xaml/XamlServiceProvider ")]
- internal class PublicXamlServiceProviderTest
+ public class PublicXamlServiceProviderTest
{
private const string tag = "NUITEST";
- public XamlServiceProvider x1;
- [SetUp]
- public void Init()
- {
- tlog.Info(tag, "Init() is called!");
- x1 = new XamlServiceProvider();
- }
-
- [TearDown]
- public void Destroy()
- {
- x1 = null;
- tlog.Info(tag, "Destroy() is called!");
- }
+ private XamlServiceProvider provider;
- internal class INodeImplement : INode
+ internal class INodeImpl : INode
{
public List<string> IgnorablePrefixes { get; set; }
- public IXmlNamespaceResolver NamespaceResolver => new XmlNamespaceResolver();
+ public IXmlNamespaceResolver NamespaceResolver { get; }
public INode Parent { get; set; }
public void Accept(IXamlNodeVisitor visitor, INode parentNode) { }
- public INode Clone()
- {
- return null;
- }
+ public INode Clone() { return null; }
}
- [Test]
- [Category("P1")]
- [Description("XamlServiceProvider XamlServiceProvider")]
- [Property("SPEC", "Tizen.NUI.XamlServiceProvider.XamlServiceProvider C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
- public void XamlServiceProviderConstructor()
+ [SetUp]
+ public void Init()
{
- tlog.Debug(tag, $"XamlServiceProviderConstructor START");
-
- var testingTarget = new XamlServiceProvider();
- Assert.IsNotNull(testingTarget, "should be not null");
- Assert.IsInstanceOf<XamlServiceProvider>(testingTarget, "should be an instance of XamlServiceProvider class!");
-
- tlog.Debug(tag, $"XamlServiceProviderConstructor END (OK)");
+ tlog.Info(tag, "Init() is called!");
+ provider = new XamlServiceProvider();
}
- [Test]
- [Category("P1")]
- [Description("XamlServiceProvider XamlServiceProvider. With parameters.")]
- [Property("SPEC", "Tizen.NUI.XamlServiceProvider.XamlServiceProvider C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
- public void XamlServiceProviderConstructorWithParameters()
+ [TearDown]
+ public void Destroy()
{
- tlog.Debug(tag, $"XamlServiceProviderConstructorWithParameters START");
-
- HydrationContext hydrationContext = new HydrationContext();
- INodeImplement nodeImplement = new INodeImplement();
-
- try
- {
- var testingTarget = new XamlServiceProvider(nodeImplement, hydrationContext);
- Assert.IsNotNull(testingTarget, "should be not null");
- Assert.IsInstanceOf<XamlServiceProvider>(testingTarget, "should be an instance of XamlServiceProvider class!");
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- Assert.Fail("Caught Exception : Failed!");
- }
-
- tlog.Debug(tag, $"XamlServiceProviderConstructorWithParameters END (OK)");
+ provider = null;
+ tlog.Info(tag, "Destroy() is called!");
}
[Test]
try
{
- IProvideValueTarget i1 = x1.IProvideValueTarget;
- x1.IProvideValueTarget = i1;
+ IProvideValueTarget i1 = provider.IProvideValueTarget;
+ provider.IProvideValueTarget = i1;
+ Assert.AreEqual(i1, provider.IProvideValueTarget, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlServiceProviderIProvideValueTarget END (OK)");
- Assert.Pass("XamlServiceProviderIProvideValueTarget");
+ tlog.Debug(tag, $"XamlServiceProviderIProvideValueTarget END");
}
[Test]
try
{
- IXamlTypeResolver i1 = x1.IXamlTypeResolver;
- x1.IXamlTypeResolver = i1;
+ var value = provider.IXamlTypeResolver;
+ provider.IXamlTypeResolver = value;
+ Assert.AreEqual(value, provider.IXamlTypeResolver, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlServiceProviderIXamlTypeResolver END (OK)");
- Assert.Pass("XamlServiceProviderIXamlTypeResolver");
+ tlog.Debug(tag, $"XamlServiceProviderIXamlTypeResolver END");
}
[Test]
try
{
- IRootObjectProvider i1 = x1.IRootObjectProvider;
- x1.IRootObjectProvider = i1;
+ var value = provider.IRootObjectProvider;
+ provider.IRootObjectProvider = value;
+ Assert.AreEqual(value, provider.IRootObjectProvider, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlServiceProviderIRootObjectProvider END (OK)");
- Assert.Pass("XamlServiceProviderIRootObjectProvider");
+ tlog.Debug(tag, $"XamlServiceProviderIRootObjectProvider END");
}
[Test]
try
{
- IXmlLineInfoProvider i1 = x1.IXmlLineInfoProvider;
- x1.IXmlLineInfoProvider = i1;
+ var value = provider.IXmlLineInfoProvider;
+ provider.IXmlLineInfoProvider = value;
+ Assert.AreEqual(value, provider.IXmlLineInfoProvider, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlServiceProviderIXmlLineInfoProvider END (OK)");
- Assert.Pass("XamlServiceProviderIXmlLineInfoProvider");
+ tlog.Debug(tag, $"XamlServiceProviderIXmlLineInfoProvider END");
}
[Test]
try
{
- INameScopeProvider i1 = x1.INameScopeProvider;
- x1.INameScopeProvider = i1;
+ var value = provider.INameScopeProvider;
+ provider.INameScopeProvider = value;
+ Assert.AreEqual(value, provider.INameScopeProvider, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlServiceProviderINameScopeProvider END (OK)");
- Assert.Pass("XamlServiceProviderINameScopeProvider");
+ tlog.Debug(tag, $"XamlServiceProviderINameScopeProvider END");
}
[Test]
try
{
- IValueConverterProvider i1 = x1.IValueConverterProvider;
- x1.IValueConverterProvider = i1;
+ var value = provider.IValueConverterProvider;
+ provider.IValueConverterProvider = value;
+ Assert.AreEqual(value, provider.IValueConverterProvider, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlServiceProviderIValueConverterProvider END (OK)");
- Assert.Pass("XamlServiceProviderIValueConverterProvider");
+ tlog.Debug(tag, $"XamlServiceProviderIValueConverterProvider END");
}
[Test]
try
{
- x1.GetService(typeof(string));
+ provider.GetService(typeof(string));
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlServiceProviderGetService END (OK)");
- Assert.Pass("XamlServiceProviderGetService");
+ tlog.Debug(tag, $"XamlServiceProviderGetService END");
}
[Test]
try
{
- object o1 = new object();
- x1.Add(typeof(string), o1);
+ provider.Add(typeof(string), new object());
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlServiceProviderAdd END (OK)");
- Assert.Pass("XamlServiceProviderAdd");
+ tlog.Debug(tag, $"XamlServiceProviderAdd END");
}
[Test]
try
{
object o1 = new object();
- INodeImplement node = new INodeImplement();
+ INodeImpl node = new INodeImpl();
HydrationContext hydrationContext = new HydrationContext();
object o2 = new object();
- XamlValueTargetProvider xamlValueTargetProvider = new XamlValueTargetProvider(o1, node, hydrationContext, o2);
-
+ var testingTarget = new XamlValueTargetProvider(o1, node, hydrationContext, o2);
+ Assert.IsNotNull(testingTarget, "null XamlValueTargetProvider");
+ Assert.IsInstanceOf<XamlValueTargetProvider>(testingTarget, "Should return XamlValueTargetProvider instance.");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlServiceProviderXamlValueTargetProvider END (OK)");
- Assert.Pass("XamlServiceProviderXamlValueTargetProvider");
+ tlog.Debug(tag, $"XamlServiceProviderXamlValueTargetProvider END");
}
[Test]
try
{
object o1 = new object();
- INodeImplement node = new INodeImplement();
+ INodeImpl node = new INodeImpl();
HydrationContext hydrationContext = new HydrationContext();
object o2 = new object();
- XamlValueTargetProvider xamlValueTargetProvider = new XamlValueTargetProvider(o1, node, hydrationContext, o2);
- object object1 = xamlValueTargetProvider.TargetObject;
+ var testingTarget = new XamlValueTargetProvider(o1, node, hydrationContext, o2);
+ Assert.IsNotNull(testingTarget, "null XamlValueTargetProvider");
+ Assert.IsInstanceOf<XamlValueTargetProvider>(testingTarget, "Should return XamlValueTargetProvider instance.");
+
+ object object1 = testingTarget.TargetObject;
+ Assert.AreEqual(o1, object1, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlServiceProviderTargetObject END (OK)");
- Assert.Pass("XamlServiceProviderTargetObject");
+ tlog.Debug(tag, $"XamlServiceProviderTargetObject END");
}
[Test]
try
{
object o1 = new object();
- INodeImplement node = new INodeImplement();
+ INodeImpl node = new INodeImpl();
HydrationContext hydrationContext = new HydrationContext();
object o2 = new object();
- XamlValueTargetProvider xamlValueTargetProvider = new XamlValueTargetProvider(o1, node, hydrationContext, o2);
- object object1 = xamlValueTargetProvider.TargetProperty;
- xamlValueTargetProvider.TargetProperty = object1;
+ var testingTarget = new XamlValueTargetProvider(o1, node, hydrationContext, o2);
+ Assert.IsNotNull(testingTarget, "null XamlValueTargetProvider");
+ Assert.IsInstanceOf<XamlValueTargetProvider>(testingTarget, "Should return XamlValueTargetProvider instance.");
+
+ object object1 = testingTarget.TargetProperty;
+ testingTarget.TargetProperty = object1;
+ Assert.AreEqual(object1, testingTarget.TargetProperty, "Should be equal");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlServiceProviderTargetProperty END (OK)");
- Assert.Pass("XamlServiceProviderTargetProperty");
+ tlog.Debug(tag, $"XamlServiceProviderTargetProperty END");
}
[Test]
[Property("SPEC", "Tizen.NUI.XamlServiceProvider.SimpleValueTargetProvider M")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "MR")]
- [Obsolete]
public void XamlServiceProviderSimpleValueTargetProvider1()
{
tlog.Debug(tag, $"XamlServiceProviderTargetProperty START");
object o11 = new object();
object o12 = new object();
object[] o1 = { o11, o12, };
- SimpleValueTargetProvider simpleValueTargetProvider1 = new SimpleValueTargetProvider(o1);
+
+ var testingTarget = new SimpleValueTargetProvider(o1);
+ Assert.IsNotNull(testingTarget, "null SimpleValueTargetProvider");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlServiceProviderTargetProperty END (OK)");
- Assert.Pass("XamlServiceProviderTargetProperty");
+ tlog.Debug(tag, $"XamlServiceProviderTargetProperty END");
}
[Test]
object[] o1 = { o11, o12, };
object targetObject = new object();
- SimpleValueTargetProvider simpleValueTargetProvider2 = new SimpleValueTargetProvider(o1, targetObject);
+ var testingTarget = new SimpleValueTargetProvider(o1, targetObject);
+ Assert.IsNotNull(testingTarget, "null SimpleValueTargetProvider");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlServiceProviderTargetProperty END (OK)");
- Assert.Pass("XamlServiceProviderTargetProperty");
+ tlog.Debug(tag, $"XamlServiceProviderTargetProperty END");
}
[Test]
object[] o1 = { o11, o12, };
object targetObject = new object();
- SimpleValueTargetProvider simpleValueTargetProvider = new SimpleValueTargetProvider(o1, targetObject);
- simpleValueTargetProvider.FindByName("mystring");
+ var testingTarget = new SimpleValueTargetProvider(o1, targetObject);
+ testingTarget.FindByName("mystring");
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XamlServiceProviderFindByName END (OK)");
- Assert.Pass("XamlServiceProviderFindByName");
+ tlog.Debug(tag, $"XamlServiceProviderFindByName END");
}
-
- //public class IXmlNamespaceResolverImplement : IXmlNamespaceResolver
- //{
- // public IDictionary<string, string> GetNamespacesInScope(XmlNamespaceScope scope)
- // {
- // return null;
- // }
-
- // public string LookupNamespace(string prefix)
- // {
- // return "mySpace";
- // }
-
- // public string LookupPrefix(string namespaceName)
- // {
- // return "myPrefix";
- // }
- //}
-
- //public class AssemblyImplement : Assembly
- //{
-
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("XamlServiceProvider XamlTypeResolver")]
- //[Property("SPEC", "Tizen.NUI.XamlServiceProvider.XamlTypeResolver M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void XamlServiceProviderXamlTypeResolver()
- //{
- // tlog.Debug(tag, $"XamlServiceProviderXamlTypeResolver START");
-
- // try
- // {
- // IXmlNamespaceResolverImplement xmlNamespaceResolverImplement = new IXmlNamespaceResolverImplement();
- // AssemblyImplement currentAssembly = new AssemblyImplement();
- // XamlTypeResolver xamlTypeResolver = new XamlTypeResolver(xmlNamespaceResolverImplement, currentAssembly);
-
- // }
- // catch (Exception e)
- // {
- // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- // Assert.Fail("Caught Exception" + e.ToString());
- // }
-
- // tlog.Debug(tag, $"XamlServiceProviderXamlTypeResolver END (OK)");
- // Assert.Pass("XamlServiceProviderXamlTypeResolver");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("XamlServiceProvider RootObject")]
- //[Property("SPEC", "Tizen.NUI.XamlServiceProvider.RootObject A")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "PRW")]
- //public void XamlServiceProviderRootObject()
- //{
- // tlog.Debug(tag, $"XamlServiceProviderRootObject START");
-
- // try
- // {
- // object o1 = new object();
- // XamlRootObjectProvider x1 = new XamlRootObjectProvider(o1);
- // object o2 = x1.RootObject;
- // }
- // catch (Exception e)
- // {
- // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- // Assert.Fail("Caught Exception" + e.ToString());
- // }
-
- // tlog.Debug(tag, $"XamlServiceProviderRootObject END (OK)");
- // Assert.Pass("XamlServiceProviderRootObject");
- //}
-
- //public class IXmlLineInfoImplement : IXmlLineInfo
- //{
- // public int LineNumber
- // {
- // get => 1;
- // set { }
- // }
-
-
- // public int LinePosition => throw new NotImplementedException();
-
- // public bool HasLineInfo()
- // {
- // return true;
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("XamlServiceProvider XmlLineInfoProvider")]
- //[Property("SPEC", "Tizen.NUI.XamlServiceProvider.XmlLineInfoProvider M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void XamlServiceProviderXmlLineInfoProvider()
- //{
- // tlog.Debug(tag, $"XamlServiceProviderXmlLineInfoProvider START");
-
- // try
- // {
- // IXmlLineInfoImplement xmlLineInfo = new IXmlLineInfoImplement();
- // XmlLineInfoProvider x1 = new XmlLineInfoProvider(xmlLineInfo);
- // }
- // catch (Exception e)
- // {
- // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- // Assert.Fail("Caught Exception" + e.ToString());
- // }
-
- // tlog.Debug(tag, $"XamlServiceProviderXmlLineInfoProvider END (OK)");
- // Assert.Pass("XamlServiceProviderXmlLineInfoProvider");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("XamlServiceProvider XmlLineInfo")]
- //[Property("SPEC", "Tizen.NUI.XamlServiceProvider.XmlLineInfo A")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "PRW")]
- //public void XamlServiceProviderXmlLineInfo()
- //{
- // tlog.Debug(tag, $"XamlServiceProviderXmlLineInfo START");
-
- // try
- // {
- // IXmlLineInfoImplement xmlLineInfo = new IXmlLineInfoImplement();
- // XmlLineInfoProvider x1 = new XmlLineInfoProvider(xmlLineInfo);
-
- // IXmlLineInfo i1 = x1.XmlLineInfo;
- // }
- // catch (Exception e)
- // {
- // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- // Assert.Fail("Caught Exception" + e.ToString());
- // }
-
- // tlog.Debug(tag, $"XamlServiceProviderXmlLineInfo END (OK)");
- // Assert.Pass("XamlServiceProviderXmlLineInfo");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("XamlServiceProvider ReferenceProvider")]
- //[Property("SPEC", "Tizen.NUI.XamlServiceProvider.ReferenceProvider A")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "PRW")]
- //public void XamlServiceProviderReferenceProvider()
- //{
- // tlog.Debug(tag, $"XamlServiceProviderReferenceProvider START");
-
- // try
- // {
- // INodeImplement i1 = new INodeImplement();
- // ReferenceProvider referenceProvider = new ReferenceProvider(i1);
- // }
- // catch (Exception e)
- // {
- // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- // Assert.Fail("Caught Exception" + e.ToString());
- // }
-
- // tlog.Debug(tag, $"XamlServiceProviderReferenceProvider END (OK)");
- // Assert.Pass("XamlServiceProviderReferenceProvider");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("XamlServiceProvider FindByName")]
- //[Property("SPEC", "Tizen.NUI.XamlServiceProvider.FindByName M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void XamlServiceProviderReferenceProviderFindByName()
- //{
- // tlog.Debug(tag, $"XamlServiceProviderReferenceProviderFindByName START");
-
- // try
- // {
- // INodeImplement i1 = new INodeImplement();
- // ReferenceProvider referenceProvider = new ReferenceProvider(i1);
- // referenceProvider.FindByName("myName");
- // }
- // catch (Exception e)
- // {
- // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- // Assert.Fail("Caught Exception" + e.ToString());
- // }
-
- // tlog.Debug(tag, $"XamlServiceProviderReferenceProviderFindByName END (OK)");
- // Assert.Pass("XamlServiceProviderReferenceProviderFindByName");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("XamlServiceProvider NameScope")]
- //[Property("SPEC", "Tizen.NUI.XamlServiceProvider.NameScope A")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "PRW")]
- //public void XamlServiceProviderNameScope()
- //{
- // tlog.Debug(tag, $"XamlServiceProviderNameScope START");
-
- // try
- // {
- // NameScopeProvider n1 = new NameScopeProvider();
- // INameScope i1 = n1.NameScope;
- // n1.NameScope = i1;
- // }
- // catch (Exception e)
- // {
- // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- // Assert.Fail("Caught Exception" + e.ToString());
- // }
-
- // tlog.Debug(tag, $"XamlServiceProviderNameScope END (OK)");
- // Assert.Pass("XamlServiceProviderNameScope");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("XamlServiceProvider GetNamespacesInScope")]
- //[Property("SPEC", "Tizen.NUI.XamlServiceProvider.GetNamespacesInScope M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void XamlServiceProviderGetNamespacesInScope()
- //{
- // tlog.Debug(tag, $"XamlServiceProviderGetNamespacesInScope START");
-
- // try
- // {
- // XmlNamespaceResolver xmlNamespaceResolver = new XmlNamespaceResolver();
- // XmlNamespaceScope xmlNamespaceScope = new XmlNamespaceScope();
- // xmlNamespaceResolver.GetNamespacesInScope(xmlNamespaceScope);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"XamlServiceProviderGetNamespacesInScope END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("XamlServiceProvider LookupNamespace")]
- //[Property("SPEC", "Tizen.NUI.XamlServiceProvider.LookupNamespace M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void XamlServiceProviderLookupNamespace()
- //{
- // tlog.Debug(tag, $"XamlServiceProviderLookupNamespace START");
-
- // try
- // {
- // XmlNamespaceResolver xmlNamespaceResolver = new XmlNamespaceResolver();
- // xmlNamespaceResolver.LookupNamespace("myPrefix");
- // }
- // catch (Exception e)
- // {
- // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- // Assert.Fail("Caught Exception" + e.ToString());
- // }
-
- // tlog.Debug(tag, $"XamlServiceProviderLookupNamespace END (OK)");
- // Assert.Pass("XamlServiceProviderLookupNamespace");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("XamlServiceProvider LookupPrefix")]
- //[Property("SPEC", "Tizen.NUI.XamlServiceProvider.LookupPrefix M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void XamlServiceProviderLookupPrefix()
- //{
- // tlog.Debug(tag, $"XamlServiceProviderLookupPrefix START");
-
- // try
- // {
- // XmlNamespaceResolver xmlNamespaceResolver = new XmlNamespaceResolver();
- // xmlNamespaceResolver.LookupPrefix("mynameSpaceName");
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // tlog.Debug(tag, $"XamlServiceProviderLookupPrefix END (OK)");
- // Assert.Pass("Caught Exception : passed!");
- // }
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("XamlServiceProvider Add")]
- //[Property("SPEC", "Tizen.NUI.XamlServiceProvider.Add M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //public void XamlServiceProviderXmlNamespaceResolverAdd()
- //{
- // tlog.Debug(tag, $"XamlServiceProviderXmlNamespaceResolverAdd START");
-
- // try
- // {
- // XmlNamespaceResolver xmlNamespaceResolver = new XmlNamespaceResolver();
- // xmlNamespaceResolver.Add("myPrefix", "myNs");
- // }
- // catch (Exception e)
- // {
- // Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- // Assert.Fail("Caught Exception" + e.ToString());
- // }
-
- // tlog.Debug(tag, $"XamlServiceProviderXmlNamespaceResolverAdd END (OK)");
- // Assert.Pass("XamlServiceProviderXmlNamespaceResolverAdd");
- //}
}
}
\ No newline at end of file
public class PublicXmlLineInfoTest
{
private const string tag = "NUITEST";
- private XmlLineInfo xamlInfo;
-
+ private XmlLineInfo lineInfo;
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- xamlInfo = new XmlLineInfo();
+ lineInfo = new XmlLineInfo();
}
[TearDown]
public void Destroy()
{
- xamlInfo = null;
+ lineInfo = null;
tlog.Info(tag, "Destroy() is called!");
}
[Property("SPEC", "Tizen.NUI.XmlLineInfo.XmlLineInfo C")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "CONSTR")]
- public void XmlLineInfoConstructor1()
- {
- tlog.Debug(tag, $"XmlLineInfoConstructor START");
-
- XmlLineInfo xmlLineInfo1 = new XmlLineInfo();
-
- tlog.Debug(tag, $"XmlLineInfoConstructor END (OK)");
- Assert.Pass("XmlLineInfoConstructor");
- }
-
- [Test]
- [Category("P1")]
- [Description("XmlLineInfo XmlLineInfo")]
- [Property("SPEC", "Tizen.NUI.XmlLineInfo.XmlLineInfo C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- public void XmlLineInfoConstructor2()
+ public void XmlLineInfoConstructor()
{
tlog.Debug(tag, $"XmlLineInfoConstructor START");
- XmlLineInfo xmlLineInfo2 = new XmlLineInfo(10, 5);
+ var testingTarget = new XmlLineInfo(10, 5);
+ Assert.IsNotNull(testingTarget, "null XmlLineInfo");
+ Assert.IsInstanceOf<XmlLineInfo>(testingTarget, "Should return XmlLineInfo instance.");
- tlog.Debug(tag, $"XmlLineInfoConstructor END (OK)");
- Assert.Pass("XmlLineInfoConstructor");
+ tlog.Debug(tag, $"XmlLineInfoConstructor END");
}
[Test]
try
{
- xamlInfo.HasLineInfo();
+ var result = lineInfo.HasLineInfo();
+ tlog.Debug(tag, "HasLineInfo : " + result);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XmlLineInfoHasLineInfo END (OK)");
- Assert.Pass("XmlLineInfoHasLineInfo");
+ tlog.Debug(tag, $"XmlLineInfoHasLineInfo END");
}
[Test]
try
{
- int i = xamlInfo.LineNumber;
+ var result = lineInfo.LineNumber;
+ tlog.Debug(tag, "LineNumber : " + result);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XmlLineInfoLineNumber END (OK)");
- Assert.Pass("XmlLineInfoLineNumber");
+ tlog.Debug(tag, $"XmlLineInfoLineNumber END");
}
[Test]
try
{
- int i = xamlInfo.LinePosition;
+ var result = lineInfo.LinePosition;
+ tlog.Debug(tag, "LinePosition : " + result);
}
catch (Exception e)
{
- Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
- Assert.Fail("Caught Exception" + e.ToString());
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"XmlLineInfoLinePosition END (OK)");
- Assert.Pass("XmlLineInfoLinePosition");
+ tlog.Debug(tag, $"XmlLineInfoLinePosition END");
}
}
}
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<l:UIElement x:Class="Tizen.NUI.Devel.Tests.TotalSample"
+ xmlns="http://tizen.org/Tizen.NUI/2018/XAML"
+ xmlns:l="clr-namespace:Tizen.NUI.Devel.Tests;"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
+
+ <l:UIElement.XamlResources>
+ <ResourceDictionary>
+ <l:FloatToStringConverter x:Key="floatToStringConverter" />
+ <x:String x:Key="positionKey">
+ 200, 200
+ </x:String>
+ </ResourceDictionary>
+ </l:UIElement.XamlResources>
+
+
+ <l:UIElement x:Name="t1" CharP="c" StringP="{Binding Path=Size.Width, Converter={StaticResource floatToStringConverter}, StringFormat='{0:N0}'}" BindingContext="{x:Reference t2}" />
+ <l:UIElement x:Name="t2" Size="300, 200" Position="{DynamicResource positionKey}" IntP="123" UIntP="123" LongP="111" ULongP="111" FloatP="1.0" DoubleP="1.0" />
+ <l:UIElement x:Name="t3" StringP="{Binding Source={x:Reference t2}, Path=Size.Height, Converter={StaticResource floatToStringConverter}, StringFormat='{0:N0}'}" />
+
+ <l:UIElement CustomBindableProperty="View.Position">
+ </l:UIElement>
+
+ <!--Cover TypeConversionExtensions.ConvertTo-->
+ <l:UIElement IntP="123" UIntP="123" LongP="111" ULongP="111" FloatP="1.0" DoubleP="1.0" />
+
+ <!--Cover CreateLanguagePrimitive-->
+ <l:UIElement>
+ <x:Arguments>
+ <x:Int32>1</x:Int32>
+ </x:Arguments>
+ <l:UIElement.Size>
+ <Null />
+ </l:UIElement.Size>
+ </l:UIElement>
+
+ <!--<l:UIElement>
+ <x:Arguments>
+ <x:Array Type="x:Int32">
+ <x:Int32>1</x:Int32>
+ <x:Int32>2</x:Int32>
+ </x:Array>
+ </x:Arguments>
+ </l:UIElement>-->
+
+ <l:UIElement>
+ <x:Arguments>
+ <l:UIElement-TestEnum>V1</l:UIElement-TestEnum>
+ </x:Arguments>
+ </l:UIElement>
+
+ <l:UIElement>
+ <x:Arguments>
+ <l:UIElement-TestNestType />
+ </x:Arguments>
+ <l:UIElement.CustomList>
+ <x:Int32> 1000 </x:Int32>
+ </l:UIElement.CustomList>
+ </l:UIElement>
+
+ <l:UIElement>
+ <x:Arguments>
+ <l:UIElement />
+ </x:Arguments>
+ </l:UIElement>
+
+ <l:UIElement x:FactoryMethod="FactoryMethod">
+ <x:Arguments>
+ <x:Int32>1</x:Int32>
+ <x:String>str</x:String>
+ <x:Single>2.0</x:Single>
+ </x:Arguments>
+ </l:UIElement>
+</l:UIElement>
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using System;
+using System.Globalization;
+using Tizen.NUI;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Components;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ public class FloatToStringConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return String.Format("Value is {0}", (float)value);
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ //return (bool)value ? 1 : 0;
+ return null;
+ }
+ }
+
+ public partial class TotalSample : UIElement
+ {
+ public TotalSample()
+ {
+ InitializeComponent();
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+[assembly: global::Tizen.NUI.Xaml.XamlResourceIdAttribute("Tizen.NUI.Devel.Tests.testcase.public.Xaml.TotalSample.TotalSample.xaml", "testcase/public/Xaml/TotalSample/TotalSample.xaml", typeof(global::Tizen.NUI.Devel.Tests.TotalSample))]
+
+namespace Tizen.NUI.Devel.Tests {
+
+
+ [Tizen.NUI.Xaml.XamlFilePathAttribute("testcase\\public\\Xaml\\TotalSample\\TotalSample.xaml")]
+ [Tizen.NUI.Xaml.XamlCompilationAttribute(global::Tizen.NUI.Xaml.XamlCompilationOptions.Compile)]
+ public partial class TotalSample : global::Tizen.NUI.Devel.Tests.UIElement {
+
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Tizen.NUI.Xaml.Build.Tasks.XamlG", "1.0.6.0")]
+ public global::Tizen.NUI.Devel.Tests.UIElement t1;
+
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Tizen.NUI.Xaml.Build.Tasks.XamlG", "1.0.6.0")]
+ public global::Tizen.NUI.Devel.Tests.UIElement t2;
+
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Tizen.NUI.Xaml.Build.Tasks.XamlG", "1.0.6.0")]
+ public global::Tizen.NUI.Devel.Tests.UIElement t3;
+
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Tizen.NUI.Xaml.Build.Tasks.XamlG", "1.0.6.0")]
+ private object eXamlData;
+
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Tizen.NUI.Xaml.Build.Tasks.XamlG", "1.0.6.0")]
+ private void InitializeComponent() {
+ //eXamlData = global::Tizen.NUI.EXaml.EXamlExtensions.LoadFromEXamlByRelativePath(this, GetEXamlPath());
+ global::Tizen.NUI.Xaml.Extensions.LoadFromXaml(this, typeof(TotalSample));
+ t1 = global::Tizen.NUI.Binding.NameScopeExtensions.FindByName<global::Tizen.NUI.Devel.Tests.UIElement>(this, "t1");
+ t2 = global::Tizen.NUI.Binding.NameScopeExtensions.FindByName<global::Tizen.NUI.Devel.Tests.UIElement>(this, "t2");
+ t3 = global::Tizen.NUI.Binding.NameScopeExtensions.FindByName<global::Tizen.NUI.Devel.Tests.UIElement>(this, "t3");
+ }
+
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Tizen.NUI.Xaml.Build.Tasks.XamlG", "1.0.6.0")]
+ private string GetEXamlPath() {
+ return default(string);
+ }
+
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Tizen.NUI.Xaml.Build.Tasks.XamlG", "1.0.6.0")]
+ private void RemoveEventsInXaml() {
+ //global::Tizen.NUI.EXaml.EXamlExtensions.RemoveEventsInXaml(eXamlData);
+ }
+
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Tizen.NUI.Xaml.Build.Tasks.XamlG", "1.0.6.0")]
+ private void ExitXaml() {
+ //RemoveEventsInXaml();
+ //global::Tizen.NUI.EXaml.EXamlExtensions.DisposeXamlElements(this);
+ }
+ }
+}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ public class UIElement : View, IResourcesProvider
+ {
+ public static readonly BindableProperty IntPProperty = BindableProperty.Create(nameof(IntP), typeof(int), typeof(UIElement), 0, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
+ {
+ }),
+ defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
+ {
+ return 0;
+ }));
+
+ public static readonly BindableProperty StringPProperty = BindableProperty.Create(nameof(StringP), typeof(string), typeof(UIElement), string.Empty, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
+ {
+ (bindable as UIElement).stringP = newValue as string;
+ }),
+ defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
+ {
+ return (bindable as UIElement).stringP;
+ }));
+
+ public static readonly BindableProperty FloatPProperty = BindableProperty.Create(nameof(FloatP), typeof(float), typeof(UIElement), 0.0f, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
+ {
+ }),
+ defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
+ {
+ return 0.0f;
+ }));
+
+ public UIElement()
+ {
+
+ }
+
+ public UIElement(int p)
+ {
+
+ }
+
+ public UIElement(int[] p)
+ {
+
+ }
+
+ public enum TestEnum
+ {
+ V1,
+ V2
+ }
+
+ public UIElement(TestEnum p)
+ {
+
+ }
+
+ public class TestNestType
+ {
+ public TestNestType(int p = 0)
+ {
+
+ }
+ }
+
+ public UIElement(TestNestType p)
+ {
+
+ }
+
+ public UIElement(UIElement p)
+ {
+
+ }
+
+ public static UIElement FactoryMethod(int p1, string p2, float p3)
+ {
+ return new UIElement();
+ }
+
+ public int IntP
+ {
+ get
+ {
+ return (int)GetValue(IntPProperty);
+ }
+ set
+ {
+ SetValue(IntPProperty, value);
+ }
+ }
+
+ private string stringP;
+ public string StringP
+ {
+ get
+ {
+ return (string)GetValue(StringPProperty);
+ }
+ set
+ {
+ SetValue(StringPProperty, value);
+ }
+ }
+
+ public float FloatP
+ {
+ get
+ {
+ return (float)GetValue(FloatPProperty);
+ }
+ set
+ {
+ SetValue(FloatPProperty, value);
+ }
+ }
+ }
+}