3 using NUnit.Framework.TUnit;
5 using Tizen.NUI.Components;
6 using Tizen.NUI.BaseComponents;
8 namespace Tizen.NUI.Components.Devel.Tests
10 using tlog = Tizen.Log;
13 [Description("Controls/ImageScrollBar")]
14 public class ImageScrollBarTest
16 private const string tag = "NUITEST";
17 private string path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
20 internal class MyScrollBar : ScrollBar
22 public MyScrollBar() : base()
25 public void OnCreateViewStyle()
27 base.CreateViewStyle();
34 tlog.Info(tag, "Init() is called!");
40 tlog.Info(tag, "Destroy() is called!");
45 [Description("ScrollBar constructor.")]
46 [Property("SPEC", "Tizen.NUI.Components.ScrollBar.ScrollBar C")]
47 [Property("SPEC_URL", "-")]
48 [Property("CRITERIA", "CONSTR")]
49 [Property("COVPARAM", "")]
50 [Property("AUTHOR", "guowei.wang@samsung.com")]
52 public void ScrollBarConstructor()
54 tlog.Debug(tag, $"ScrollBarConstructor START");
56 var testingTarget = new ScrollBar();
57 Assert.IsNotNull(testingTarget, "null handle");
58 Assert.IsInstanceOf<ScrollBar>(testingTarget, "Should return ScrollBar instance.");
60 testingTarget.MinValue = 0;
61 tlog.Debug(tag, "MinValue : " + testingTarget.MinValue);
63 testingTarget.MaxValue = 100;
64 tlog.Debug(tag, "MaxValue : " + testingTarget.MaxValue);
66 testingTarget.Duration = 3;
67 tlog.Debug(tag, "Duration : " + testingTarget.Duration);
69 testingTarget.CurrentValue = 30;
70 tlog.Debug(tag, "CurrentValue : " + testingTarget.CurrentValue);
74 testingTarget.SetCurrentValue(50, true);
75 tlog.Debug(tag, "CurrentValue : " + testingTarget.CurrentValue);
79 tlog.Debug(tag, e.Message.ToString());
80 Assert.Fail("Caught Exception : Failed!");
83 testingTarget.Dispose();
84 tlog.Debug(tag, $"ScrollBarConstructor END (OK)");
89 [Description("ScrollBar constructor.")]
90 [Property("SPEC", "Tizen.NUI.Components.ScrollBar.ScrollBar C")]
91 [Property("SPEC_URL", "-")]
92 [Property("CRITERIA", "CONSTR")]
93 [Property("COVPARAM", "")]
94 [Property("AUTHOR", "guowei.wang@samsung.com")]
96 public void ScrollBarConstructorWithScrollBarStyle()
98 tlog.Debug(tag, $"ScrollBarConstructorWithScrollBarStyle START");
100 ScrollBarStyle style = new ScrollBarStyle()
102 Size = new Size(30, 2),
103 HeightResizePolicy = ResizePolicyType.Fixed,
106 var testingTarget = new ScrollBar(style);
107 Assert.IsNotNull(testingTarget, "null handle");
108 Assert.IsInstanceOf<ScrollBar>(testingTarget, "Should return ScrollBar instance.");
110 testingTarget.Dispose();
111 tlog.Debug(tag, $"ScrollBarConstructorWithScrollBarStyle END (OK)");
116 [Description("ScrollBar Direction.")]
117 [Property("SPEC", "Tizen.NUI.Components.ScrollBar.Direction A")]
118 [Property("SPEC_URL", "-")]
119 [Property("CRITERIA", "PRW")]
120 [Property("COVPARAM", "")]
121 [Property("AUTHOR", "guowei.wang@samsung.com")]
123 public void ScrollBarDirection()
125 tlog.Debug(tag, $"ScrollBarDirection START");
127 var testingTarget = new ScrollBar()
129 Direction = ScrollBar.DirectionType.Vertical,
131 Assert.IsNotNull(testingTarget, "null handle");
132 Assert.IsInstanceOf<ScrollBar>(testingTarget, "Should return ScrollBar instance.");
134 tlog.Debug(tag, "Direction : " + testingTarget.Direction);
136 testingTarget.Direction = ScrollBar.DirectionType.Horizontal;
137 tlog.Debug(tag, "Direction : " + testingTarget.Direction);
139 testingTarget.Dispose();
140 tlog.Debug(tag, $"ScrollBarDirection END (OK)");
145 [Description("ScrollBar ThumbSize.")]
146 [Property("SPEC", "Tizen.NUI.Components.ScrollBar.ThumbSize A")]
147 [Property("SPEC_URL", "-")]
148 [Property("CRITERIA", "PRW")]
149 [Property("COVPARAM", "")]
150 [Property("AUTHOR", "guowei.wang@samsung.com")]
152 public void ScrollBarThumbSize()
154 tlog.Debug(tag, $"ScrollBarThumbSize START");
156 var testingTarget = new ScrollBar()
158 Direction = ScrollBar.DirectionType.Vertical,
159 ThumbSize = new Size(10, 5)
161 Assert.IsNotNull(testingTarget, "null handle");
162 Assert.IsInstanceOf<ScrollBar>(testingTarget, "Should return ScrollBar instance.");
164 tlog.Debug(tag, "ThumbSize : " + testingTarget.ThumbSize);
166 testingTarget.ThumbSize = new Size(8, 4);
167 tlog.Debug(tag, "ThumbSize : " + testingTarget.ThumbSize);
169 testingTarget.ThumbColor = Color.Yellow;
170 tlog.Debug(tag, "ThumbColor : " + testingTarget.ThumbColor);
172 testingTarget.Dispose();
173 tlog.Debug(tag, $"ScrollBarThumbSize END (OK)");
178 [Description("ScrollBar TrackImageURL.")]
179 [Property("SPEC", "Tizen.NUI.Components.ScrollBar.TrackImageURL A")]
180 [Property("SPEC_URL", "-")]
181 [Property("CRITERIA", "PRW")]
182 [Property("COVPARAM", "")]
183 [Property("AUTHOR", "guowei.wang@samsung.com")]
185 public void ScrollBarTrackImageURL()
187 tlog.Debug(tag, $"ScrollBarTrackImageURL START");
189 var testingTarget = new ScrollBar()
191 Direction = ScrollBar.DirectionType.Vertical,
192 ThumbSize = new Size(10, 5)
194 Assert.IsNotNull(testingTarget, "null handle");
195 Assert.IsInstanceOf<ScrollBar>(testingTarget, "Should return ScrollBar instance.");
197 testingTarget.TrackImageURL = path;
198 tlog.Debug(tag, "TrackImageURL : " + testingTarget.TrackImageURL);
200 testingTarget.TrackColor = Color.Black;
201 tlog.Debug(tag, "TrackColor : " + testingTarget.TrackColor);
203 testingTarget.Dispose();
204 tlog.Debug(tag, $"ScrollBarTrackImageURL END (OK)");
209 [Description("ScrollBar CreateViewStyle.")]
210 [Property("SPEC", "Tizen.NUI.Components.ScrollBar.CreateViewStyle M")]
211 [Property("SPEC_URL", "-")]
212 [Property("CRITERIA", "MR")]
213 [Property("COVPARAM", "")]
214 [Property("AUTHOR", "guowei.wang@samsung.com")]
216 public void ScrollBarCreateViewStyle()
218 tlog.Debug(tag, $"ScrollBarCreateViewStyle START");
220 var testingTarget = new MyScrollBar();
221 Assert.IsNotNull(testingTarget, "null handle");
222 Assert.IsInstanceOf<ScrollBar>(testingTarget, "Should return ScrollBar instance.");
226 testingTarget.OnCreateViewStyle();
230 tlog.Debug(tag, e.Message.ToString());
231 Assert.Fail("Caught Exception : Failed!");
234 testingTarget.Dispose();
235 tlog.Debug(tag, $"ScrollBarCreateViewStyle END (OK)");