[NUI] Update TCs of NUI.Devel.
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / public / CustomView / TSCustomViewRegistry.cs
1 using NUnit.Framework;
2 using NUnit.Framework.TUnit;
3 using System;
4 using Tizen.NUI;
5 using Tizen.NUI.BaseComponents;
6 using Tizen.NUI.Events;
7
8 namespace Tizen.NUI.Devel.Tests
9 {
10     using tlog = Tizen.Log;
11
12     [TestFixture]
13     [Description("public/CustomView/CustomViewRegistry")]
14     public class PublicCustomViewRegistryTest
15     {
16         private const string tag = "NUITEST";
17         public static Func<CustomView> CreateInstance { get; private set; }
18
19         [SetUp]
20         public void Init()
21         {
22             tlog.Info(tag, "Init() is called!");
23         }
24
25         [TearDown]
26         public void Destroy()
27         {
28             tlog.Info(tag, "Destroy() is called!");
29         }
30
31         [Test]
32         [Category("P1")]
33         [Description("ScriptableProperty Type")]
34         [Property("SPEC", "Tizen.NUI.ScriptableProperty.Type A")]
35         [Property("SPEC_URL", "-")]
36         [Property("CRITERIA", "PRO")]
37         [Property("AUTHOR", "guowei.wang@samsung.com")]
38         public void ScriptablePropertyType()
39         {
40             tlog.Debug(tag, $"ScriptablePropertyType START");
41
42             var testingTarget = new ScriptableProperty();
43             Assert.IsNotNull(testingTarget, "should be not null");
44             Assert.IsInstanceOf<ScriptableProperty>(testingTarget, "should be an instance of testing target class!");
45
46             var result = testingTarget.Type;
47             tlog.Debug(tag, "Type : " + result);
48
49             tlog.Debug(tag, $"ScriptablePropertyType END (OK)");
50         }
51
52         [Test]
53         [Category("P2")]
54         [Description("CustomViewRegistry Register")]
55         [Property("SPEC", "Tizen.NUI.CustomViewRegistry.Register M")]
56         [Property("SPEC_URL", "-")]
57         [Property("CRITERIA", "MR")]
58         [Property("AUTHOR", "guowei.wang@samsung.com")]
59         public void CustomViewRegistryRegisterNullViewType()
60         {
61             tlog.Debug(tag, $"CustomViewRegistryRegisterNullViewType START");
62
63             try
64             {
65                 CustomViewRegistry.Instance.Register(CreateInstance, null);
66             }
67             catch (ArgumentNullException e)
68             {
69                 tlog.Debug(tag, e.Message.ToString());
70                 tlog.Debug(tag, $"CustomViewRegistryRegisterNullViewType END (OK)");
71                 Assert.Pass("Caught ArgumentNullException : Passed!");
72             }
73         }
74     }
75 }