tlog.Debug(tag, $"BaseObjectConstructor END (OK)");
}
- //[Test]
- //[Category("P1")]
- //[Description("BaseObject DoAction.")]
- //[Property("SPEC", "Tizen.NUI.BaseObject.DoAction M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void BaseObjectDoAction()
- //{
- // tlog.Debug(tag, $"BaseObjectDoAction START");
-
- // var testingTarget = new BaseObject(widget.SwigCPtr.Handle, false);
- // Assert.IsNotNull(testingTarget, "should not be null.");
- // Assert.IsInstanceOf<BaseObject>(testingTarget, "should be an instance of BaseObject class!");
-
- // using (PropertyMap map = new PropertyMap())
- // {
- // map.Insert("ContentInfo", new PropertyValue("widget"));
- // var result = testingTarget.DoAction("set", map);
- // tlog.Debug(tag, "DoAction : " + result);
- // }
-
- // testingTarget.Dispose();
- // tlog.Debug(tag, $"BaseObjectDoAction END (OK)");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("BaseObject GetTypeName.")]
- //[Property("SPEC", "Tizen.NUI.BaseObject.GetTypeName M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void BaseObjectGetTypeName()
- //{
- // tlog.Debug(tag, $"BaseObjectGetTypeName START");
-
- // var testingTarget = new BaseObject(widget.SwigCPtr.Handle, false);
- // Assert.IsNotNull(testingTarget, "should not be null.");
- // Assert.IsInstanceOf<BaseObject>(testingTarget, "should be an instance of BaseObject class!");
-
- // var result = testingTarget.GetTypeName();
- // tlog.Debug(tag, "TypeName : " + result);
-
- // testingTarget.Dispose();
- // tlog.Debug(tag, $"BaseObjectGetTypeName END (OK)");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("BaseObject GetTypeInfo.")]
- //[Property("SPEC", "Tizen.NUI.BaseObject.GetTypeInfo M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void BaseObjectGetTypeInfo()
- //{
- // tlog.Debug(tag, $"BaseObjectGetTypeInfo START");
-
- // var testingTarget = new BaseObject(widget.SwigCPtr.Handle, false);
- // Assert.IsNotNull(testingTarget, "should not be null.");
- // Assert.IsInstanceOf<BaseObject>(testingTarget, "should be an instance of BaseObject class!");
+ [Test]
+ [Category("P1")]
+ [Description("BaseObject GetTypeName.")]
+ [Property("SPEC", "Tizen.NUI.BaseObject.GetTypeName M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void BaseObjectGetTypeName()
+ {
+ tlog.Debug(tag, $"BaseObjectGetTypeName START");
- // using (TypeInfo info = new TypeInfo(widget.SwigCPtr.Handle, false))
- // {
- // var result = testingTarget.GetTypeInfo(info);
- // tlog.Debug(tag, "TypeName : " + result);
- // }
+ var result = widget.widgetImpl.GetTypeName();
+ tlog.Debug(tag, "GetTypeName : " + result);
- // testingTarget.Dispose();
- // tlog.Debug(tag, $"BaseObjectGetTypeInfo END (OK)");
- //}
+ tlog.Debug(tag, $"BaseObjectGetTypeName END (OK)");
+ }
}
}
{
tlog.Debug(tag, $"CustomActorImplIsRelayoutEnabled START");
- var testingTarget = new CustomActorImpl(actor.SwigCPtr.Handle, false);
- Assert.IsNotNull(testingTarget, "Should be not null!");
- Assert.IsInstanceOf<CustomActorImpl>(testingTarget, "Should be an Instance of CustomActorImpl!");
+ using (View view = new View())
+ {
+ var testingTarget = NDalic.GetImplementation(view);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<CustomActorImpl>(testingTarget, "Should be an Instance of CustomActorImpl!");
- var result = testingTarget.IsRelayoutEnabled();
- tlog.Debug(tag, "IsRelayoutEnabled : " + result);
+ tlog.Debug(tag, "getCPtr : " + CustomActorImpl.getCPtr(testingTarget));
+
+ var result = testingTarget.IsRelayoutEnabled();
+ tlog.Debug(tag, "IsRelayoutEnabled : " + result);
+
+ testingTarget.Dispose();
+ }
- testingTarget.Dispose();
tlog.Debug(tag, $"CustomActorImplIsRelayoutEnabled END (OK)");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("CustomActorImpl RelayoutDependentOnChildren.")]
+ [Property("SPEC", "Tizen.NUI.CustomActorImpl.RelayoutDependentOnChildren M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CustomActorImplRelayoutDependentOnChildren()
+ {
+ tlog.Debug(tag, $"CustomActorImplRelayoutDependentOnChildren START");
+
+ using (View view = new View())
+ {
+ var testingTarget = NDalic.GetImplementation(view);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<CustomActorImpl>(testingTarget, "Should be an Instance of CustomActorImpl!");
+
+ var result = testingTarget.RelayoutDependentOnChildren();
+ tlog.Debug(tag, "RelayoutDependentOnChildren : " + result);
+
+ result = testingTarget.RelayoutDependentOnChildren(DimensionType.Height);
+ tlog.Debug(tag, "RelayoutDependentOnChildren : " + result);
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"CustomActorImplRelayoutDependentOnChildren END (OK)");
+ }
+
+
+ [Test]
+ [Category("P1")]
+ [Description("CustomActorImpl Self.")]
+ [Property("SPEC", "Tizen.NUI.CustomActorImpl.Self M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CustomActorImplSelf()
+ {
+ tlog.Debug(tag, $"CustomActorImplSelf START");
+
+ using (View view = new View())
+ {
+ var testingTarget = NDalic.GetImplementation(view).Self();
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<CustomActor>(testingTarget, "Should be an Instance of CustomActor!");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"CustomActorImplSelf END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CustomActorImpl OnSceneConnection.")]
+ [Property("SPEC", "Tizen.NUI.CustomActorImpl.OnSceneConnection M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CustomActorImplOnSceneConnection()
+ {
+ tlog.Debug(tag, $"CustomActorImplOnSceneConnection START");
+
+ using (View view = new View())
+ {
+ var testingTarget = NDalic.GetImplementation(view);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<CustomActorImpl>(testingTarget, "Should be an Instance of CustomActorImpl!");
+
+ try
+ {
+ testingTarget.OnSceneConnection(1);
+ testingTarget.OnSceneDisconnection();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"CustomActorImplOnSceneConnection END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CustomActorImpl OnChildAdd.")]
+ [Property("SPEC", "Tizen.NUI.CustomActorImpl.OnChildAdd M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CustomActorImplOnChildAdd()
+ {
+ tlog.Debug(tag, $"CustomActorImplOnChildAdd START");
+
+ using (View view = new View())
+ {
+ var testingTarget = NDalic.GetImplementation(view);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<CustomActorImpl>(testingTarget, "Should be an Instance of CustomActorImpl!");
+
+ using (View child = new View())
+ {
+ try
+ {
+ testingTarget.OnChildAdd(child);
+
+ var result = testingTarget.CalculateChildSize(child, DimensionType.Width);
+ tlog.Debug(tag, "CalculateChildSize : " + result);
+
+ testingTarget.OnChildRemove(child);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"CustomActorImplOnChildAdd END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CustomActorImpl OnPropertySet.")]
+ [Property("SPEC", "Tizen.NUI.CustomActorImpl.OnPropertySet M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CustomActorImplOnPropertySet()
+ {
+ tlog.Debug(tag, $"CustomActorImplOnPropertySet START");
+
+ using (View view = new View())
+ {
+ var testingTarget = NDalic.GetImplementation(view);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<CustomActorImpl>(testingTarget, "Should be an Instance of CustomActorImpl!");
+
+ try
+ {
+
+ testingTarget.OnPropertySet(View.Property.OPACITY, new PropertyValue(0.3f));
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"CustomActorImplOnPropertySet END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CustomActorImpl OnLayoutNegotiated.")]
+ [Property("SPEC", "Tizen.NUI.CustomActorImpl.OnLayoutNegotiated M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CustomActorImplOnLayoutNegotiated()
+ {
+ tlog.Debug(tag, $"CustomActorImplOnLayoutNegotiated START");
+
+ using (View view = new View())
+ {
+ var testingTarget = NDalic.GetImplementation(view);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<CustomActorImpl>(testingTarget, "Should be an Instance of CustomActorImpl!");
+
+ try
+ {
+ testingTarget.OnLayoutNegotiated(100.0f, DimensionType.Width);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"CustomActorImplOnLayoutNegotiated END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CustomActorImpl OnSetResizePolicy.")]
+ [Property("SPEC", "Tizen.NUI.CustomActorImpl.OnSetResizePolicy M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CustomActorImplOnSetResizePolicy()
+ {
+ tlog.Debug(tag, $"CustomActorImplOnSetResizePolicy START");
+
+ using (View view = new View())
+ {
+ var testingTarget = NDalic.GetImplementation(view);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<CustomActorImpl>(testingTarget, "Should be an Instance of CustomActorImpl!");
+
+ try
+ {
+ testingTarget.OnSetResizePolicy(ResizePolicyType.Fixed, DimensionType.Width);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"CustomActorImplOnSetResizePolicy END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CustomActorImpl OnCalculateRelayoutSize.")]
+ [Property("SPEC", "Tizen.NUI.CustomActorImpl.OnCalculateRelayoutSize M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CustomActorImplOnCalculateRelayoutSize()
+ {
+ tlog.Debug(tag, $"CustomActorImplOnCalculateRelayoutSize START");
+
+ using (View view = new View())
+ {
+ var testingTarget = NDalic.GetImplementation(view);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<CustomActorImpl>(testingTarget, "Should be an Instance of CustomActorImpl!");
+
+ try
+ {
+ testingTarget.OnCalculateRelayoutSize(DimensionType.AllDimensions);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"CustomActorImplOnCalculateRelayoutSize END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CustomActorImpl GetHeightForWidth.")]
+ [Property("SPEC", "Tizen.NUI.CustomActorImpl.GetHeightForWidth M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CustomActorImplGetHeightForWidth()
+ {
+ tlog.Debug(tag, $"CustomActorImplGetHeightForWidth START");
+
+ using (View view = new View())
+ {
+ var testingTarget = NDalic.GetImplementation(view);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<CustomActorImpl>(testingTarget, "Should be an Instance of CustomActorImpl!");
+
+ var size = testingTarget.GetNaturalSize();
+ Assert.IsInstanceOf<Vector3>(size, "Should be an Instance of Vector3!");
+
+ var result = testingTarget.GetHeightForWidth(100.0f);
+ tlog.Debug(tag, "GetHeightForWidth : " + result);
+
+ result = testingTarget.GetWidthForHeight(50.0f);
+ tlog.Debug(tag, "GetWidthForHeight : " + result);
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"CustomActorImplGetHeightForWidth END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CustomActorImpl OnSizeAnimation.")]
+ [Property("SPEC", "Tizen.NUI.CustomActorImpl.OnSizeAnimation M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CustomActorImplOnSizeAnimation()
+ {
+ tlog.Debug(tag, $"CustomActorImplOnSizeAnimation START");
+
+ using (View view = new View())
+ {
+ var testingTarget = NDalic.GetImplementation(view);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<CustomActorImpl>(testingTarget, "Should be an Instance of CustomActorImpl!");
+
+ try
+ {
+ using (Animation ani = new Animation(300))
+ {
+ using (Vector3 vector = new Vector3(100.0f, 20.0f, 80.0f))
+ {
+ testingTarget.OnSizeAnimation(ani, vector);
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"CustomActorImplOnSizeAnimation END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CustomActorImpl OnSizeSet.")]
+ [Property("SPEC", "Tizen.NUI.CustomActorImpl.OnSizeSet M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CustomActorImplOnSizeSet()
+ {
+ tlog.Debug(tag, $"CustomActorImplOnSizeSet START");
+
+ using (View view = new View())
+ {
+ var testingTarget = NDalic.GetImplementation(view);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<CustomActorImpl>(testingTarget, "Should be an Instance of CustomActorImpl!");
+
+ try
+ {
+ using (Vector3 vector = new Vector3(100.0f, 20.0f, 80.0f))
+ {
+ testingTarget.OnSizeSet(vector);
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"CustomActorImplOnSizeSet END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CustomActorImpl OnRelayout.")]
+ [Property("SPEC", "Tizen.NUI.CustomActorImpl.OnRelayout M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CustomActorImplOnRelayout()
+ {
+ tlog.Debug(tag, $"CustomActorImplOnRelayout START");
+
+ using (View view = new View())
+ {
+ var testingTarget = NDalic.GetImplementation(view);
+ Assert.IsNotNull(testingTarget, "Should be not null!");
+ Assert.IsInstanceOf<CustomActorImpl>(testingTarget, "Should be an Instance of CustomActorImpl!");
+
+ using (Vector2 vector = new Vector2(100.0f, 20.0f))
+ {
+ using (RelayoutContainer container = new RelayoutContainer(view.SwigCPtr.Handle, false))
+ {
+ try
+ {
+ testingTarget.OnRelayout(vector, container);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+ }
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"CustomActorImplOnRelayout 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/DaliEnumConstants")]
+ public class InternalDaliEnumConstantsTest
+ {
+ 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("DaliEnumConstants BackgroundProperty.")]
+ [Property("SPEC", "Tizen.NUI.DaliEnumConstants.BackgroundProperty A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DaliEnumConstantsBackgroundProperty()
+ {
+ tlog.Debug(tag, $"DaliEnumConstantsBackgroundProperty START");
+
+ var visual = Tizen.NUI.Constants.Tooltip.BackgroundProperty.Visual;
+ tlog.Debug(tag, "Visual : " + visual);
+
+ var border = Tizen.NUI.Constants.Tooltip.BackgroundProperty.Border;
+ tlog.Debug(tag, "Border : " + border);
+
+ tlog.Debug(tag, $"DaliEnumConstantsBackgroundProperty END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DaliEnumConstants TailProperty.")]
+ [Property("SPEC", "Tizen.NUI.DaliEnumConstants.TailProperty A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DaliEnumConstantsTailProperty()
+ {
+ tlog.Debug(tag, $"DaliEnumConstantsTailProperty START");
+
+ var result = Tizen.NUI.Constants.Tooltip.TailProperty.Visibility;
+ tlog.Debug(tag, "Visibility : " + result);
+
+ result = Tizen.NUI.Constants.Tooltip.TailProperty.AboveVisual;
+ tlog.Debug(tag, "AboveVisual : " + result);
+
+ result = Tizen.NUI.Constants.Tooltip.TailProperty.BelowVisual;
+ tlog.Debug(tag, "BelowVisual : " + result);
+
+ tlog.Debug(tag, $"DaliEnumConstantsTailProperty END (OK)");
+ }
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using System.Reflection;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("internal/Common/Extensions")]
+ public class InternalExtensionsTest
+ {
+ 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("Extensions GetValueString.")]
+ [Property("SPEC", "Tizen.NUI.Extensions.GetValueString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ExtensionsGetValueString()
+ {
+ tlog.Debug(tag, $"ExtensionsGetValueString START");
+
+ using (View view = new View())
+ {
+ view.Name = "view";
+ global::System.Reflection.PropertyInfo propertyInfo = view.GetType().GetProperty("Name");
+
+ var result = propertyInfo.GetValueString(view, propertyInfo.PropertyType);
+ tlog.Debug(tag, "GetValueString : " + result);
+ }
+
+ tlog.Debug(tag, $"ExtensionsGetValueString END (OK)");
+ }
+ }
+}
[Test]
[Category("P1")]
+ [Description("FontMetrics constructor.")]
+ [Property("SPEC", "Tizen.NUI.FontMetrics.FontMetrics C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void FontMetricsConstructorWithFloats()
+ {
+ tlog.Debug(tag, $"FontMetricsConstructorWithFloats START");
+
+ var testingTarget = new FontMetrics(0.3f, 0.1f, 0.5f, 0.9f, 0.0f);
+ Assert.IsNotNull(testingTarget, "Can't create success object FontMetrics.");
+ Assert.IsInstanceOf<FontMetrics>(testingTarget, "Should return FontMetrics instance.");
+
+ tlog.Debug(tag, "getCPtr : " + FontMetrics.getCPtr(testingTarget));
+
+ testingTarget.UnderlineThickness = 0.3f;
+ tlog.Debug(tag, "UnderlineThickness :" + testingTarget.UnderlineThickness);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"FontMetricsConstructorWithFloats END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
[Description("FontMetrics Ascender.")]
[Property("SPEC", "Tizen.NUI.FontMetrics.Ascender A")]
[Property("SPEC_URL", "-")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "MR")]
[Property("AUTHOR", "guowei.wang@samsung.com")]
- public void LayoutControllerRequestLayoutParentIsNUll()
+ public void LayoutControllerRequestLayoutParentNotNUll()
{
- tlog.Debug(tag, $"LayoutControllerRequestLayoutParentIsNUll START");
+ tlog.Debug(tag, $"LayoutControllerRequestLayoutParentNotNUll START");
var testingTarget = new LayoutController(Window.Instance);
Assert.IsNotNull(testingTarget, "Can't create success object LayoutController");
Assert.IsInstanceOf<LayoutController>(testingTarget, "Should be an instance of LayoutController type.");
- using (LayoutItem layoutItem = new LayoutItem())
+ using (LayoutGroup group = new LayoutGroup())
{
- try
- {
- testingTarget.RequestLayout(layoutItem);
- }
- catch (Exception e)
+ using (LayoutItem layoutItem = new LayoutItem())
{
- tlog.Debug(tag, e.Message.ToString());
- Assert.Fail("Caught Exception : Failed!");
+ group.Add(layoutItem);
+ try
+ {
+ testingTarget.RequestLayout(layoutItem);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
}
}
testingTarget.Dispose();
- tlog.Debug(tag, $"LayoutControllerRequestLayoutParentIsNUll END (OK)");
+ tlog.Debug(tag, $"LayoutControllerRequestLayoutParentNotNUll END (OK)");
}
[Test]
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using System.Reflection;
+using System.Collections.Generic;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("internal/XamlBinding/ActionSheetArguments")]
+ public class InternalActionSheetArgumentsTest
+ {
+ private const string tag = "NUITEST";
+ private string[] Buttons = { "button1", "button2" };
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ActionSheetArguments constructor")]
+ [Property("SPEC", "Tizen.NUI.ActionSheetArguments.ActionSheetArguments C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ public void ActionSheetArgumentsConstructor()
+ {
+ tlog.Debug(tag, $"ActionSheetArgumentsConstructor START");
+
+ var testingTarget = new ActionSheetArguments("ActionSheetArguments", "cancel", "destruction", Buttons);
+ Assert.IsNotNull(testingTarget, "Can't create success object ActionSheetArguments.");
+ Assert.IsInstanceOf<ActionSheetArguments>(testingTarget, "Should return ActionSheetArguments instance.");
+
+ tlog.Debug(tag, "Buttons : " + testingTarget.Buttons);
+ tlog.Debug(tag, "Cancel : " + testingTarget.Cancel);
+ tlog.Debug(tag, "Destruction : " + testingTarget.Destruction);
+ tlog.Debug(tag, "Result : " + testingTarget.Result);
+ tlog.Debug(tag, "Title : " + testingTarget.Title);
+
+ try
+ {
+ testingTarget.SetResult("OK");
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ tlog.Debug(tag, $"ActionSheetArgumentsConstructor END");
+ }
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using System.Reflection;
+using System.Collections.Generic;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("internal/XamlBinding/AlertArguments")]
+ public class InternalAlertArgumentsTest
+ {
+ 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("AlertArguments constructor")]
+ [Property("SPEC", "Tizen.NUI.AlertArguments.AlertArguments C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ public void AlertArgumentsConstructor()
+ {
+ tlog.Debug(tag, $"AlertArgumentsConstructor START");
+
+ var testingTarget = new AlertArguments("AlertArguments", "AlertArguments", "ACCEPT", "CANCEL");
+ Assert.IsNotNull(testingTarget, "Can't create success object AlertArguments.");
+ Assert.IsInstanceOf<AlertArguments>(testingTarget, "Should return AlertArguments instance.");
+
+ tlog.Debug(tag, "Accept : " + testingTarget.Accept);
+ tlog.Debug(tag, "Cancel : " + testingTarget.Cancel);
+ tlog.Debug(tag, "Message : " + testingTarget.Message);
+ tlog.Debug(tag, "Result : " + testingTarget.Result);
+ tlog.Debug(tag, "Title : " + testingTarget.Title);
+
+ try
+ {
+ testingTarget.SetResult(true);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ tlog.Debug(tag, $"AlertArgumentsConstructor END");
+ }
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using System.Reflection;
+using System.Collections.Generic;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("internal/XamlBinding/BindingExpression")]
+ public class InternalBindingExpressionTest
+ {
+ private const string tag = "NUITEST";
+ private string selfpath = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Test_View.xaml";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("BindingExpression constructor")]
+ [Property("SPEC", "Tizen.NUI.BindingExpression.BindingExpression C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ public void BindingExpressionConstructor()
+ {
+ tlog.Debug(tag, $"BindingExpressionConstructor START");
+
+ var testingTarget = new BindingExpression(new TemplateBinding(), selfpath);
+ Assert.IsNotNull(testingTarget, "Can't create success object BindingExpression.");
+ Assert.IsInstanceOf<BindingExpression>(testingTarget, "Should return BindingExpression instance.");
+
+ tlog.Debug(tag, "Binding : " + testingTarget.Binding);
+
+ tlog.Debug(tag, $"BindingExpressionConstructor END");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("BindingExpression constructor")]
+ [Property("SPEC", "Tizen.NUI.BindingExpression.BindingExpression C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ public void BindingExpressionConstructorNullBinding()
+ {
+ tlog.Debug(tag, $"BindingExpressionConstructorNullBinding START");
+
+ BindingBase binding = null;
+ try
+ {
+ var testingTarget = new BindingExpression(binding, selfpath);
+ }
+ catch (ArgumentNullException)
+ {
+ tlog.Debug(tag, $"BindingExpressionConstructorNullBinding END");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("BindingExpression constructor")]
+ [Property("SPEC", "Tizen.NUI.BindingExpression.BindingExpression C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ public void BindingExpressionConstructorNullPath()
+ {
+ tlog.Debug(tag, $"BindingExpressionConstructorNullPath START");
+
+ try
+ {
+ var testingTarget = new BindingExpression(new TemplateBinding(), null);
+ }
+ catch (ArgumentNullException)
+ {
+ tlog.Debug(tag, $"BindingExpressionConstructorNullPath END");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("BindingExpression Apply")]
+ [Property("SPEC", "Tizen.NUI.BindingExpression.Apply M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void BindingExpressionApplyNullSource()
+ {
+ tlog.Debug(tag, $"BindingExpressionApplyNullSource START");
+
+ var testingTarget = new BindingExpression(new TemplateBinding(), selfpath);
+ Assert.IsNotNull(testingTarget, "Can't create success object BindingExpression.");
+ Assert.IsInstanceOf<BindingExpression>(testingTarget, "Should return BindingExpression instance.");
+
+ try
+ {
+ testingTarget.Apply(false);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ tlog.Debug(tag, $"BindingExpressionApplyNullSource END");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("BindingExpression Apply")]
+ [Property("SPEC", "Tizen.NUI.BindingExpression.Apply M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void BindingExpressionApply()
+ {
+ tlog.Debug(tag, $"BindingExpressionApply START");
+
+ var testingTarget = new BindingExpression(new TemplateBinding(), selfpath);
+ Assert.IsNotNull(testingTarget, "Can't create success object BindingExpression.");
+ Assert.IsInstanceOf<BindingExpression>(testingTarget, "Should return BindingExpression instance.");
+
+ try
+ {
+ using (View view = new View() { Color = Color.Red })
+ {
+ using (View preView = new View() { Color = Color.Cyan })
+ {
+ BindableProperty property = BindableProperty.Create("myProperty", typeof(string), typeof(View), null, BindingMode.OneWay,
+ null, null, null, null, null);
+
+ testingTarget.Apply(view, preView, property);
+ testingTarget.Apply(true);
+ testingTarget.Apply(false);
+ testingTarget.Unapply();
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ tlog.Debug(tag, $"BindingExpressionApply END");
+ }
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using System.Reflection;
+using System.Collections.Generic;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("internal/XamlBinding/ContentPropertyAttribute")]
+ public class InternalContentPropertyAttributeTest
+ {
+ 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("ContentPropertyAttribute constructor")]
+ [Property("SPEC", "ContentPropertyAttribute constructor M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void ContentPropertyAttributeConstructor()
+ {
+ tlog.Debug(tag, $"ContentPropertyAttributeConstructor START");
+
+ var testingTarget = new ContentPropertyAttribute("content");
+ tlog.Debug(tag, "Name : " + testingTarget.Name);
+
+ tlog.Debug(tag, $"ContentPropertyAttributeConstructor END");
+ }
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using System.Reflection;
+using System.Collections.Generic;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("internal/XamlBinding/DependencyService")]
+ public class InternalDependencyServiceTest
+ {
+ 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("DependencyService Resolve")]
+ [Property("SPEC", "DependencyService Resolve M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void DependencyServiceResolve()
+ {
+ tlog.Debug(tag, $"DependencyServiceResolve START");
+
+ var mString = DependencyService.Resolve<string>(DependencyFetchTarget.NewInstance);
+ tlog.Error(tag, "sting : " + mString);
+
+ var mArray = DependencyService.Resolve<Array>(DependencyFetchTarget.GlobalInstance);
+ tlog.Error(tag, "Array : " + mArray);
+
+ var mElement = DependencyService.Resolve<Element>(DependencyFetchTarget.GlobalInstance);
+ tlog.Error(tag, "Element : " + mElement);
+
+ var mIList = DependencyService.Resolve<IList<string>>(DependencyFetchTarget.GlobalInstance);
+ tlog.Error(tag, "IList : " + mIList);
+
+ var mIEnumerable = DependencyService.Resolve<IEnumerable<float>>(DependencyFetchTarget.GlobalInstance);
+ tlog.Error(tag, "IEnumerable : " + mIEnumerable);
+
+ tlog.Debug(tag, $"ContentPropertyAttributeConstructor END");
+ }
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using System.Reflection;
+using System.Collections.Generic;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("internal/XamlBinding/Device")]
+ public class InternalDeviceTest
+ {
+ 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("Device SetIdiom")]
+ [Property("SPEC", "Device SetIdiom M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void DeviceSetIdiom()
+ {
+ tlog.Debug(tag, $"DeviceSetIdiom START");
+
+ tlog.Debug(tag, "OS : " + Device.OS);
+ tlog.Debug(tag, "Info : " + Device.Info);
+ tlog.Debug(tag, "RuntimePlatform : " + Device.RuntimePlatform);
+
+ Device.SetIdiom(TargetIdiom.TV);
+ tlog.Debug(tag, "Idiom : " + Device.Idiom);
+
+ tlog.Debug(tag, $"DeviceSetIdiom END");
+ }
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using System.Reflection;
+using System.Collections.Generic;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("internal/XamlBinding/MessagingCenter")]
+ public class InternalMessagingCenterTest
+ {
+ 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("MessagingCenter Instance")]
+ [Property("SPEC", "MessagingCenter Instance A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ public void MessagingCenterInstance()
+ {
+ tlog.Debug(tag, $"MessagingCenterInstance START");
+
+ var testingTarget = MessagingCenter.Instance;
+ Assert.IsNotNull(testingTarget, "Can't create success object IMessagingCenter.");
+ Assert.IsInstanceOf<IMessagingCenter>(testingTarget, "Should return IMessagingCenter instance.");
+
+ tlog.Debug(tag, $"MessagingCenterInstance END");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MessagingCenter ClearSubscribers")]
+ [Property("SPEC", "MessagingCenter ClearSubscribers M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void MessagingCenterClearSubscribers()
+ {
+ tlog.Debug(tag, $"ClearSubscribers START");
+
+ try
+ {
+ MessagingCenter.ClearSubscribers();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ tlog.Debug(tag, $"ClearSubscribers END");
+ }
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using System.Reflection;
+using System.Collections.Generic;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("internal/XamlBinding/NUIConstantExtension")]
+ public class InternalNUIConstantExtensionTest
+ {
+ 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("NUIConstantExtension.VisualExtension KeyDictionary")]
+ [Property("SPEC", "Tizen.NUI.NUIConstantExtension.VisualExtension.KeyDictionary M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void NUIConstantExtensionKeyDictionary()
+ {
+ tlog.Debug(tag, $"NUIConstantExtensionKeyDictionary START");
+
+ var result = VisualExtension.KeyDictionary;
+ tlog.Debug(tag, "KeyDictionary : " + result);
+
+ tlog.Debug(tag, $"NUIConstantExtensionKeyDictionary END");
+ }
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using System.Reflection;
+using System.Collections.Generic;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("internal/XamlBinding/UriTypeConverter")]
+ public class InternalUriTypeConverterTest
+ {
+ private const string tag = "NUITEST";
+ private string selfpath = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Test_Theme.xaml";
+
+ internal class UriTypeConverterImpl : Binding.UriTypeConverter
+ {
+ public UriTypeConverterImpl()
+ { }
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("UriTypeConverter ConvertFromInvariantString")]
+ [Property("SPEC", "Tizen.NUI.UriTypeConverter.ConvertFromInvariantString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void UriTypeConverterConvertFromInvariantString()
+ {
+ tlog.Debug(tag, $"UriTypeConverterConvertFromInvariantString START");
+
+ var testingTarget = new UriTypeConverterImpl();
+ Assert.IsNotNull(testingTarget, "Can't create success object UriTypeConverter.");
+ Assert.IsInstanceOf<Tizen.NUI.Binding.UriTypeConverter>(testingTarget, "Should return UriTypeConverter instance.");
+
+ var result = testingTarget.ConvertFromInvariantString(selfpath);
+ tlog.Debug(tag, "ConvertFromInvariantString : " + result);
+
+ tlog.Debug(tag, $"UriTypeConverterConvertFromInvariantString END");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("UriTypeConverter ConvertFromInvariantString")]
+ [Property("SPEC", "Tizen.NUI.UriTypeConverter.ConvertFromInvariantString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void UriTypeConverterConvertFromInvariantStringNullPath()
+ {
+ tlog.Debug(tag, $"UriTypeConverterConvertFromInvariantStringNullPath START");
+
+ var testingTarget = new UriTypeConverterImpl();
+ Assert.IsNotNull(testingTarget, "Can't create success object UriTypeConverter.");
+ Assert.IsInstanceOf<Tizen.NUI.Binding.UriTypeConverter>(testingTarget, "Should return UriTypeConverter instance.");
+
+ var result = testingTarget.ConvertFromInvariantString(" ");
+ tlog.Debug(tag, "ConvertFromInvariantString : " + result);
+
+ tlog.Debug(tag, $"UriTypeConverterConvertFromInvariantStringNullPath END");
+ }
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using System.Reflection;
+using System.Collections.Generic;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("internal/XamlBinding/VectorTypeConverter")]
+ public class InternalVectorTypeConverterTest
+ {
+ private const string tag = "NUITEST";
+ private string selfpath = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Test_Theme.xaml";
+
+ internal class Vector2TypeConverterImpl : Vector2TypeConverter
+ {
+ public Vector2TypeConverterImpl()
+ { }
+ }
+
+ internal class Vector3TypeConverterImpl : Vector3TypeConverter
+ {
+ public Vector3TypeConverterImpl()
+ { }
+ }
+
+
+ internal class Vector4TypeConverterImpl : Vector4TypeConverter
+ {
+ public Vector4TypeConverterImpl()
+ { }
+ }
+
+ internal class RelativeVector2TypeConverterImpl : RelativeVector2TypeConverter
+ {
+ public RelativeVector2TypeConverterImpl()
+ { }
+ }
+
+ internal class RelativeVector3TypeConverterImpl : RelativeVector3TypeConverter
+ {
+ public RelativeVector3TypeConverterImpl()
+ { }
+ }
+
+ internal class RelativeVector4TypeConverterImpl : RelativeVector4TypeConverter
+ {
+ public RelativeVector4TypeConverterImpl()
+ { }
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Vector2TypeConverter ConvertFromInvariantString")]
+ [Property("SPEC", "Tizen.NUI.Vector2TypeConverter.ConvertFromInvariantString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void Vector2TypeConverterConvertFromInvariantString()
+ {
+ tlog.Debug(tag, $"Vector2TypeConverterConvertFromInvariantString START");
+
+ var testingTarget = new Vector2TypeConverterImpl();
+ Assert.IsNotNull(testingTarget, "Can't create success object Vector2TypeConverter.");
+ Assert.IsInstanceOf<Vector2TypeConverter>(testingTarget, "Should return Vector2TypeConverter instance.");
+
+ var result = testingTarget.ConvertFromInvariantString("100");
+ tlog.Debug(tag, "ConvertFromInvariantString : " + result);
+
+ tlog.Debug(tag, $"Vector2TypeConverterConvertFromInvariantString END");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Vector2TypeConverter ConvertFromInvariantString")]
+ [Property("SPEC", "Tizen.NUI.Vector2TypeConverter.ConvertFromInvariantString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void Vector2TypeConverterConvertFromInvariantStringNullPath()
+ {
+ tlog.Debug(tag, $"Vector2TypeConverterConvertFromInvariantStringNullPath START");
+
+ var testingTarget = new Vector2TypeConverterImpl();
+ Assert.IsNotNull(testingTarget, "Can't create success object Vector2TypeConverter.");
+ Assert.IsInstanceOf<Vector2TypeConverter>(testingTarget, "Should return Vector2TypeConverter instance.");
+
+ try
+ {
+ string str = null;
+ var result = testingTarget.ConvertFromInvariantString(str);
+ }
+ catch (InvalidOperationException)
+ {
+ tlog.Debug(tag, $"Vector2TypeConverterConvertFromInvariantStringNullPath END");
+ Assert.Pass("Caught InvalidOperationException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Vector2TypeConverter ConvertToString")]
+ [Property("SPEC", "Tizen.NUI.Vector2TypeConverter.ConvertToString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void Vector2TypeConverterConvertToString()
+ {
+ tlog.Debug(tag, $"Vector2TypeConverterConvertToString START");
+
+ var testingTarget = new Vector2TypeConverterImpl();
+ Assert.IsNotNull(testingTarget, "Can't create success object Vector2TypeConverter.");
+ Assert.IsInstanceOf<Vector2TypeConverter>(testingTarget, "Should return Vector2TypeConverter instance.");
+
+ var result = testingTarget.ConvertToString(0.3f);
+ tlog.Debug(tag, "ConvertToString : " + result);
+
+ tlog.Debug(tag, $"Vector2TypeConverterConvertToString END");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Vector2TypeConverter FromString")]
+ [Property("SPEC", "Tizen.NUI.Vector2TypeConverter.FromString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void Vector2TypeConverterFromString()
+ {
+ tlog.Debug(tag, $"Vector2TypeConverterFromString START");
+
+ // length is 2
+ var result = Vector2TypeConverter.FromString("100, 50");
+ tlog.Debug(tag, "FromString : " + result);
+
+ // length is 1
+ result = Vector2TypeConverter.FromString("100");
+ tlog.Debug(tag, "FromString : " + result);
+
+ tlog.Debug(tag, $"Vector2TypeConverterFromString END");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Vector2TypeConverter InvalidOperationException")]
+ [Property("SPEC", "Tizen.NUI.Vector2TypeConverter.FromString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void Vector2TypeConverterFromStringInvalidOperationException()
+ {
+ tlog.Debug(tag, $"Vector2TypeConverterFromStringInvalidOperationException START");
+
+ try
+ {
+ // length is 3
+ Vector2TypeConverter.FromString("100, 50, 0.0f");
+ }
+ catch (InvalidOperationException)
+ {
+ tlog.Debug(tag, $"Vector2TypeConverterFromStringInvalidOperationException END");
+ Assert.Pass("Caught InvalidOperationException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Vector2TypeConverter ToString")]
+ [Property("SPEC", "Tizen.NUI.Vector2TypeConverter.ToString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void Vector2TypeConverterToString()
+ {
+ tlog.Debug(tag, $"Vector2TypeConverterToString START");
+
+ using (Vector2 vec = new Vector2(100, 50))
+ {
+ var result = Vector2TypeConverter.ToString(vec);
+ tlog.Debug(tag, "ToString : " + result);
+ }
+
+ Vector2 val = null;
+ Assert.AreEqual(null, Vector2TypeConverter.ToString(val), "should be equal!");
+
+ tlog.Debug(tag, $"Vector2TypeConverterToString END");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Vector3TypeConverter ConvertFromInvariantString")]
+ [Property("SPEC", "Tizen.NUI.Vector3TypeConverter.ConvertFromInvariantString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void Vector3TypeConverterConvertFromInvariantString()
+ {
+ tlog.Debug(tag, $"Vector3TypeConverterConvertFromInvariantString START");
+
+ var testingTarget = new Vector3TypeConverterImpl();
+ Assert.IsNotNull(testingTarget, "Can't create success object Vector3TypeConverter.");
+ Assert.IsInstanceOf<Vector3TypeConverter>(testingTarget, "Should return Vector3TypeConverter instance.");
+
+ // length is 3
+ var result = testingTarget.ConvertFromInvariantString("100, 50, 30");
+ tlog.Debug(tag, "ConvertFromInvariantString : " + result);
+
+ // length is 2
+ result = testingTarget.ConvertFromInvariantString("100, 50");
+ tlog.Debug(tag, "ConvertFromInvariantString : " + result);
+
+ // length is 1
+ result = testingTarget.ConvertFromInvariantString("100");
+ tlog.Debug(tag, "ConvertFromInvariantString : " + result);
+
+ try
+ {
+ // lenght is 4
+ result = testingTarget.ConvertFromInvariantString("100, 50, 30, 0.3f");
+ }
+ catch (InvalidOperationException)
+ {
+ tlog.Debug(tag, $"Vector3TypeConverterConvertFromInvariantString END");
+ Assert.Pass("Caught InvalidOperationException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Vector3TypeConverter ConvertToString")]
+ [Property("SPEC", "Tizen.NUI.Vector3TypeConverter.ConvertToString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void Vector3TypeConverterConvertToString()
+ {
+ tlog.Debug(tag, $"Vector3TypeConverterConvertToString START");
+
+ var testingTarget = new Vector3TypeConverterImpl();
+ Assert.IsNotNull(testingTarget, "Can't create success object Vector3TypeConverter.");
+ Assert.IsInstanceOf<Vector3TypeConverter>(testingTarget, "Should return Vector3TypeConverter instance.");
+
+ // null
+ var result = testingTarget.ConvertToString(0.3f);
+ tlog.Debug(tag, "ConvertToString : " + result);
+
+ using (Vector3 vec = new Vector3(0.1f, 0.3f, 0.5f))
+ {
+ result = testingTarget.ConvertToString(vec);
+ tlog.Debug(tag, "ConvertToString : " + result);
+ }
+
+ tlog.Debug(tag, $"Vector3TypeConverterConvertToString END");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Vector4TypeConverter ConvertFromInvariantString")]
+ [Property("SPEC", "Tizen.NUI.Vector4TypeConverter.ConvertFromInvariantString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void Vector4TypeConverterConvertFromInvariantString()
+ {
+ tlog.Debug(tag, $"Vector4TypeConverterConvertFromInvariantString START");
+
+ var testingTarget = new Vector4TypeConverterImpl();
+ Assert.IsNotNull(testingTarget, "Can't create success object Vector4TypeConverter.");
+ Assert.IsInstanceOf<Vector4TypeConverter>(testingTarget, "Should return Vector4TypeConverter instance.");
+
+ // length is 4
+ var result = testingTarget.ConvertFromInvariantString("100, 50, 30, 10");
+ tlog.Debug(tag, "ConvertFromInvariantString : " + result);
+
+ // length is 3
+ result = testingTarget.ConvertFromInvariantString("100, 50, 30");
+ tlog.Debug(tag, "ConvertFromInvariantString : " + result);
+
+ // length is 2
+ result = testingTarget.ConvertFromInvariantString("100, 50");
+ tlog.Debug(tag, "ConvertFromInvariantString : " + result);
+
+ // length is 1
+ result = testingTarget.ConvertFromInvariantString("100");
+ tlog.Debug(tag, "ConvertFromInvariantString : " + result);
+
+ try
+ {
+ // lenght is 5
+ result = testingTarget.ConvertFromInvariantString("100, 50, 30, 10, 0.3f");
+ }
+ catch (InvalidOperationException)
+ {
+ tlog.Debug(tag, $"Vector4TypeConverterConvertFromInvariantString END");
+ Assert.Pass("Caught InvalidOperationException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Vector4TypeConverter ConvertToString")]
+ [Property("SPEC", "Tizen.NUI.Vector4TypeConverter.ConvertToString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void Vector4TypeConverterConvertToString()
+ {
+ tlog.Debug(tag, $"Vector4TypeConverterConvertToString START");
+
+ var testingTarget = new Vector4TypeConverterImpl();
+ Assert.IsNotNull(testingTarget, "Can't create success object Vector4TypeConverter.");
+ Assert.IsInstanceOf<Vector4TypeConverter>(testingTarget, "Should return Vector4TypeConverter instance.");
+
+ // null
+ var result = testingTarget.ConvertToString(0.3f);
+ tlog.Debug(tag, "ConvertToString : " + result);
+
+ using (Vector4 vec = new Vector4(0.1f, 0.3f, 0.5f, 0.0f))
+ {
+ result = testingTarget.ConvertToString(vec);
+ tlog.Debug(tag, "ConvertToString : " + result);
+ }
+
+ tlog.Debug(tag, $"Vector4TypeConverterConvertToString END");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RelativeVector2TypeConverter ConvertFromInvariantString")]
+ [Property("SPEC", "Tizen.NUI.RelativeVector2TypeConverter.ConvertFromInvariantString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void RelativeVector2TypeConverterConvertFromInvariantString()
+ {
+ tlog.Debug(tag, $"RelativeVector2TypeConverterConvertFromInvariantString START");
+
+ var testingTarget = new RelativeVector2TypeConverterImpl();
+ Assert.IsNotNull(testingTarget, "Can't create success object RelativeVector2TypeConverter.");
+ Assert.IsInstanceOf<RelativeVector2TypeConverter>(testingTarget, "Should return RelativeVector2TypeConverter instance.");
+
+ // length is 2
+ var result = testingTarget.ConvertFromInvariantString("100, 50");
+ tlog.Debug(tag, "ConvertFromInvariantString : " + result);
+
+ // length is 1
+ result = testingTarget.ConvertFromInvariantString("100");
+ tlog.Debug(tag, "ConvertFromInvariantString : " + result);
+
+ try
+ {
+ // lenght is 3
+ result = testingTarget.ConvertFromInvariantString("100, 50, 30");
+ }
+ catch (InvalidOperationException)
+ {
+ tlog.Debug(tag, $"RelativeVector2TypeConverterConvertFromInvariantString END");
+ Assert.Pass("Caught InvalidOperationException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RelativeVector2TypeConverter ConvertToString")]
+ [Property("SPEC", "Tizen.NUI.RelativeVector2TypeConverter.ConvertToString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void RelativeVector2TypeConverterConvertToString()
+ {
+ tlog.Debug(tag, $"RelativeVector2TypeConverterConvertToString START");
+
+ var testingTarget = new RelativeVector2TypeConverterImpl();
+ Assert.IsNotNull(testingTarget, "Can't create success object RelativeVector2TypeConverter.");
+ Assert.IsInstanceOf<RelativeVector2TypeConverter>(testingTarget, "Should return RelativeVector2TypeConverter instance.");
+
+ // null
+ var result = testingTarget.ConvertToString(0.3f);
+ tlog.Debug(tag, "ConvertToString : " + result);
+
+ using (RelativeVector2 vec = new RelativeVector2(0.1f, 0.3f))
+ {
+ result = testingTarget.ConvertToString(vec);
+ tlog.Debug(tag, "ConvertToString : " + result);
+ }
+
+ tlog.Debug(tag, $"RelativeVector2TypeConverterConvertToString END");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RelativeVector3TypeConverter ConvertFromInvariantString")]
+ [Property("SPEC", "Tizen.NUI.RelativeVector3TypeConverter.ConvertFromInvariantString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void RelativeVector3TypeConverterConvertFromInvariantString()
+ {
+ tlog.Debug(tag, $"RelativeVector3TypeConverterConvertFromInvariantString START");
+
+ var testingTarget = new RelativeVector3TypeConverterImpl();
+ Assert.IsNotNull(testingTarget, "Can't create success object RelativeVector3TypeConverter.");
+ Assert.IsInstanceOf<RelativeVector3TypeConverter>(testingTarget, "Should return RelativeVector3TypeConverter instance.");
+
+ // length is 3
+ var result = testingTarget.ConvertFromInvariantString("100, 50, 30");
+ tlog.Debug(tag, "ConvertFromInvariantString : " + result);
+
+ // length is 2
+ result = testingTarget.ConvertFromInvariantString("100, 50");
+ tlog.Debug(tag, "ConvertFromInvariantString : " + result);
+
+ // length is 1
+ result = testingTarget.ConvertFromInvariantString("100");
+ tlog.Debug(tag, "ConvertFromInvariantString : " + result);
+
+ try
+ {
+ // lenght is 4
+ result = testingTarget.ConvertFromInvariantString("100, 50, 30, 10");
+ }
+ catch (InvalidOperationException)
+ {
+ tlog.Debug(tag, $"RelativeVector3TypeConverterConvertFromInvariantString END");
+ Assert.Pass("Caught InvalidOperationException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RelativeVector3TypeConverter ConvertToString")]
+ [Property("SPEC", "Tizen.NUI.RelativeVector3TypeConverter.ConvertToString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void RelativeVector3TypeConverterConvertToString()
+ {
+ tlog.Debug(tag, $"RelativeVector3TypeConverterConvertToString START");
+
+ var testingTarget = new RelativeVector3TypeConverterImpl();
+ Assert.IsNotNull(testingTarget, "Can't create success object RelativeVector3TypeConverter.");
+ Assert.IsInstanceOf<RelativeVector3TypeConverter>(testingTarget, "Should return RelativeVector3TypeConverter instance.");
+
+ // null
+ var result = testingTarget.ConvertToString(0.3f);
+ tlog.Debug(tag, "ConvertToString : " + result);
+
+ using (RelativeVector3 vec = new RelativeVector3(0.1f, 0.3f, 0.5f))
+ {
+ result = testingTarget.ConvertToString(vec);
+ tlog.Debug(tag, "ConvertToString : " + result);
+ }
+
+ tlog.Debug(tag, $"RelativeVector3TypeConverterConvertToString END");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RelativeVector4TypeConverter ConvertFromInvariantString")]
+ [Property("SPEC", "Tizen.NUI.RelativeVector4TypeConverter.ConvertFromInvariantString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void RelativeVector4TypeConverterConvertFromInvariantString()
+ {
+ tlog.Debug(tag, $"RelativeVector4TypeConverterConvertFromInvariantString START");
+
+ var testingTarget = new RelativeVector4TypeConverterImpl();
+ Assert.IsNotNull(testingTarget, "Can't create success object RelativeVector4TypeConverter.");
+ Assert.IsInstanceOf<RelativeVector4TypeConverter>(testingTarget, "Should return RelativeVector4TypeConverter instance.");
+
+ // length is 4
+ var result = testingTarget.ConvertFromInvariantString("100, 50, 30, 10");
+ tlog.Debug(tag, "ConvertFromInvariantString : " + result);
+
+ // length is 3
+ result = testingTarget.ConvertFromInvariantString("100, 50, 30");
+ tlog.Debug(tag, "ConvertFromInvariantString : " + result);
+
+ // length is 2
+ result = testingTarget.ConvertFromInvariantString("100, 50");
+ tlog.Debug(tag, "ConvertFromInvariantString : " + result);
+
+ // length is 1
+ result = testingTarget.ConvertFromInvariantString("100");
+ tlog.Debug(tag, "ConvertFromInvariantString : " + result);
+
+ try
+ {
+ // lenght is 5
+ result = testingTarget.ConvertFromInvariantString("100, 50, 30, 10, 0.3f");
+ }
+ catch (InvalidOperationException)
+ {
+ tlog.Debug(tag, $"RelativeVector4TypeConverterConvertFromInvariantString END");
+ Assert.Pass("Caught InvalidOperationException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RelativeVector4TypeConverter ConvertToString")]
+ [Property("SPEC", "Tizen.NUI.RelativeVector4TypeConverter.ConvertToString M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void RelativeVector4TypeConverterConvertToString()
+ {
+ tlog.Debug(tag, $"RelativeVector4TypeConverterConvertToString START");
+
+ var testingTarget = new RelativeVector4TypeConverterImpl();
+ Assert.IsNotNull(testingTarget, "Can't create success object RelativeVector4TypeConverter.");
+ Assert.IsInstanceOf<RelativeVector4TypeConverter>(testingTarget, "Should return RelativeVector4TypeConverter instance.");
+
+ // null
+ var result = testingTarget.ConvertToString(0.3f);
+ tlog.Debug(tag, "ConvertToString : " + result);
+
+ using (RelativeVector4 vec = new RelativeVector4(0.1f, 0.3f, 0.5f, 0.0f))
+ {
+ result = testingTarget.ConvertToString(vec);
+ tlog.Debug(tag, "ConvertToString : " + result);
+ }
+
+ tlog.Debug(tag, $"RelativeVector4TypeConverterConvertToString END");
+ }
+ }
+}
tlog.Debug(tag, $"ApplicationResourcePathExtensionProvideValue END");
}
-
-
}
}
\ No newline at end of file
try
{
- var item = array.Items;
+ var item = array.Items; // empty
tlog.Debug(tag, "Items : " + item);
}
catch (Exception e)
[Test]
[Category("P1")]
- [Description("ArrayExtension Type")]
- [Property("SPEC", "Tizen.NUI.ArrayExtension.Type A")]
+ [Description("ArrayExtension ProvideValue")]
+ [Property("SPEC", "Tizen.NUI.ArrayExtension.ProvideValue A")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PRW")]
- public void ArrayExtensionType()
+ public void ArrayExtensionProvideValue()
{
- tlog.Debug(tag, $"ArrayExtensionType START");
+ tlog.Debug(tag, $"ArrayExtensionProvideValue START");
try
{
- var type = array.Type;
- array.Type = type;
- Assert.AreEqual(type, array.Type, "Should be equal");
+ array.Type = typeof(string);
+ tlog.Debug(tag, "Type : " + array.Type);
+ array.ProvideValue(new IServiceProviderImpl());
}
catch (Exception e)
{
Assert.Fail("Caught Exception : Failed!");
}
- tlog.Debug(tag, $"ArrayExtensionType END");
+ tlog.Debug(tag, $"ArrayExtensionProvideValue END");
}
[Test]
- [Category("P1")]
+ [Category("P2")]
[Description("ArrayExtension ProvideValue")]
[Property("SPEC", "Tizen.NUI.ArrayExtension.ProvideValue A")]
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PRW")]
- public void ArrayExtensionProvideValue()
+ public void ArrayExtensionProvideValueWithNullType()
{
- tlog.Debug(tag, $"ArrayExtensionProvideValue START");
+ tlog.Debug(tag, $"ArrayExtensionProvideValueWithNullType START");
try
{
- array.Type = typeof(string);
+ array.Type = null;
array.ProvideValue(new IServiceProviderImpl());
}
- catch (Exception e)
+ catch (InvalidOperationException e)
{
tlog.Debug(tag, e.Message.ToString());
- Assert.Fail("Caught Exception : Failed!");
+ tlog.Debug(tag, $"ArrayExtensionProvideValueWithNullType END");
+ Assert.Pass("Caught InvalidOperationException : Passed!");
}
-
- tlog.Debug(tag, $"ArrayExtensionProvideValue END");
}
}
}
\ No newline at end of file
-using NUnit.Framework;
-using System;
-using Tizen.NUI.Xaml;
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
namespace Tizen.NUI.Devel.Tests
{
public class PublicReferenceExtensionTest
{
private const string tag = "NUITEST";
- private ReferenceExtension reference;
+ private Tizen.NUI.Xaml.ReferenceExtension reference;
+
+ internal class IServiceProviderImpl : IServiceProvider
+ {
+ public object GetService(Type serviceType) { return null; }
+ }
[SetUp]
public void Init()
{
tlog.Info(tag, "Init() is called!");
- reference = new ReferenceExtension();
+ reference = new Tizen.NUI.Xaml.ReferenceExtension();
}
[TearDown]
tlog.Debug(tag, $"ReferenceExtensionName END");
}
+
+ [Test]
+ [Category("P2")]
+ [Description("ReferenceExtension ProvideValue")]
+ [Property("SPEC", "Tizen.NUI.ReferenceExtension.ProvideValue M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void ReferenceExtensionProvideValue()
+ {
+ tlog.Debug(tag, $"ReferenceExtensionProvideValue START");
+
+ try
+ {
+ reference.ProvideValue(new IServiceProviderImpl()); // serviceProvider is null
+ }
+ catch (ArgumentException e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"ReferenceExtensionProvideValue END");
+ Assert.Pass("Caught ArgumentException : Passed!");
+ }
+
+
+ }
}
}
\ 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;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Xaml/MarkupExtensions/ResourcePathExtension")]
+ public class PublicResourcePathExtensionTest
+ {
+ private const string tag = "NUITEST";
+ private string filePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Test_Theme.xaml";
+
+ internal class IServiceProviderImpl : IServiceProvider
+ {
+ public object GetService(Type serviceType) { return null; }
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ResourcePathExtension constructor.")]
+ [Property("SPEC", "Tizen.NUI.ResourcePathExtension.ResourcePathExtension C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ResourcePathExtensionConstructor()
+ {
+ tlog.Debug(tag, $"ResourcePathExtensionConstructor START");
+
+ var testingTarget = new Tizen.NUI.Xaml.ResourcePathExtension();
+ Assert.IsNotNull(testingTarget, "Can't create success object ResourcePathExtension.");
+ Assert.IsInstanceOf<Tizen.NUI.Xaml.ResourcePathExtension>(testingTarget, "Should return ResourcePathExtension instance.");
+
+ testingTarget.FilePath = filePath;
+ tlog.Error(tag, "FilePath : " + testingTarget.FilePath);
+
+ var result = testingTarget.ProvideValue(new IServiceProviderImpl());
+ tlog.Error(tag, "ProviderValue : " + result);
+
+ testingTarget = null;
+ tlog.Debug(tag, $"ResourcePathExtensionConstructor END (OK)");
+ }
+ }
+}
private const string tag = "NUITEST";
private StaticExtension sExtention;
+ internal class IServiceProviderImpl : IServiceProvider
+ {
+ public object GetService(Type serviceType) { return null; }
+ }
+
[SetUp]
public void Init()
{
tlog.Debug(tag, $"StaticExtensionMember END");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("StaticExtension ProvideValue")]
+ [Property("SPEC", "Tizen.NUI.StaticExtension.ProvideValue M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void StaticExtensionProvideValue()
+ {
+ tlog.Debug(tag, $"StaticExtensionProvideValue START");
+
+ try
+ {
+ sExtention.ProvideValue(new IServiceProviderImpl()); // IXamlTypeResolver is null
+ }
+ catch (ArgumentException e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"StaticExtensionProvideValue END");
+ Assert.Pass("Caught ArgumentException : Passed!");
+ }
+ }
}
}
\ 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;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Xaml/MarkupExtensions/ThemeResourcePathExtension")]
+ public class PublicThemeResourcePathExtensionTest
+ {
+ private const string tag = "NUITEST";
+ private string filePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Test_Theme.xaml";
+
+ internal class IServiceProviderImpl : IServiceProvider
+ {
+ public object GetService(Type serviceType) { return null; }
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ThemeResourcePathExtension constructor.")]
+ [Property("SPEC", "Tizen.NUI.ThemeResourcePathExtension.ThemeResourcePathExtension C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ThemeResourcePathExtensionConstructor()
+ {
+ tlog.Debug(tag, $"ThemeResourcePathExtensionConstructor START");
+
+ var testingTarget = new Tizen.NUI.Xaml.ThemeResourcePathExtension();
+ Assert.IsNotNull(testingTarget, "Can't create success object ThemeResourcePathExtension.");
+ Assert.IsInstanceOf<Tizen.NUI.Xaml.ThemeResourcePathExtension>(testingTarget, "Should return ThemeResourcePathExtension instance.");
+
+ testingTarget.FilePath = filePath;
+ tlog.Error(tag, "FilePath : " + testingTarget.FilePath);
+
+ var result = testingTarget.ProvideValue(new IServiceProviderImpl());
+ tlog.Error(tag, "ProviderValue : " + result);
+
+ testingTarget = null;
+ tlog.Debug(tag, $"ThemeResourcePathExtensionConstructor END (OK)");
+ }
+ }
+}
{
private const string tag = "NUITEST";
private TypeExtension tExtension;
+
+ internal class IServiceProviderImpl : IServiceProvider
+ {
+ public object GetService(Type serviceType) { return null; }
+ }
+
[SetUp]
public void Init()
{
tlog.Debug(tag, $"TypeExtensionTypeName END");
}
+
+ [Test]
+ [Category("P2")]
+ [Description("TypeExtension ProvideValue")]
+ [Property("SPEC", "Tizen.NUI.TypeExtension.ProvideValue M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ public void TypeExtensionProvideValue()
+ {
+ tlog.Debug(tag, $"TypeExtensionProvideValue START");
+
+ try
+ {
+ tExtension.TypeName = this.GetType().ToString();
+ var type = tExtension.ProvideValue(new IServiceProviderImpl());
+ tlog.Error(tag, "Type : " + type);
+ }
+ catch (ArgumentException e) // typeResolver is null
+ {
+ tlog.Error(tag, e.Message.ToString());
+ tlog.Debug(tag, $"TypeExtensionProvideValue END");
+ Assert.Pass("Caught Exception : Passed!");
+ }
+ }
}
}
\ No newline at end of file