From fb52c5a070012d4148b279588d00fc27e5b01baa Mon Sep 17 00:00:00 2001 From: Dongsug Song Date: Thu, 12 Dec 2019 17:22:43 +0900 Subject: [PATCH] [NUI.Components][Non-ACR] Fix TCT fails Change-Id: I56a2a1b5af67e28490b81aef1e375b802a0660ae Signed-off-by: Dongsug Song --- .../testcase/TSButton.cs | 679 +++++++++++---------- .../Tizen.NUI.Components.Tests/testcase/TSTab.cs | 32 +- 2 files changed, 357 insertions(+), 354 deletions(-) diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.cs index 7295075..2085f6d 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.cs @@ -6,25 +6,25 @@ using Tizen.NUI.UIComponents; using Tizen.NUI.Components; using System.Runtime.InteropServices; using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.Button Tests")] - public class ButtonTests - { - private const string TAG = "Components"; - private bool _stateChangedEvent = false; - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - private static bool _focusGainedFlag = false; - private static bool _focusLostFlag = false; - private static bool _updateFlag = false; - private static bool _themeFlag = false; - private static bool _measureTextFlag = false; - private static bool _layoutChildFlag = false; - - [SetUp] +using Tizen.NUI.Components.Test; + +namespace Tizen.NUI.Components.Tests +{ + [TestFixture] + [Description("Tizen.NUI.Components.Button Tests")] + public class ButtonTests + { + private const string TAG = "Components"; + private bool _stateChangedEvent = false; + private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; + private static bool _focusGainedFlag = false; + private static bool _focusLostFlag = false; + private static bool _updateFlag = false; + private static bool _themeFlag = false; + private static bool _measureTextFlag = false; + private static bool _layoutChildFlag = false; + + [SetUp] public void Init() { _stateChangedEvent = false; @@ -32,14 +32,14 @@ namespace Tizen.NUI.Components.Tests App.MainTitleChangeText("CommonButtonTests"); App.MainTitleChangeBackgroundColor(null); - } - + } + [TearDown] public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); - } - + } + [Test] [Category("P1")] [Description("Test Button empty constructor. Check it has been triggered")] @@ -53,389 +53,392 @@ namespace Tizen.NUI.Components.Tests /* TEST CODE */ var button = new Components.Button(); Assert.IsNotNull(button, "Should be not null"); - Assert.IsInstanceOf(button, "Should be equal!"); - - } - + Assert.IsInstanceOf(button, "Should be equal!"); + + } + [Test] [Category("P1")] - [Description("Test IsSelectable. Check whether IsSelectable is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.IsSelectable A")] - [Property("SPEC_URL", "-")] + [Description("Test IsSelectable. Check whether IsSelectable is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Components.Button.IsSelectable A")] + [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IsSelectable_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); + [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] + public void IsSelectable_SET_GET_VALUE() + { + /* TEST CODE */ + var button = new Components.Button(); Assert.IsNotNull(button, "Should be not null"); Assert.IsInstanceOf(button, "Should be equal!"); - button.IsSelectable = true; - Assert.AreEqual(true, button.IsSelectable, "Should be equals to the set value"); - button.IsSelectable = false; - Assert.AreEqual(false, button.IsSelectable, "Should be equals to the set value"); - } - - [Test] - [Category("P1")] - [Description("Test Text. Check whether Text is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.Text A")] - [Property("SPEC_URL", "-")] + button.IsSelectable = true; + Assert.AreEqual(true, button.IsSelectable, "Should be equals to the set value"); + button.IsSelectable = false; + Assert.AreEqual(false, button.IsSelectable, "Should be equals to the set value"); + } + + [Test] + [Category("P1")] + [Description("Test Text. Check whether Text is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Components.Button.Text A")] + [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Text_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); + [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] + public void Text_SET_GET_VALUE() + { + /* TEST CODE */ + var button = new Components.Button(); Assert.IsNotNull(button, "Should be not null"); Assert.IsInstanceOf(button, "Should be equal!"); - button.Text = "Test Text"; - Assert.AreEqual("Test Text", button.Text, "Should be equals to the set value of Text"); - } - - [Test] - [Category("P1")] - [Description("Test TranslatableText. Check whether TranslatableText is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.TranslatableText A")] - [Property("SPEC_URL", "-")] + button.Text = "Test Text"; + Assert.AreEqual("Test Text", button.Text, "Should be equals to the set value of Text"); + } + + [Test] + [Category("P1")] + [Description("Test TranslatableText. Check whether TranslatableText is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Components.Button.TranslatableText A")] + [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TranslatableText_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); + [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] + public void TranslatableText_SET_GET_VALUE() + { + /* TEST CODE */ + var button = new Components.Button(); Assert.IsNotNull(button, "Should be not null"); Assert.IsInstanceOf(button, "Should be equal!"); - button.TranslatableText = "Test TranslatableText"; - Assert.AreEqual("Test TranslatableText", button.TranslatableText, "Should be equals to the set value of TranslatableText"); - } - - [Test] - [Category("P1")] - [Description("Test PointSize. Check whether PointSize is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.PointSize A")] - [Property("SPEC_URL", "-")] + if (NUIApplication.MultilingualResourceManager != null) + { + button.TranslatableText = "Test TranslatableText"; + Assert.AreEqual("Test TranslatableText", button.TranslatableText, "Should be equals to the set value of TranslatableText"); + } + } + + [Test] + [Category("P1")] + [Description("Test PointSize. Check whether PointSize is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Components.Button.PointSize A")] + [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void PointSize_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); + [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] + public void PointSize_SET_GET_VALUE() + { + /* TEST CODE */ + var button = new Components.Button(); Assert.IsNotNull(button, "Should be not null"); Assert.IsInstanceOf(button, "Should be equal!"); - button.PointSize = 10.0f; - Assert.AreEqual(10.0f, button.PointSize, "Should be equals to the set value of PointSize"); - } - - [Test] - [Category("P1")] - [Description("Test FontFamily. Check whether FontFamily is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.FontFamily A")] - [Property("SPEC_URL", "-")] + button.PointSize = 10.0f; + Assert.AreEqual(10.0f, button.PointSize, "Should be equals to the set value of PointSize"); + } + + [Test] + [Category("P1")] + [Description("Test FontFamily. Check whether FontFamily is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Components.Button.FontFamily A")] + [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void FontFamily_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); + [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] + public void FontFamily_SET_GET_VALUE() + { + /* TEST CODE */ + var button = new Components.Button(); Assert.IsNotNull(button, "Should be not null"); Assert.IsInstanceOf(button, "Should be equal!"); - button.FontFamily = "SamsungOne 500"; - Assert.AreEqual("SamsungOne 500", button.FontFamily, "Should be equals to the set value of FontFamily"); - } - - [Test] - [Category("P1")] - [Description("Test TextColor. Check whether TextColor is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.TextColor A")] - [Property("SPEC_URL", "-")] + button.FontFamily = "SamsungOne 500"; + Assert.AreEqual("SamsungOne 500", button.FontFamily, "Should be equals to the set value of FontFamily"); + } + + [Test] + [Category("P1")] + [Description("Test TextColor. Check whether TextColor is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Components.Button.TextColor A")] + [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TextColor_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); + [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] + public void TextColor_SET_GET_VALUE() + { + /* TEST CODE */ + var button = new Components.Button(); Assert.IsNotNull(button, "Should be not null"); Assert.IsInstanceOf(button, "Should be equal!"); - var color = new Color(1.0f, 0.0f, 0.0f, 1.0f); + var color = new Color(1.0f, 0.0f, 0.0f, 1.0f); Assert.IsNotNull(color, "Should be not null"); Assert.IsInstanceOf(color, "Should be equal!"); - button.TextColor = color; - + button.TextColor = color; + Assert.AreEqual(color.R, button.TextColor.R, "Should be equals to the color.R set"); Assert.AreEqual(color.G, button.TextColor.G, "Should be equals to the color.G set"); Assert.AreEqual(color.B, button.TextColor.B, "Should be equals to the color.B set"); - Assert.AreEqual(color.A, button.TextColor.A, "Should be equals to the color.A set"); - - } - - [Test] - [Category("P1")] - [Description("Test TextAlignment. Check whether TextAlignment is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.TextAlignment A")] - [Property("SPEC_URL", "-")] + Assert.AreEqual(color.A, button.TextColor.A, "Should be equals to the color.A set"); + + } + + [Test] + [Category("P1")] + [Description("Test TextAlignment. Check whether TextAlignment is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Components.Button.TextAlignment A")] + [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TextAlignment_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); + [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] + public void TextAlignment_SET_GET_VALUE() + { + /* TEST CODE */ + var button = new Components.Button(); Assert.IsNotNull(button, "Should be not null"); Assert.IsInstanceOf(button, "Should be equal!"); - button.TextAlignment = HorizontalAlignment.Begin; - Assert.AreEqual(HorizontalAlignment.Begin, button.TextAlignment, "Should be equals to the set value of TextAlignment"); + button.TextAlignment = HorizontalAlignment.Begin; + Assert.AreEqual(HorizontalAlignment.Begin, button.TextAlignment, "Should be equals to the set value of TextAlignment"); button.TextAlignment = HorizontalAlignment.Center; Assert.AreEqual(HorizontalAlignment.Center, button.TextAlignment, "Should be equals to the set value of TextAlignment"); button.TextAlignment = HorizontalAlignment.End; Assert.AreEqual(HorizontalAlignment.End, button.TextAlignment, "Should be equals to the set value of TextAlignment"); - } - - [Test] - [Category("P1")] - [Description("Test IconURL. Check whether IconURL is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.IconURL A")] - [Property("SPEC_URL", "-")] + } + + [Test] + [Category("P1")] + [Description("Test IconURL. Check whether IconURL is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Components.Button.IconURL A")] + [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IconURL_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); + [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] + public void IconURL_SET_GET_VALUE() + { + /* TEST CODE */ + var button = new Components.Button(); Assert.IsNotNull(button, "Should be not null"); Assert.IsInstanceOf(button, "Should be equal!"); - button.IconURL = _image_path; - Assert.AreEqual(_image_path, button.IconURL, "Should be equals to the set value of IconURL"); - } - - [Test] - [Category("P1")] - [Description("Test TextSelector. Check whether TextSelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.TextSelector A")] - [Property("SPEC_URL", "-")] + button.IconURL = _image_path; + Assert.AreEqual(_image_path, button.IconURL, "Should be equals to the set value of IconURL"); + } + + [Test] + [Category("P1")] + [Description("Test TextSelector. Check whether TextSelector is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Components.Button.TextSelector A")] + [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TextSelector_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); + [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] + public void TextSelector_SET_GET_VALUE() + { + /* TEST CODE */ + var button = new Components.Button(); Assert.IsNotNull(button, "Should be not null"); Assert.IsInstanceOf(button, "Should be equal!"); - var stringSelector = new StringSelector - { - Normal = "Normal", - Selected = "Selected", - }; + var stringSelector = new StringSelector + { + Normal = "Normal", + Selected = "Selected", + }; Assert.IsNotNull(stringSelector, "Should be not null"); Assert.IsInstanceOf(stringSelector, "Should be equal!"); - - button.TextSelector = stringSelector; - Assert.AreEqual(stringSelector.Normal, button.TextSelector.Normal, "Should be equals to the set value of TextSelector"); - Assert.AreEqual(stringSelector.Selected, button.TextSelector.Selected, "Should be equals to the set value of TextSelector"); - } - - [Test] - [Category("P1")] - [Description("Test TranslatableTextSelector. Check whether TranslatableTextSelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.TranslatableTextSelector A")] - [Property("SPEC_URL", "-")] + + button.TextSelector = stringSelector; + Assert.AreEqual(stringSelector.Normal, button.TextSelector.Normal, "Should be equals to the set value of TextSelector"); + Assert.AreEqual(stringSelector.Selected, button.TextSelector.Selected, "Should be equals to the set value of TextSelector"); + } + + [Test] + [Category("P1")] + [Description("Test TranslatableTextSelector. Check whether TranslatableTextSelector is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Components.Button.TranslatableTextSelector A")] + [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TranslatableTextSelector_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); + [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] + public void TranslatableTextSelector_SET_GET_VALUE() + { + /* TEST CODE */ + var button = new Components.Button(); Assert.IsNotNull(button, "Should be not null"); Assert.IsInstanceOf(button, "Should be equal!"); - var stringSelector = new StringSelector - { - Normal = "Normal", - Selected = "Selected", - }; + var stringSelector = new StringSelector + { + Normal = "Normal", + Selected = "Selected", + }; Assert.IsNotNull(stringSelector, "Should be not null"); Assert.IsInstanceOf(stringSelector, "Should be equal!"); - - button.TranslatableTextSelector = stringSelector; - Assert.AreEqual(stringSelector.Normal, button.TranslatableTextSelector.Normal, "Should be equals to the set value of TranslatableTextSelector"); - Assert.AreEqual(stringSelector.Selected, button.TranslatableTextSelector.Selected, "Should be equals to the set value of TranslatableTextSelector"); - } - - [Test] - [Category("P1")] - [Description("Test TextColorSelector. Check whether TextColorSelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.TextColorSelector A")] - [Property("SPEC_URL", "-")] + + button.TranslatableTextSelector = stringSelector; + Assert.AreEqual(stringSelector.Normal, button.TranslatableTextSelector.Normal, "Should be equals to the set value of TranslatableTextSelector"); + Assert.AreEqual(stringSelector.Selected, button.TranslatableTextSelector.Selected, "Should be equals to the set value of TranslatableTextSelector"); + } + + [Test] + [Category("P1")] + [Description("Test TextColorSelector. Check whether TextColorSelector is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Components.Button.TextColorSelector A")] + [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TextColorSelector_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); + [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] + public void TextColorSelector_SET_GET_VALUE() + { + /* TEST CODE */ + var button = new Components.Button(); Assert.IsNotNull(button, "Should be not null"); Assert.IsInstanceOf(button, "Should be equal!"); - var colorSelector = new ColorSelector - { - Normal = new Color(0.0f, 0.0f, 1.0f, 1.0f), - Selected = new Color(0.0f, 1.0f, 0.0f, 1.0f), - }; + var colorSelector = new ColorSelector + { + Normal = new Color(0.0f, 0.0f, 1.0f, 1.0f), + Selected = new Color(0.0f, 1.0f, 0.0f, 1.0f), + }; Assert.IsNotNull(colorSelector, "Should be not null"); Assert.IsInstanceOf(colorSelector, "Should be equal!"); - - button.TextColorSelector = colorSelector; - Assert.AreEqual(colorSelector.Normal.R, button.TextColorSelector.Normal.R, "Should be equals to the set value of TextColorSelector Normal R"); - Assert.AreEqual(colorSelector.Normal.G, button.TextColorSelector.Normal.G, "Should be equals to the set value of TextColorSelector Normal G"); - Assert.AreEqual(colorSelector.Normal.B, button.TextColorSelector.Normal.B, "Should be equals to the set value of TextColorSelector Normal B"); - Assert.AreEqual(colorSelector.Normal.A, button.TextColorSelector.Normal.A, "Should be equals to the set value of TextColorSelector Normal A"); - - Assert.AreEqual(colorSelector.Selected.R, button.TextColorSelector.Selected.R, "Should be equals to the set value of TextColorSelector Selected R"); - Assert.AreEqual(colorSelector.Selected.G, button.TextColorSelector.Selected.G, "Should be equals to the set value of TextColorSelector Selected G"); - Assert.AreEqual(colorSelector.Selected.B, button.TextColorSelector.Selected.B, "Should be equals to the set value of TextColorSelector Selected B"); - Assert.AreEqual(colorSelector.Selected.A, button.TextColorSelector.Selected.A, "Should be equals to the set value of TextColorSelector Selected A"); - } - - [Test] - [Category("P1")] - [Description("Test PointSizeSelector. Check whether PointSizeSelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.PointSizeSelector A")] - [Property("SPEC_URL", "-")] + + button.TextColorSelector = colorSelector; + Assert.AreEqual(colorSelector.Normal.R, button.TextColorSelector.Normal.R, "Should be equals to the set value of TextColorSelector Normal R"); + Assert.AreEqual(colorSelector.Normal.G, button.TextColorSelector.Normal.G, "Should be equals to the set value of TextColorSelector Normal G"); + Assert.AreEqual(colorSelector.Normal.B, button.TextColorSelector.Normal.B, "Should be equals to the set value of TextColorSelector Normal B"); + Assert.AreEqual(colorSelector.Normal.A, button.TextColorSelector.Normal.A, "Should be equals to the set value of TextColorSelector Normal A"); + + Assert.AreEqual(colorSelector.Selected.R, button.TextColorSelector.Selected.R, "Should be equals to the set value of TextColorSelector Selected R"); + Assert.AreEqual(colorSelector.Selected.G, button.TextColorSelector.Selected.G, "Should be equals to the set value of TextColorSelector Selected G"); + Assert.AreEqual(colorSelector.Selected.B, button.TextColorSelector.Selected.B, "Should be equals to the set value of TextColorSelector Selected B"); + Assert.AreEqual(colorSelector.Selected.A, button.TextColorSelector.Selected.A, "Should be equals to the set value of TextColorSelector Selected A"); + } + + [Test] + [Category("P1")] + [Description("Test PointSizeSelector. Check whether PointSizeSelector is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Components.Button.PointSizeSelector A")] + [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void PointSizeSelector_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); + [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] + public void PointSizeSelector_SET_GET_VALUE() + { + /* TEST CODE */ + var button = new Components.Button(); Assert.IsNotNull(button, "Should be not null"); Assert.IsInstanceOf(button, "Should be equal!"); - var floatSelector = new FloatSelector - { - Normal = 10.0f, - Selected = 12.0f, - }; + var floatSelector = new FloatSelector + { + Normal = 10.0f, + Selected = 12.0f, + }; Assert.IsNotNull(floatSelector, "Should be not null"); Assert.IsInstanceOf(floatSelector, "Should be equal!"); - - button.PointSizeSelector = floatSelector; - Assert.AreEqual(floatSelector.Normal, button.PointSizeSelector.Normal, "Should be equals to the set value of PointSizeSelector Normal"); - Assert.AreEqual(floatSelector.Selected, button.PointSizeSelector.Selected, "Should be equals to the set value of PointSizeSelector Selected"); - } - - [Test] - [Category("P1")] - [Description("Test IconURLSelector. Check whether IconURLSelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.IconURLSelector A")] - [Property("SPEC_URL", "-")] + + button.PointSizeSelector = floatSelector; + Assert.AreEqual(floatSelector.Normal, button.PointSizeSelector.Normal, "Should be equals to the set value of PointSizeSelector Normal"); + Assert.AreEqual(floatSelector.Selected, button.PointSizeSelector.Selected, "Should be equals to the set value of PointSizeSelector Selected"); + } + + [Test] + [Category("P1")] + [Description("Test IconURLSelector. Check whether IconURLSelector is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Components.Button.IconURLSelector A")] + [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IconURLSelector_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); + [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] + public void IconURLSelector_SET_GET_VALUE() + { + /* TEST CODE */ + var button = new Components.Button(); Assert.IsNotNull(button, "Should be not null"); Assert.IsInstanceOf(button, "Should be equal!"); - var stringSelector = new StringSelector - { - Normal = _image_path, - Selected = _image_path, - }; + var stringSelector = new StringSelector + { + Normal = _image_path, + Selected = _image_path, + }; Assert.IsNotNull(stringSelector, "Should be not null"); Assert.IsInstanceOf(stringSelector, "Should be equal!"); - button.IconURLSelector = stringSelector; - Assert.AreEqual(stringSelector.Normal, button.IconURLSelector.Normal, "Should be equals to the set value of IconURLSelector Normal"); - Assert.AreEqual(stringSelector.Selected, button.IconURLSelector.Selected, "Should be equals to the set value of IconURLSelector Selected"); - } - - [Test] - [Category("P1")] - [Description("Test IsSelected. Check whether IsSelected is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.IsSelected A")] - [Property("SPEC_URL", "-")] + button.IconURLSelector = stringSelector; + Assert.AreEqual(stringSelector.Normal, button.IconURLSelector.Normal, "Should be equals to the set value of IconURLSelector Normal"); + Assert.AreEqual(stringSelector.Selected, button.IconURLSelector.Selected, "Should be equals to the set value of IconURLSelector Selected"); + } + + [Test] + [Category("P1")] + [Description("Test IsSelected. Check whether IsSelected is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Components.Button.IsSelected A")] + [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IsSelected_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); + [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] + public void IsSelected_SET_GET_VALUE() + { + /* TEST CODE */ + var button = new Components.Button(); Assert.IsNotNull(button, "Should be not null"); Assert.IsInstanceOf(button, "Should be equal!"); - button.IsSelected = true; - Assert.AreEqual(true, button.IsSelected, "Retrieved IsSelected should be equal to set value"); - button.IsSelected = false; - Assert.AreEqual(false, button.IsSelected, "Retrieved IsSelected should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test IsEnabled. Check whether IsEnabled is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.IsEnabled A")] - [Property("SPEC_URL", "-")] + button.IsSelected = true; + Assert.AreEqual(true, button.IsSelected, "Retrieved IsSelected should be equal to set value"); + button.IsSelected = false; + Assert.AreEqual(false, button.IsSelected, "Retrieved IsSelected should be equal to set value"); + } + + [Test] + [Category("P1")] + [Description("Test IsEnabled. Check whether IsEnabled is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Components.Button.IsEnabled A")] + [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IsEnabled_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); + [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] + public void IsEnabled_SET_GET_VALUE() + { + /* TEST CODE */ + var button = new Components.Button(); Assert.IsNotNull(button, "Should be not null"); Assert.IsInstanceOf(button, "Should be equal!"); - button.IsEnabled = true; - Assert.AreEqual(true, button.IsEnabled, "Retrieved IsEnabled should be equal to set value"); - button.IsEnabled = false; - Assert.AreEqual(false, button.IsEnabled, "Retrieved IsEnabled should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test IconPadding. Check whether IconPadding is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.IconPadding A")] - [Property("SPEC_URL", "-")] + button.IsEnabled = true; + Assert.AreEqual(true, button.IsEnabled, "Retrieved IsEnabled should be equal to set value"); + button.IsEnabled = false; + Assert.AreEqual(false, button.IsEnabled, "Retrieved IsEnabled should be equal to set value"); + } + + [Test] + [Category("P1")] + [Description("Test IconPadding. Check whether IconPadding is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Components.Button.IconPadding A")] + [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IconPadding_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); + [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] + public void IconPadding_SET_GET_VALUE() + { + /* TEST CODE */ + var button = new Components.Button(); Assert.IsNotNull(button, "Should be not null"); Assert.IsInstanceOf(button, "Should be equal!"); - button.IconPadding = new Extents(0, 0, 10, 10); - Assert.AreEqual(0, button.IconPadding.Start, "Retrieved IconPadding.Start should be equal to set value"); - Assert.AreEqual(0, button.IconPadding.End, "Retrieved IconPadding.End should be equal to set value"); - Assert.AreEqual(10, button.IconPadding.Top, "Retrieved IconPadding.Top should be equal to set value"); - Assert.AreEqual(10, button.IconPadding.Bottom, "Retrieved IconPadding.Bottom should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TextPadding. Check whether TextPadding is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.TextPadding A")] - [Property("SPEC_URL", "-")] + button.IconPadding = new Extents(0, 0, 10, 10); + Assert.AreEqual(0, button.IconPadding.Start, "Retrieved IconPadding.Start should be equal to set value"); + Assert.AreEqual(0, button.IconPadding.End, "Retrieved IconPadding.End should be equal to set value"); + Assert.AreEqual(10, button.IconPadding.Top, "Retrieved IconPadding.Top should be equal to set value"); + Assert.AreEqual(10, button.IconPadding.Bottom, "Retrieved IconPadding.Bottom should be equal to set value"); + } + + [Test] + [Category("P1")] + [Description("Test TextPadding. Check whether TextPadding is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Components.Button.TextPadding A")] + [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TextPadding_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); + [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] + public void TextPadding_SET_GET_VALUE() + { + /* TEST CODE */ + var button = new Components.Button(); Assert.IsNotNull(button, "Should be not null"); Assert.IsInstanceOf(button, "Should be equal!"); - button.TextPadding = new Extents(0, 0, 10, 10); - Assert.AreEqual(0, button.TextPadding.Start, "Retrieved TextPadding.Start should be equal to set value"); - Assert.AreEqual(0, button.TextPadding.End, "Retrieved TextPadding.End should be equal to set value"); - Assert.AreEqual(10, button.TextPadding.Top, "Retrieved TextPadding.Top should be equal to set value"); - Assert.AreEqual(10, button.TextPadding.Bottom, "Retrieved TextPadding.Bottom should be equal to set value"); - } - + button.TextPadding = new Extents(0, 0, 10, 10); + Assert.AreEqual(0, button.TextPadding.Start, "Retrieved TextPadding.Start should be equal to set value"); + Assert.AreEqual(0, button.TextPadding.End, "Retrieved TextPadding.End should be equal to set value"); + Assert.AreEqual(10, button.TextPadding.Top, "Retrieved TextPadding.Top should be equal to set value"); + Assert.AreEqual(10, button.TextPadding.Bottom, "Retrieved TextPadding.Bottom should be equal to set value"); + } + [Test] [Category("P1")] [Description("Test OnKey. Check return the right value or not")] [Property("SPEC", "Tizen.NUI.Components.Button.OnKey M")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void OnKey_CHECK_RETURN_VALUE() - { - /* TEST CODE */ + [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] + public void OnKey_CHECK_RETURN_VALUE() + { + /* TEST CODE */ try { var button = new Components.Button(); @@ -451,9 +454,9 @@ namespace Tizen.NUI.Components.Tests Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); Assert.Fail("Caught Exception" + e.ToString()); - } - } - + } + } + [Test] [Category("P1")] [Description("Test StateChangedEvent. Check it has been triggered")] @@ -470,10 +473,10 @@ namespace Tizen.NUI.Components.Tests button.StateChangedEvent += OnStateChangedEvent; button.IsSelected = true; - Assert.AreEqual(true, _stateChangedEvent, "Should be equal!"); - button.StateChangedEvent -= OnStateChangedEvent; - } - + Assert.AreEqual(true, _stateChangedEvent, "Should be equal!"); + button.StateChangedEvent -= OnStateChangedEvent; + } + [Test] [Category("P1")] [Description("Test Dispose, try to dispose the Button.")] @@ -498,11 +501,11 @@ namespace Tizen.NUI.Components.Tests Assert.Fail("Caught Exception" + e.ToString()); } } - - private void OnStateChangedEvent(object sender, Components.Button.StateChangedEventArgs args) - { - _stateChangedEvent = true; - } - - } -} + + private void OnStateChangedEvent(object sender, Components.Button.StateChangedEventArgs args) + { + _stateChangedEvent = true; + } + + } +} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.cs index 758ed4f..a772af6 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.cs @@ -266,15 +266,15 @@ namespace Tizen.NUI.Components.Tests { try { - var tab = new Tab(); + var tab = new Tab(); Assert.IsNotNull(tab, "Should be not null!"); Assert.IsInstanceOf(tab, "Should be an instance of Tab type"); - var temActor = new View(); + var temActor = new View(); Assert.IsNotNull(temActor, "Should be not null!"); Assert.IsInstanceOf(temActor, "Should be an instance of View type"); - temActor.Name = "ChildActor"; + temActor.Name = "ChildActor"; tab.AddItem(new Tab.TabItemData() { Text = "Main" }); } catch (Exception e) @@ -295,15 +295,15 @@ namespace Tizen.NUI.Components.Tests { try { - var tab = new Tab(); + var tab = new Tab(); Assert.IsNotNull(tab, "Should be not null!"); Assert.IsInstanceOf(tab, "Should be an instance of Tab type"); - var temActor = new View(); + var temActor = new View(); Assert.IsNotNull(temActor, "Should be not null!"); Assert.IsInstanceOf(temActor, "Should be an instance of View type"); - temActor.Name = "ChildActor"; + temActor.Name = "ChildActor"; tab.InsertItem(new Tab.TabItemData() { Text = "" }, 0); } catch (Exception e) @@ -324,15 +324,15 @@ namespace Tizen.NUI.Components.Tests { try { - var tab = new Tab(); + var tab = new Tab(); Assert.IsNotNull(tab, "Should be not null!"); Assert.IsInstanceOf(tab, "Should be an instance of Tab type"); - var temActor = new View(); + var temActor = new View(); Assert.IsNotNull(temActor, "Should be not null!"); Assert.IsInstanceOf(temActor, "Should be an instance of View type"); - temActor.Name = "ChildActor"; + temActor.Name = "ChildActor"; tab.DeleteItem(0); } catch (Exception e) @@ -437,10 +437,10 @@ namespace Tizen.NUI.Components.Tests public MyTab(string style) : base(style) { } - protected override Attributes GetAttributes() + protected override ViewStyle GetViewStyle() { flagGetAttributes = true; - return new TabAttributes(); + return new TabStyle(); } protected override void OnUpdate() @@ -463,12 +463,12 @@ namespace Tizen.NUI.Components.Tests internal class UtilityTabStyle : StyleBase { - protected override Attributes GetAttributes() + protected override ViewStyle GetAttributes() { - TabAttributes attributes = new TabAttributes + TabStyle attributes = new TabStyle { - Space = new Vector4(56, 56, 1, 0), - UnderLineAttributes = new ViewAttributes + ItemPadding = new Extents(56, 56, 1, 0), + UnderLine = new ViewStyle { Size = new Size(1, 3), PositionUsesPivotPoint = true, @@ -476,7 +476,7 @@ namespace Tizen.NUI.Components.Tests PivotPoint = Tizen.NUI.PivotPoint.BottomLeft, BackgroundColor = new ColorSelector { All = Color.Blue }, }, - TextAttributes = new TextAttributes + Text = new TextLabelStyle { PointSize = new FloatSelector { All = 25 }, TextColor = new ColorSelector -- 2.7.4