[NUI] Make PrimaryCursorPosition property public
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / public / BaseComponents / TSTextLabelEvent.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/TextLabelEvent")]
15     public class PublicTextLabelEventTest
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("TextLabelEvent.AnchorClicked.")]
34         [Property("SPEC", "Tizen.NUI.TextLabelEvent.AnchorClicked A")]
35         [Property("SPEC_URL", "-")]
36         [Property("CRITERIA", "PRW")]
37         [Property("AUTHOR", "guowei.wang@samsung.com")]
38         public void TextLabelEventAnchorClicked()
39         {
40             tlog.Debug(tag, $"TextLabelEventAnchorClicked START");
41
42             TextLabel label = new TextLabel()
43             {
44                 Text = "hypertext",
45             };
46
47             label.AnchorClicked += MyOnAnchorClicked;
48             label.AnchorClicked -= MyOnAnchorClicked;
49
50             label.Dispose();
51             tlog.Debug(tag, $"TextLabelEventAnchorClicked END (OK)");
52         }
53
54         private void MyOnAnchorClicked(object sender, AnchorClickedEventArgs e)
55         {
56             var label = sender as TextLabel;
57             e.Href = Marshal.PtrToStringAnsi(label.SwigCPtr.Handle);
58         }
59     }
60 }