[NUI] Make PrimaryCursorPosition property public
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / public / BaseComponents / TSTextEvent.cs
1 using global::System;
2 using NUnit.Framework;
3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6 using System.Collections.Generic;
7 using System.Runtime.InteropServices;
8
9 namespace Tizen.NUI.Devel.Tests
10 {
11     using tlog = Tizen.Log;
12
13     [TestFixture]
14     [Description("public/BaseComponents/TextEvent")]
15     public class PublicTextEventTest
16     {
17         private const string tag = "NUITEST";
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("TextEvent.AnchorClickedEventArgs Href.")]
34         [Property("SPEC", "Tizen.NUI.TextEvent.AnchorClickedEventArgs.Href A")]
35         [Property("SPEC_URL", "-")]
36         [Property("CRITERIA", "PRW")]
37         [Property("AUTHOR", "guowei.wang@samsung.com")]
38         public void TextEventAnchorClickedEventArgsHref()
39         {
40             tlog.Debug(tag, $"TextEventAnchorClickedEventArgsHref START");
41
42             TextLabel label = new TextLabel()
43             {
44                 Text = "hypertext",
45             };
46
47             var testingTarget = new AnchorClickedEventArgs();
48             Assert.IsNotNull(testingTarget, "Can't create success object AnchorClickedEventArgs");
49             Assert.IsInstanceOf<AnchorClickedEventArgs>(testingTarget, "Should be an instance of AnchorClickedEventArgs type.");
50
51             testingTarget.Href = Marshal.PtrToStringAnsi(label.SwigCPtr.Handle);
52             Assert.IsNotNull(testingTarget.Href, "Should be not null.");
53
54             label.Dispose();
55             tlog.Debug(tag, $"TextEventAnchorClickedEventArgsHref END (OK)");
56         }
57
58         [Test]
59         [Category("P1")]
60         [Description("TextEvent.InputFilteredEventArgs Type.")]
61         [Property("SPEC", "Tizen.NUI.TextEvent.InputFilteredEventArgs.Type A")]
62         [Property("SPEC_URL", "-")]
63         [Property("CRITERIA", "PRW")]
64         [Property("AUTHOR", "guowei.wang@samsung.com")]
65         public void TextEventInputFilteredEventArgsType()
66         {
67             tlog.Debug(tag, $"TextEventInputFilteredEventArgsType START");
68
69             TextLabel label = new TextLabel()
70             {
71                 Text = "hypertext",
72             };
73
74             var testingTarget = new InputFilteredEventArgs();
75             Assert.IsNotNull(testingTarget, "Can't create success object InputFilteredEventArgs");
76             Assert.IsInstanceOf<InputFilteredEventArgs>(testingTarget, "Should be an instance of InputFilteredEventArgs type.");
77
78             testingTarget.Type = InputFilterType.Accept;
79             Assert.IsNotNull(testingTarget.Type, "Should be not null.");
80
81             label.Dispose();
82             tlog.Debug(tag, $"TextEventInputFilteredEventArgsType END (OK)");
83         }
84     }
85 }