From 35a6fcd3b9fa0f0df4c8fa418df2bdb234017a68 Mon Sep 17 00:00:00 2001 From: "guowei.wang" Date: Tue, 31 Aug 2021 20:51:09 +0800 Subject: [PATCH] [NUI] Update TCs of NUI.Devel. --- .../internal/Common/TSNativeImageInterface.cs | 112 +++- .../testcase/internal/Common/TSObjectRegistry.cs | 131 +++++ .../internal/Common/TSPropertyRegistration.cs | 58 +++ .../testcase/internal/Common/TSRenderTask.cs | 343 ++++++------- .../testcase/internal/Common/TSRulerPtr.cs | 569 +++++++++++---------- .../internal/Common/TSStringToVoidSignal.cs | 56 +- .../testcase/internal/Common/TSViewImpl.cs | 338 ++++++++++++ .../testcase/internal/Common/TSViewWrapperImpl.cs | 123 +++++ .../internal/FrameBroker/TSFrameBrokerBase.cs | 63 +++ .../testcase/internal/Utility/TSBuilder.cs | 92 ++-- .../internal/Utility/TSGaussianBlurView.cs | 212 ++++++++ .../testcase/internal/Utility/TSPageTurnView.cs | 324 ++++++++++++ .../internal/Xaml/TSApplyPropertiesVisitor.cs | 364 ++----------- .../internal/Xaml/TSCreateValuesVisitor.cs | 354 ++----------- .../testcase/internal/Xaml/TSDesignMode.cs | 14 +- .../internal/Xaml/TSExpandMarkupsVisitor.cs | 243 ++------- .../Xaml/TSFillResourceDictionariesVisitor.cs | 217 +------- .../testcase/internal/Xaml/TSHydrationContext.cs | 51 +- .../internal/Xaml/TSIDictionaryExtensions.cs | 28 +- .../internal/Xaml/TSMarkupExpressionParser.cs | 118 ++--- .../internal/Xaml/TSMarkupExtensionParser.cs | 35 +- .../testcase/internal/Xaml/TSNamescopingVisitor.cs | 358 +------------ .../internal/Xaml/TSPruneIgnoredNodesVisitor.cs | 263 +++------- .../internal/Xaml/TSReflectionExtensions.cs | 310 ++--------- .../Common/TSFrameUpdateCallbackInterface.cs | 53 +- .../testcase/public/Common/TSLayer.cs | 135 ++++- .../testcase/public/Common/TSProperty.cs | 9 + .../testcase/public/Common/TSVector3.cs | 110 ++++ .../testcase/public/Common/TSVector4.cs | 75 +++ .../public/CustomView/TSCustomViewRegistry.cs | 75 +++ .../public/Events/TSLongPressGestureDetector.cs | 51 +- .../public/Events/TSPinchGestureDetector.cs | 46 +- .../public/Events/TSRotationGestureDetector.cs | 13 +- .../testcase/public/Events/TSTapGestureDetector.cs | 29 +- .../testcase/public/Images/TSPixelData.cs | 12 +- .../public/Theme/TSExternalThemeManager.cs | 26 +- .../testcase/public/Theme/TSTheme.cs | 361 ++++++++----- .../testcase/public/Theme/TSThemeManager.cs | 112 +++- .../testcase/public/Window/TSWindow.cs | 45 +- .../TSApplicationResourcePathExtension.cs | 59 +-- .../Xaml/MarkupExtensions/TSArrayExtension.cs | 64 +-- .../Xaml/MarkupExtensions/TSBindingExtension.cs | 142 +++-- .../MarkupExtensions/TSDynamicResourceExtension.cs | 37 +- .../MarkupExtensions/TSNUIResourcePathExtension.cs | 59 +-- .../Xaml/MarkupExtensions/TSNullExtension.cs | 22 +- .../Xaml/MarkupExtensions/TSReferenceExtension.cs | 49 +- .../Xaml/MarkupExtensions/TSStaticExtension.cs | 49 +- .../MarkupExtensions/TSTemplateBindingExtension.cs | 82 ++- .../Xaml/MarkupExtensions/TSTypeExtension.cs | 50 +- .../public/Xaml/TSProvideCompiledAttribute.cs | 28 +- .../public/Xaml/TSStaticResourceExtension.cs | 139 +---- .../public/Xaml/TSTypeConversionAttribute.cs | 46 +- .../testcase/public/Xaml/TSViewExtensions.cs | 76 +-- .../testcase/public/Xaml/TSXaml.cs | 59 +++ .../public/Xaml/TSXamlCompilationAttribute.cs | 40 +- .../public/Xaml/TSXamlFilePathAttribute.cs | 8 +- .../testcase/public/Xaml/TSXamlParseException.cs | 99 ++-- .../public/Xaml/TSXamlResourceIdAttribute.cs | 141 +---- .../testcase/public/Xaml/TSXamlServiceProvider.cs | 568 ++++---------------- .../testcase/public/Xaml/TSXmlLineInfo.cs | 62 +-- .../public/Xaml/TotalSample/TotalSample.xaml | 74 +++ .../public/Xaml/TotalSample/TotalSample.xaml.cs | 47 ++ .../public/Xaml/TotalSample/TotalSample.xaml.g.cs | 57 +++ .../testcase/public/Xaml/TotalSample/UIElement.cs | 124 +++++ 64 files changed, 3961 insertions(+), 4148 deletions(-) create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSPropertyRegistration.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSViewImpl.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSViewWrapperImpl.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/FrameBroker/TSFrameBrokerBase.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Utility/TSGaussianBlurView.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/CustomView/TSCustomViewRegistry.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXaml.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TotalSample/TotalSample.xaml create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TotalSample/TotalSample.xaml.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TotalSample/TotalSample.xaml.g.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TotalSample/UIElement.cs diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSNativeImageInterface.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSNativeImageInterface.cs index ae338f9..70746f4 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSNativeImageInterface.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSNativeImageInterface.cs @@ -37,16 +37,116 @@ namespace Tizen.NUI.Devel.Tests { 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(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(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(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(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(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(testingTarget, "Should be an Instance of NativeImageSource!"); + + var result = testingTarget.RequiresBlending(); + tlog.Debug(tag, "RequiresBlending : " + result); + + testingTarget.Dispose(); + tlog.Debug(tag, $"NativeImageInterfaceRequiresBlending END (OK)"); } } } diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSObjectRegistry.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSObjectRegistry.cs index 7f63eed..b2ca3e2 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSObjectRegistry.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSObjectRegistry.cs @@ -43,8 +43,139 @@ namespace Tizen.NUI.Devel.Tests Assert.IsNotNull(testingTarget, "null handle"); Assert.IsInstanceOf(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(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(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(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(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(testingTarget, "Should return ObjectRegistry instance."); + + var createdSignal = testingTarget.ObjectCreatedSignal(); + Assert.IsInstanceOf(createdSignal, "Should return ObjectCreatedSignal instance."); + + var destroyedSignal = testingTarget.ObjectDestroyedSignal(); + Assert.IsInstanceOf(destroyedSignal, "Should return ObjectDestroyedSignal instance."); + + testingTarget.Dispose(); + } + + tlog.Debug(tag, $"ObjectRegistryObjectCreatedSignal END (OK)"); + } } } diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSPropertyRegistration.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSPropertyRegistration.cs new file mode 100755 index 0000000..81dbc24 --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSPropertyRegistration.cs @@ -0,0 +1,58 @@ +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(testingTarget, "Should return PropertyRegistration instance."); + + testingTarget.Dispose(); + } + + tlog.Debug(tag, $"PropertyRegistrationConstructor END (OK)"); + } + } +} diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSRenderTask.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSRenderTask.cs index 90dbb82..73fe00d 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSRenderTask.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSRenderTask.cs @@ -423,41 +423,41 @@ namespace Tizen.NUI.Devel.Tests // 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(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(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")] @@ -506,9 +506,9 @@ namespace Tizen.NUI.Devel.Tests //{ // 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(testingTarget, "Should return RenderTask instance."); @@ -534,44 +534,44 @@ namespace Tizen.NUI.Devel.Tests // 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(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(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")] @@ -612,44 +612,41 @@ namespace Tizen.NUI.Devel.Tests 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(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(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")] @@ -662,26 +659,17 @@ namespace Tizen.NUI.Devel.Tests //{ // 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(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(); @@ -701,26 +689,17 @@ namespace Tizen.NUI.Devel.Tests //{ // 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(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(); @@ -740,26 +719,17 @@ namespace Tizen.NUI.Devel.Tests //{ // 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(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(); @@ -780,26 +750,17 @@ namespace Tizen.NUI.Devel.Tests //{ // 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(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(); @@ -826,20 +787,16 @@ namespace Tizen.NUI.Devel.Tests Assert.IsNotNull(testingTarget, "Can't create success object RenderTask."); Assert.IsInstanceOf(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(); @@ -866,20 +823,16 @@ namespace Tizen.NUI.Devel.Tests Assert.IsNotNull(testingTarget, "Can't create success object RenderTask."); Assert.IsInstanceOf(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(); @@ -906,20 +859,16 @@ namespace Tizen.NUI.Devel.Tests Assert.IsNotNull(testingTarget, "Can't create success object RenderTask."); Assert.IsInstanceOf(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(); @@ -940,9 +889,9 @@ namespace Tizen.NUI.Devel.Tests //{ // 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(testingTarget, "Should return RenderTask instance."); diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSRulerPtr.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSRulerPtr.cs index fa4e777..e8e70ea 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSRulerPtr.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSRulerPtr.cs @@ -165,6 +165,30 @@ namespace Tizen.NUI.Devel.Tests [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(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", "-")] @@ -189,12 +213,42 @@ namespace Tizen.NUI.Devel.Tests 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(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", "-")] @@ -205,7 +259,7 @@ namespace Tizen.NUI.Devel.Tests { tlog.Debug(tag, $"RulerPtrDetach START"); - var testingTarget = new RulerPtr(); + var testingTarget = new RulerPtr(new DefaultRuler()); Assert.IsNotNull(testingTarget, "null handle"); Assert.IsInstanceOf(testingTarget, "Should return RulerPtr instance."); @@ -216,286 +270,235 @@ namespace Tizen.NUI.Devel.Tests 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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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)"); + } } } diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSStringToVoidSignal.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSStringToVoidSignal.cs index a0159a9..14d3c1e 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSStringToVoidSignal.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSStringToVoidSignal.cs @@ -148,33 +148,33 @@ namespace Tizen.NUI.Devel.Tests 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)"); + //} } } diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSViewImpl.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSViewImpl.cs new file mode 100755 index 0000000..c9cdb12 --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSViewImpl.cs @@ -0,0 +1,338 @@ +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(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(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(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(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(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(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(testingTarget, "should be an instance of testing target class!"); + + var pinchGesture = testingTarget.viewWrapperImpl.GetPinchGestureDetector(); + Assert.IsInstanceOf(pinchGesture, "should be an instance of testing target class!"); + + var panGesture = testingTarget.viewWrapperImpl.GetPanGestureDetector(); + Assert.IsInstanceOf(panGesture, "should be an instance of testing target class!"); + + var tapGesture = testingTarget.viewWrapperImpl.GetTapGestureDetector(); + Assert.IsInstanceOf(tapGesture, "should be an instance of testing target class!"); + + var pressGesture = testingTarget.viewWrapperImpl.GetLongPressGestureDetector(); + Assert.IsInstanceOf(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(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(testingTarget, "should be an instance of testing target class!"); + + var signal = testingTarget.viewWrapperImpl.KeyEventSignal(); + Assert.IsInstanceOf(signal, "Should return ControlKeySignal instance."); + + var focusGained = testingTarget.viewWrapperImpl.KeyInputFocusGainedSignal(); + Assert.IsInstanceOf(focusGained, "Should return ControlKeySignal instance."); + + var focusLost = testingTarget.viewWrapperImpl.KeyInputFocusLostSignal(); + Assert.IsInstanceOf(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(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)"); + //} + } +} diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSViewWrapperImpl.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSViewWrapperImpl.cs new file mode 100755 index 0000000..58ef749 --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSViewWrapperImpl.cs @@ -0,0 +1,123 @@ +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(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(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(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)"); + } + } +} diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/FrameBroker/TSFrameBrokerBase.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/FrameBroker/TSFrameBrokerBase.cs new file mode 100755 index 0000000..b66485e --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/FrameBroker/TSFrameBrokerBase.cs @@ -0,0 +1,63 @@ +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(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!"); + } + } + } + } +} diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Utility/TSBuilder.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Utility/TSBuilder.cs index 1d1e622..dcf95dd 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Utility/TSBuilder.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Utility/TSBuilder.cs @@ -283,35 +283,69 @@ namespace Tizen.NUI.Devel.Tests 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(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(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(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) { diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Utility/TSGaussianBlurView.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Utility/TSGaussianBlurView.cs new file mode 100755 index 0000000..8968164 --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Utility/TSGaussianBlurView.cs @@ -0,0 +1,212 @@ +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(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(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(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(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(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(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(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) { } + } +} diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Utility/TSPageTurnView.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Utility/TSPageTurnView.cs index 1b07d28..708cb91 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Utility/TSPageTurnView.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Utility/TSPageTurnView.cs @@ -13,17 +13,341 @@ namespace Tizen.NUI.Devel.Tests 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(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(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(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(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(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(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(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(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(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(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(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) { } } } diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSApplyPropertiesVisitor.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSApplyPropertiesVisitor.cs index f49a985..35ab619 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSApplyPropertiesVisitor.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSApplyPropertiesVisitor.cs @@ -1,8 +1,8 @@ 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 @@ -11,18 +11,25 @@ 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 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] @@ -34,47 +41,10 @@ namespace Tizen.NUI.Devel.Tests [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(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>(testingTarget, "Should be an instance of IList 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"); @@ -90,16 +60,15 @@ namespace Tizen.NUI.Devel.Tests 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"); @@ -115,7 +84,7 @@ namespace Tizen.NUI.Devel.Tests Assert.Fail("Caught Exception : Failed!"); } - tlog.Debug(tag, $"ApplyPropertiesVisitorStopOnDataTemplate END (OK)"); + tlog.Debug(tag, $"ApplyPropertiesVisitorStopOnDataTemplate END"); } [Test] @@ -124,7 +93,6 @@ namespace Tizen.NUI.Devel.Tests [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"); @@ -140,16 +108,15 @@ namespace Tizen.NUI.Devel.Tests 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"); @@ -165,23 +132,7 @@ namespace Tizen.NUI.Devel.Tests Assert.Fail("Caught Exception : Failed!"); } - tlog.Debug(tag, $"ApplyPropertiesVisitorVisitNodeOnDataTemplate END (OK)"); - } - - internal class INodeImplement : INode - { - public global::System.Collections.Generic.List 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] @@ -196,271 +147,22 @@ namespace Tizen.NUI.Devel.Tests 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 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 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 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSCreateValuesVisitor.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSCreateValuesVisitor.cs index 5d9311a..b4a0ed8 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSCreateValuesVisitor.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSCreateValuesVisitor.cs @@ -11,46 +11,36 @@ namespace Tizen.NUI.Devel.Tests [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 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", "-")] @@ -61,16 +51,16 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -85,16 +75,16 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -109,16 +99,16 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -133,35 +123,16 @@ namespace Tizen.NUI.Devel.Tests 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 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] @@ -176,261 +147,22 @@ namespace Tizen.NUI.Devel.Tests 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 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 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 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 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 Properties => throw new NotImplementedException(); - - // public List SkipProperties => throw new NotImplementedException(); - - // public INameScope Namescope => throw new NotImplementedException(); - - // public XmlType XmlType => throw new NotImplementedException(); - - // public string NamespaceURI => throw new NotImplementedException(); - - // public List CollectionItems => throw new NotImplementedException(); - - // public List 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSDesignMode.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSDesignMode.cs index 3e26363..e994086 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSDesignMode.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSDesignMode.cs @@ -8,7 +8,7 @@ namespace Tizen.NUI.Devel.Tests [TestFixture] [Description("internal/Xaml/DesignMode")] - public class InternalXamlDesignModeTest + public class InternalDesignModeTest { private const string tag = "NUITEST"; @@ -36,17 +36,17 @@ namespace Tizen.NUI.Devel.Tests 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSExpandMarkupsVisitor.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSExpandMarkupsVisitor.cs index 643d10b..014f185 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSExpandMarkupsVisitor.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSExpandMarkupsVisitor.cs @@ -14,68 +14,33 @@ namespace Tizen.NUI.Devel.Tests public class InternalExpandMarkupsVisitorTest { private const string tag = "NUITEST"; - private ExpandMarkupsVisitor e1; + private ExpandMarkupsVisitor visitor; + + internal class INodeImpl : INode + { + public global::System.Collections.Generic.List 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 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", "-")] @@ -86,16 +51,16 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -110,16 +75,16 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -134,16 +99,16 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -158,35 +123,16 @@ namespace Tizen.NUI.Devel.Tests 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 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] @@ -201,127 +147,22 @@ namespace Tizen.NUI.Devel.Tests 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 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 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSFillResourceDictionariesVisitor.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSFillResourceDictionariesVisitor.cs index ab0ec3b..7054577 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSFillResourceDictionariesVisitor.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSFillResourceDictionariesVisitor.cs @@ -10,45 +10,27 @@ namespace Tizen.NUI.Devel.Tests [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", "-")] @@ -59,16 +41,16 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -83,16 +65,16 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -107,16 +89,16 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -131,170 +113,17 @@ namespace Tizen.NUI.Devel.Tests 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 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 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 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 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSHydrationContext.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSHydrationContext.cs index 665e59a..19894e8 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSHydrationContext.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSHydrationContext.cs @@ -9,21 +9,22 @@ namespace Tizen.NUI.Devel.Tests [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!"); } @@ -39,16 +40,16 @@ namespace Tizen.NUI.Devel.Tests try { - Dictionary 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] @@ -63,16 +64,16 @@ namespace Tizen.NUI.Devel.Tests try { - Dictionary 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] @@ -87,17 +88,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -112,17 +113,17 @@ namespace Tizen.NUI.Devel.Tests try { - Action 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSIDictionaryExtensions.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSIDictionaryExtensions.cs index 10f24f1..7e37ce7 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSIDictionaryExtensions.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSIDictionaryExtensions.cs @@ -6,7 +6,7 @@ namespace Tizen.NUI.Devel.Tests [TestFixture] [Description("internal/Xaml/IDictionaryExtensions")] - public class InternalXamlIDictionaryExtensionsTest + public class InternalIDictionaryExtensionsTest { private const string tag = "NUITEST"; @@ -21,31 +21,5 @@ namespace Tizen.NUI.Devel.Tests { 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 dic = new Dictionary(); - // IEnumerable> keyValuePairs = new IEnumerable>(); - // IDictionaryExtensions.AddRange(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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSMarkupExpressionParser.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSMarkupExpressionParser.cs index a5df9c1..f8a49eb 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSMarkupExpressionParser.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSMarkupExpressionParser.cs @@ -8,78 +8,47 @@ namespace Tizen.NUI.Devel.Tests [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] @@ -94,17 +63,16 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -119,39 +87,15 @@ namespace Tizen.NUI.Devel.Tests 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSMarkupExtensionParser.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSMarkupExtensionParser.cs index 0f39fd2..ff417e0 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSMarkupExtensionParser.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSMarkupExtensionParser.cs @@ -8,32 +8,30 @@ namespace Tizen.NUI.Devel.Tests [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")] @@ -46,18 +44,17 @@ namespace Tizen.NUI.Devel.Tests 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSNamescopingVisitor.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSNamescopingVisitor.cs index 9ca5bfb..b7570f7 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSNamescopingVisitor.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSNamescopingVisitor.cs @@ -10,373 +10,23 @@ namespace Tizen.NUI.Devel.Tests [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 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 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 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 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 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 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSPruneIgnoredNodesVisitor.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSPruneIgnoredNodesVisitor.cs index f070893..1a2b22c 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSPruneIgnoredNodesVisitor.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSPruneIgnoredNodesVisitor.cs @@ -10,22 +10,31 @@ namespace Tizen.NUI.Devel.Tests [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 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!"); } @@ -41,274 +50,118 @@ namespace Tizen.NUI.Devel.Tests 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 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 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 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 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 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 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSReflectionExtensions.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSReflectionExtensions.cs index 2de76f7..b126698 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSReflectionExtensions.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Xaml/TSReflectionExtensions.cs @@ -8,7 +8,7 @@ namespace Tizen.NUI.Devel.Tests [TestFixture] [Description("internal/Xaml/ReflectionExtensions")] - public class InternalXamlReflectionExtensionsTest + public class InternalReflectionExtensionsTest { private const string tag = "NUITEST"; @@ -24,184 +24,44 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -216,18 +76,15 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -242,92 +99,15 @@ namespace Tizen.NUI.Devel.Tests 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSFrameUpdateCallbackInterface.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSFrameUpdateCallbackInterface.cs index 8a9671f..11e24f8 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSFrameUpdateCallbackInterface.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSFrameUpdateCallbackInterface.cs @@ -80,6 +80,56 @@ namespace Tizen.NUI.Devel.Tests [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(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(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", "-")] @@ -96,14 +146,13 @@ namespace Tizen.NUI.Devel.Tests 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)"); } diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSLayer.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSLayer.cs index ddb7db5..333cd5c 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSLayer.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSLayer.cs @@ -42,6 +42,15 @@ namespace Tizen.NUI.Devel.Tests var testingTarget = new Layer(); Assert.IsNotNull(testingTarget, "null handle"); Assert.IsInstanceOf(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)"); @@ -49,6 +58,96 @@ namespace Tizen.NUI.Devel.Tests [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(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(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(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", "-")] @@ -62,10 +161,13 @@ namespace Tizen.NUI.Devel.Tests Assert.IsNotNull(testingTarget, "null handle"); Assert.IsInstanceOf(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(); @@ -119,6 +221,7 @@ namespace Tizen.NUI.Devel.Tests testingTarget.Dispose(); tlog.Debug(tag, $"LayerName END (OK)"); } + [Test] [Category("P1")] [Description("Layer Viewport.")] @@ -149,6 +252,36 @@ namespace Tizen.NUI.Devel.Tests [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(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", "-")] diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSProperty.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSProperty.cs index 714c717..4b723f7 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSProperty.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSProperty.cs @@ -46,6 +46,15 @@ namespace Tizen.NUI.Devel.Tests Assert.IsNotNull(testingTarget, "Should be not null!"); Assert.IsInstanceOf(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)"); diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSVector3.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSVector3.cs index 60f8a52..7289c66 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSVector3.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSVector3.cs @@ -961,5 +961,115 @@ namespace Tizen.NUI.Devel.Tests 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(testingTarget, "Should be an instance of Vector3 type."); + + var result = testingTarget.Clone(); + Assert.IsInstanceOf(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(testingTarget, "Should be an instance of Vector3 type."); + + var result = Vector3.GetVector3FromPtr(testingTarget.SwigCPtr.Handle); + Assert.IsInstanceOf(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(testingTarget, "Should be an instance of Vector3 type."); + + var result = testingTarget.AsFloat(); + Assert.IsInstanceOf(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(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(testingTarget, "Should be an instance of Vector3 type."); + + var result = testingTarget.Cross(testingTarget); + Assert.IsInstanceOf(result, "Should be an instance of Vector3 type."); + + testingTarget.Dispose(); + tlog.Debug(tag, $"Vector3Cross END (OK)"); + } } } diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSVector4.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSVector4.cs index a8cf915..e1558b6 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSVector4.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Common/TSVector4.cs @@ -944,5 +944,80 @@ namespace Tizen.NUI.Devel.Tests 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(testingTarget, "Should be an instance of Vector4 type."); + + var result = testingTarget.AsFloat(); + Assert.IsInstanceOf(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(testingTarget, "Should be an instance of Vector4 type."); + + var result = testingTarget.Cross(testingTarget); + Assert.IsInstanceOf(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(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)"); + } } } diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/CustomView/TSCustomViewRegistry.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/CustomView/TSCustomViewRegistry.cs new file mode 100755 index 0000000..a4cdd00 --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/CustomView/TSCustomViewRegistry.cs @@ -0,0 +1,75 @@ +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 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(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!"); + } + } + } +} diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Events/TSLongPressGestureDetector.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Events/TSLongPressGestureDetector.cs index 28c5208..6fdea8e 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Events/TSLongPressGestureDetector.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Events/TSLongPressGestureDetector.cs @@ -349,5 +349,54 @@ namespace Tizen.NUI.Devel.Tests 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(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(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)"); + } + } } diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Events/TSPinchGestureDetector.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Events/TSPinchGestureDetector.cs index e120de9..83b642e 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Events/TSPinchGestureDetector.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Events/TSPinchGestureDetector.cs @@ -139,15 +139,16 @@ namespace Tizen.NUI.Devel.Tests 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(testingTarget, "Should be an instance of PinchGestureDetector type."); + + testingTarget.Dispose(); + } + + tlog.Debug(tag, $"PinchGestureDetectorAssign END (OK)"); } [Test] @@ -191,6 +192,33 @@ namespace Tizen.NUI.Devel.Tests } 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(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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Events/TSRotationGestureDetector.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Events/TSRotationGestureDetector.cs index 5a9f172..c21d3c9 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Events/TSRotationGestureDetector.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Events/TSRotationGestureDetector.cs @@ -138,15 +138,16 @@ namespace Tizen.NUI.Devel.Tests 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(testingTarget, "Should be an instance of RotationGestureDetector type."); + + testingTarget.Dispose(); + } - b1.Dispose(); - a1.Dispose(); - tlog.Debug(tag, $"RotationGestureDetectorAssign END (OK)"); - Assert.Pass("RotationGestureDetectorAssign"); } [Test] diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Events/TSTapGestureDetector.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Events/TSTapGestureDetector.cs index 3b05bb0..857179b 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Events/TSTapGestureDetector.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Events/TSTapGestureDetector.cs @@ -282,6 +282,33 @@ namespace Tizen.NUI.Devel.Tests } 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(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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Images/TSPixelData.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Images/TSPixelData.cs index 27af0d3..e58cf7b 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Images/TSPixelData.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Images/TSPixelData.cs @@ -41,7 +41,7 @@ namespace Tizen.NUI.Devel.Tests 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(testingTarget, "Should be an instance of PixelData type."); @@ -63,7 +63,7 @@ namespace Tizen.NUI.Devel.Tests 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"); @@ -89,7 +89,7 @@ namespace Tizen.NUI.Devel.Tests 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(testingTarget, "Should be an instance of PixelData type."); @@ -114,7 +114,7 @@ namespace Tizen.NUI.Devel.Tests 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(testingTarget, "Should be an instance of PixelData type."); @@ -139,7 +139,7 @@ namespace Tizen.NUI.Devel.Tests 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(testingTarget, "Should be an instance of PixelData type."); @@ -164,7 +164,7 @@ namespace Tizen.NUI.Devel.Tests 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(testingTarget, "Should be an instance of PixelData type."); diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Theme/TSExternalThemeManager.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Theme/TSExternalThemeManager.cs index 824255b..bd97f09 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Theme/TSExternalThemeManager.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Theme/TSExternalThemeManager.cs @@ -14,7 +14,7 @@ namespace Tizen.NUI.Devel.Tests 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() @@ -61,5 +61,29 @@ namespace Tizen.NUI.Devel.Tests 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Theme/TSTheme.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Theme/TSTheme.cs index c3c2563..095e136 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Theme/TSTheme.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Theme/TSTheme.cs @@ -13,16 +13,24 @@ namespace Tizen.NUI.Devel.Tests 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> changedResources = new List>() { new KeyValuePair("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!"); } @@ -39,7 +47,7 @@ namespace Tizen.NUI.Devel.Tests try { - Theme a1 = new Theme(""); + var testingTarget = new Theme(""); } catch (ArgumentNullException e) { @@ -50,6 +58,75 @@ namespace Tizen.NUI.Devel.Tests } [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")] @@ -59,13 +136,12 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -78,12 +154,11 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -96,12 +171,84 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -114,48 +261,78 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -168,12 +345,18 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -187,27 +370,22 @@ namespace Tizen.NUI.Devel.Tests { tlog.Debug(tag, $"ThemeMerge START"); + var testingTarget = new Theme(); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(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) { @@ -228,13 +406,11 @@ namespace Tizen.NUI.Devel.Tests 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) { @@ -242,57 +418,29 @@ namespace Tizen.NUI.Devel.Tests 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(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] @@ -305,28 +453,11 @@ namespace Tizen.NUI.Devel.Tests 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)"); } } } diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Theme/TSThemeManager.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Theme/TSThemeManager.cs index 13982f2..c8e377f 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Theme/TSThemeManager.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Theme/TSThemeManager.cs @@ -14,6 +14,7 @@ namespace Tizen.NUI.Devel.Tests internal class PublicThemeManagerTest { private const string tag = "NUITEST"; + private string path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Test_Theme.xaml"; [SetUp] public void Init() @@ -29,7 +30,7 @@ namespace Tizen.NUI.Devel.Tests [Test] [Category("P1")] - [Description("Test ThemeManager CurrentTheme.")] + [Description("ThemeManager CurrentTheme.")] [Property("SPEC", "Tizen.NUI.ThemeManager.CurrentTheme A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] @@ -38,11 +39,36 @@ namespace Tizen.NUI.Devel.Tests { 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] @@ -56,14 +82,49 @@ namespace Tizen.NUI.Devel.Tests { 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(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(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] @@ -77,14 +138,23 @@ namespace Tizen.NUI.Devel.Tests { tlog.Debug(tag, $"ThemeManagerGetStyle START"); + var testingTarget = new Theme(path); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(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] @@ -98,11 +168,21 @@ namespace Tizen.NUI.Devel.Tests { 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(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"); } } } diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Window/TSWindow.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Window/TSWindow.cs index b593cec..c4cb3ed 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Window/TSWindow.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Window/TSWindow.cs @@ -605,6 +605,7 @@ namespace Tizen.NUI.Devel.Tests tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception : Failed!"); } + tlog.Debug(tag, $"WindowRequestMoveToServer END (OK)"); } @@ -627,50 +628,8 @@ namespace Tizen.NUI.Devel.Tests 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)"); } } } diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSApplicationResourcePathExtension.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSApplicationResourcePathExtension.cs index 93fd40d..cd26e42 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSApplicationResourcePathExtension.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSApplicationResourcePathExtension.cs @@ -11,40 +11,29 @@ namespace Tizen.NUI.Devel.Tests 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", "-")] @@ -55,25 +44,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -88,17 +69,17 @@ namespace Tizen.NUI.Devel.Tests 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSArrayExtension.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSArrayExtension.cs index e0aaabb..0e79af7 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSArrayExtension.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSArrayExtension.cs @@ -12,48 +12,29 @@ namespace Tizen.NUI.Devel.Tests 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", "-")] @@ -64,16 +45,16 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -88,17 +69,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -113,19 +94,16 @@ namespace Tizen.NUI.Devel.Tests 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSBindingExtension.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSBindingExtension.cs index 5048992..0cf6f5a 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSBindingExtension.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSBindingExtension.cs @@ -13,40 +13,24 @@ namespace Tizen.NUI.Devel.Tests 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", "-")] @@ -57,17 +41,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -82,17 +66,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -107,17 +91,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -132,17 +116,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -157,17 +141,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -182,17 +166,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -207,17 +191,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -232,17 +216,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -257,17 +241,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -282,17 +266,17 @@ namespace Tizen.NUI.Devel.Tests 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSDynamicResourceExtension.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSDynamicResourceExtension.cs index 3078497..79dcafd 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSDynamicResourceExtension.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSDynamicResourceExtension.cs @@ -11,27 +11,24 @@ namespace Tizen.NUI.Devel.Tests 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!"); } @@ -47,17 +44,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -72,18 +69,16 @@ namespace Tizen.NUI.Devel.Tests 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSNUIResourcePathExtension.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSNUIResourcePathExtension.cs index 509b956..e19999a 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSNUIResourcePathExtension.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSNUIResourcePathExtension.cs @@ -8,43 +8,32 @@ namespace Tizen.NUI.Devel.Tests [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", "-")] @@ -55,25 +44,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -88,17 +69,15 @@ namespace Tizen.NUI.Devel.Tests 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSNullExtension.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSNullExtension.cs index 46fe6ac..4a8bf96 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSNullExtension.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSNullExtension.cs @@ -12,12 +12,9 @@ namespace Tizen.NUI.Devel.Tests { 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] @@ -44,21 +41,18 @@ namespace Tizen.NUI.Devel.Tests 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSReferenceExtension.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSReferenceExtension.cs index 9943031..01dc28c 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSReferenceExtension.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSReferenceExtension.cs @@ -11,27 +11,19 @@ namespace Tizen.NUI.Devel.Tests 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!"); } @@ -47,40 +39,17 @@ namespace Tizen.NUI.Devel.Tests 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSStaticExtension.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSStaticExtension.cs index 952f86f..7945140 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSStaticExtension.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSStaticExtension.cs @@ -11,27 +11,19 @@ namespace Tizen.NUI.Devel.Tests 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!"); } @@ -47,40 +39,17 @@ namespace Tizen.NUI.Devel.Tests 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSTemplateBindingExtension.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSTemplateBindingExtension.cs index ec6ae91..d9da145 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSTemplateBindingExtension.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSTemplateBindingExtension.cs @@ -12,40 +12,24 @@ namespace Tizen.NUI.Devel.Tests 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", "-")] @@ -56,17 +40,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -81,17 +65,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -106,17 +90,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -131,17 +115,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -156,17 +140,17 @@ namespace Tizen.NUI.Devel.Tests 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSTypeExtension.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSTypeExtension.cs index c23daa8..c9ccd78 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSTypeExtension.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/MarkupExtensions/TSTypeExtension.cs @@ -11,26 +11,18 @@ namespace Tizen.NUI.Devel.Tests 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!"); } @@ -46,41 +38,17 @@ namespace Tizen.NUI.Devel.Tests 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSProvideCompiledAttribute.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSProvideCompiledAttribute.cs index 5b5cbdc..dbb0bd1 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSProvideCompiledAttribute.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSProvideCompiledAttribute.cs @@ -11,19 +11,16 @@ namespace Tizen.NUI.Devel.Tests 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!"); } @@ -36,11 +33,13 @@ namespace Tizen.NUI.Devel.Tests 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(testingTarget, "Should return ProvideCompiledAttribute instance."); + + testingTarget = null; + tlog.Debug(tag, $"ProvideCompiledAttributeConstructor END"); } [Test] @@ -54,15 +53,20 @@ namespace Tizen.NUI.Devel.Tests tlog.Debug(tag, $"ProvideCompiledAttributeCompiledVersion START"); try { - string attribute = p1.CompiledVersion; + var testingTarget = new ProvideCompiledAttribute("testAttribute"); + Assert.IsNotNull(testingTarget, "null ProvideCompiledAttribute"); + Assert.IsInstanceOf(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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSStaticResourceExtension.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSStaticResourceExtension.cs index 0615617..3361775 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSStaticResourceExtension.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSStaticResourceExtension.cs @@ -12,41 +12,18 @@ namespace Tizen.NUI.Devel.Tests 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!"); } @@ -56,121 +33,21 @@ namespace Tizen.NUI.Devel.Tests [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(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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSTypeConversionAttribute.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSTypeConversionAttribute.cs index 8edca40..311902b 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSTypeConversionAttribute.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSTypeConversionAttribute.cs @@ -8,60 +8,22 @@ namespace Tizen.NUI.Devel.Tests [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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSViewExtensions.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSViewExtensions.cs index 9391ceb..a815be1 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSViewExtensions.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSViewExtensions.cs @@ -7,12 +7,10 @@ namespace Tizen.NUI.Devel.Tests [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() { @@ -35,84 +33,18 @@ namespace Tizen.NUI.Devel.Tests public void ExtensionsLoadFromXaml1() { tlog.Debug(tag, $"ExtensionsLoadFromXaml START"); - try - { - Tizen.NUI.Xaml.Extensions.LoadFromXaml("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("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(path); - + Tizen.NUI.Xaml.Extensions.LoadFromXaml("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("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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXaml.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXaml.cs new file mode 100755 index 0000000..e35cb8e --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXaml.cs @@ -0,0 +1,59 @@ +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 = ""; + + [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)"); + } + } +} diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXamlCompilationAttribute.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXamlCompilationAttribute.cs index e137956..ea48bae 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXamlCompilationAttribute.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXamlCompilationAttribute.cs @@ -8,23 +8,21 @@ namespace Tizen.NUI.Devel.Tests [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!"); } @@ -40,11 +38,12 @@ namespace Tizen.NUI.Devel.Tests XamlCompilationOptions xamlCompilationOptions = new XamlCompilationOptions(); - XamlCompilationAttribute x2 = new XamlCompilationAttribute(xamlCompilationOptions); + var testingTarget = new XamlCompilationAttribute(xamlCompilationOptions); + Assert.IsNotNull(testingTarget, "null XamlCompilationAttribute"); + Assert.IsInstanceOf(testingTarget, "Should return XamlCompilationAttribute instance."); - x2 = null; + testingTarget = null; tlog.Debug(tag, $"XamlCompilationAttributeConstructor END (OK)"); - Assert.Pass("XamlCompilationAttributeConstructor"); } [Test] @@ -56,18 +55,20 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -79,17 +80,18 @@ namespace Tizen.NUI.Devel.Tests 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXamlFilePathAttribute.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXamlFilePathAttribute.cs index ee34ef2..2d4ef74 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXamlFilePathAttribute.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXamlFilePathAttribute.cs @@ -33,10 +33,12 @@ namespace Tizen.NUI.Devel.Tests { tlog.Debug(tag, $"XamlFilePathAttributeConstructor START"); - XamlFilePathAttribute x1 = new XamlFilePathAttribute("myPath"); + var testingTarget = new XamlFilePathAttribute("myPath"); + Assert.IsNotNull(testingTarget, "null XamlFilePathAttribute"); + Assert.IsInstanceOf(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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXamlParseException.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXamlParseException.cs index 2b072fa..88669d9 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXamlParseException.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXamlParseException.cs @@ -9,103 +9,66 @@ namespace Tizen.NUI.Devel.Tests [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(testingTarget, "should be an instance of XamlParseException class!"); - - tlog.Debug(tag, $"XamlParseExceptionConstructor END (OK)"); + Assert.IsNotNull(testingTarget, "null XamlParseException"); + Assert.IsInstanceOf(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(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(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(testingTarget, "should be an instance of XamlParseException class!"); + Assert.IsNotNull(testingTarget, "null XamlParseException"); + Assert.IsInstanceOf(testingTarget, "Should return XamlParseException instance."); - tlog.Debug(tag, $"XamlParseExceptionConstructorWithIXmlLineInfo END (OK)"); + testingTarget = null; + tlog.Debug(tag, $"XamlParseExceptionConstructorWithMessage END"); } [Test] @@ -114,23 +77,22 @@ namespace Tizen.NUI.Devel.Tests [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] @@ -139,15 +101,14 @@ namespace Tizen.NUI.Devel.Tests [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) { @@ -155,7 +116,7 @@ namespace Tizen.NUI.Devel.Tests Assert.Fail("Caught Exception : Failed!"); } - tlog.Debug(tag, $"XamlParseExceptionUnformattedMessage END (OK)"); + tlog.Debug(tag, $"XamlParseExceptionUnformattedMessage END"); } } } \ No newline at end of file diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXamlResourceIdAttribute.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXamlResourceIdAttribute.cs index 125ae0b..16d1d99 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXamlResourceIdAttribute.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXamlResourceIdAttribute.cs @@ -12,48 +12,23 @@ namespace Tizen.NUI.Devel.Tests 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", "-")] @@ -64,17 +39,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -89,17 +64,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -114,16 +89,17 @@ namespace Tizen.NUI.Devel.Tests 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"); } @@ -147,8 +123,7 @@ namespace Tizen.NUI.Devel.Tests Assert.Fail("Caught Exception" + e.ToString()); } - tlog.Debug(tag, $"XamlResourceIdAttributeGetResourceIdForType END (OK)"); - Assert.Pass("XamlResourceIdAttributeGetResourceIdForType"); + tlog.Debug(tag, $"XamlResourceIdAttributeGetResourceIdForType END"); } [Test] @@ -171,77 +146,7 @@ namespace Tizen.NUI.Devel.Tests 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXamlServiceProvider.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXamlServiceProvider.cs index 4d5bc5c..1349a2c 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXamlServiceProvider.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXamlServiceProvider.cs @@ -12,81 +12,32 @@ namespace Tizen.NUI.Devel.Tests [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 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(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(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] @@ -101,17 +52,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -126,17 +77,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -151,17 +102,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -176,17 +127,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -201,17 +152,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -226,17 +177,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -251,16 +202,15 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -275,17 +225,15 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -301,21 +249,21 @@ namespace Tizen.NUI.Devel.Tests 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(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] @@ -331,21 +279,24 @@ namespace Tizen.NUI.Devel.Tests 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(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] @@ -361,22 +312,25 @@ namespace Tizen.NUI.Devel.Tests 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(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] @@ -385,7 +339,6 @@ namespace Tizen.NUI.Devel.Tests [Property("SPEC", "Tizen.NUI.XamlServiceProvider.SimpleValueTargetProvider M")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "MR")] - [Obsolete] public void XamlServiceProviderSimpleValueTargetProvider1() { tlog.Debug(tag, $"XamlServiceProviderTargetProperty START"); @@ -395,16 +348,17 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -424,16 +378,16 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -453,336 +407,16 @@ namespace Tizen.NUI.Devel.Tests 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 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXmlLineInfo.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXmlLineInfo.cs index 273c8c4..2c33c81 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXmlLineInfo.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TSXmlLineInfo.cs @@ -11,19 +11,18 @@ namespace Tizen.NUI.Devel.Tests 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!"); } @@ -33,30 +32,15 @@ namespace Tizen.NUI.Devel.Tests [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(testingTarget, "Should return XmlLineInfo instance."); - tlog.Debug(tag, $"XmlLineInfoConstructor END (OK)"); - Assert.Pass("XmlLineInfoConstructor"); + tlog.Debug(tag, $"XmlLineInfoConstructor END"); } [Test] @@ -71,16 +55,16 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -95,16 +79,16 @@ namespace Tizen.NUI.Devel.Tests 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] @@ -119,16 +103,16 @@ namespace Tizen.NUI.Devel.Tests 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TotalSample/TotalSample.xaml b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TotalSample/TotalSample.xaml new file mode 100755 index 0000000..49e5e6f --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TotalSample/TotalSample.xaml @@ -0,0 +1,74 @@ + + + + + + + + 200, 200 + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + V1 + + + + + + + + + 1000 + + + + + + + + + + + + 1 + str + 2.0 + + + diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TotalSample/TotalSample.xaml.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TotalSample/TotalSample.xaml.cs new file mode 100755 index 0000000..cbf0013 --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TotalSample/TotalSample.xaml.cs @@ -0,0 +1,47 @@ +/* + * 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 diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TotalSample/TotalSample.xaml.g.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TotalSample/TotalSample.xaml.g.cs new file mode 100755 index 0000000..bd59cd2 --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TotalSample/TotalSample.xaml.g.cs @@ -0,0 +1,57 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +[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(this, "t1"); + t2 = global::Tizen.NUI.Binding.NameScopeExtensions.FindByName(this, "t2"); + t3 = global::Tizen.NUI.Binding.NameScopeExtensions.FindByName(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); + } + } +} diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TotalSample/UIElement.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TotalSample/UIElement.cs new file mode 100755 index 0000000..8844b9f --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/public/Xaml/TotalSample/UIElement.cs @@ -0,0 +1,124 @@ +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); + } + } + } +} -- 2.7.4