From: zhouleonlei Date: Thu, 27 Aug 2020 01:37:46 +0000 (+0800) Subject: [NUI][ACR-335] Deprecate Popup,Tab,Toast and StateChanged X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e707582bd77b95883e502afe817275abed0a8c4;p=test%2Ftct%2Fcsharp%2Fapi.git [NUI][ACR-335] Deprecate Popup,Tab,Toast and StateChanged Removed the StateChangedEvent in button and slider. Plan to implement Popup,Tab and Toast in FamilyHub, so deprecated them in NUI.Components Change-Id: If4a28f22020a26670bf333fe24abec5da8ebd81a --- diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSPopup.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSPopup.cs deleted file mode 100755 index 1149d3fc5..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSPopup.cs +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License - */ - -using System; -using System.Threading.Tasks; -using NUnit.Framework; -using NUnit.Framework.TUnit; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.UIComponents; -using Tizen.NUI.Components; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.Popup test")] - public class PopupTests - { - private ManualTestComponents _testPage; - private WearableManualTestNUI _wearTestPage; - - private Popup _popup; - private float _pointSize = 20.0f; - private string _resourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource; - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST"); - if (ManualTest.IsWearable()) - { - _pointSize = 2.0f; - _wearTestPage = WearableManualTestNUI.GetInstance(); - } - else - { - _pointSize = ManualTest.GetPointSize(); - _testPage = ManualTestComponents.GetInstance(); - } - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST"); - } - - private void CreatePopup() - { - _popup = new Popup(new PopupStyle()); - Assert.IsNotNull(_popup, "Should be not null"); - Assert.IsInstanceOf(_popup, "Should be equal!"); - _popup.Size = new Size(Window.Instance.Size.Width * 0.2f, Window.Instance.Size.Height * 0.24f); - _popup.Position = new Position(Window.Instance.Size.Width * 0.39f, Window.Instance.Size.Height * 0.2f); - - // Title - _popup.TitlePointSize = _pointSize; - _popup.TitleHeight = (int)(Window.Instance.Size.Height * 0.025f); - _popup.TitleTextHorizontalAlignment = HorizontalAlignment.Begin; - _popup.TitleTextPosition = new Position(Window.Instance.Size.Width * 0.033f, Window.Instance.Size.Height * 0.01f); - _popup.TitleText = "Popup Title"; - - // Background - _popup.BackgroundImage = _resourcePath + "/images/popup_background.png"; - - // Buttons - _popup.AddButton("Yes"); - _popup.AddButton("Exit"); - _popup.ButtonTextPointSize = _pointSize; - - _popup.ButtonOverLayBackgroundColorSelector = new Selector - { - Normal = new Color(1.0f, 1.0f, 1.0f, 1.0f), - Pressed = new Color(0.0f, 0.0f, 0.0f, 0.1f), - Selected = new Color(1.0f, 1.0f, 1.0f, 1.0f), - }; - _popup.ButtonHeight = (int)(Window.Instance.Size.Height * 0.07); - TextLabel contentText = new TextLabel(); - contentText = new TextLabel(); - contentText.Size = new Size(Window.Instance.Size.Width * 0.2f, Window.Instance.Size.Height * 0.1f); - contentText.PointSize = _pointSize; - contentText.HorizontalAlignment = HorizontalAlignment.Begin; - contentText.VerticalAlignment = VerticalAlignment.Center; - contentText.Text = "Popup contentText "; - _popup.AddContentText(contentText); - - if (ManualTest.IsWearable()) - { - _popup.Size = new Size(130, 80); - _popup.Position = new Position(130,50); - _wearTestPage.ExecuteTC(_popup); - } - else - { - _testPage.ExecuteTC(_popup); - } - } - - public void OnPopupButtonClicked(object sender, Popup.ButtonClickEventArgs e) - { - Tizen.Log.Fatal("NUI.Components", "Popup OnPopupButtonClicked!!!!!!!!!!!!!!!!!!!!!"); - ManualTest.Confirm(); - } - - [Test] - [Category("P1")] - [Description("Test: PopupButtonClickEvent. Check whether the PopupButtonClickEvent will be triggered when user click the button on the popup")] - [Property("SPEC", "Tizen.NUI.Components.Popup.PopupButtonClickEvent E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - [Precondition(1, "If test on TV, prepare mouse and connect to TV.")] - [Step(1, "Click run TC")] - [Step(2, "Click(Touch) the 'Yes' button.")] - [Step(3, "TC will pass after touch or click.")] - [Postcondition(1, "NA")] - public async Task PopupButtonClickEvent_CB() - { - CreatePopup(); - _popup.PopupButtonClickEvent += OnPopupButtonClicked; - await ManualTest.WaitForConfirm(); - _popup.PopupButtonClickEvent -= OnPopupButtonClicked; - if (ManualTest.IsWearable()) - { - _wearTestPage.ClearTestCase(_popup); - } - else - { - _testPage.ClearTestCase(_popup); - } - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSlider.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSlider.cs index 25212c0b7..cdba60bb5 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSlider.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSlider.cs @@ -157,14 +157,6 @@ namespace Tizen.NUI.Components.Tests _window.Remove(_slider); } - private void OnStateChangedEvent(object sender, EventArgs e) - { - Tizen.Log.Fatal("NUI.Components", "StateChangedEvent event !!!!!"); - ManualTest.Confirm(); - _window.Remove(_slider); - } - - [Test] [Category("P1")] [Description("Test: ValueChangedEvent. Check whether the ValueChangedEvent event will be triggered or not when the user sliding the slider")] @@ -231,40 +223,6 @@ namespace Tizen.NUI.Components.Tests _slider.SlidingFinishedEvent -= OnSlidingFinishedEvent; _testPage.ClearTestCase(_view); } - } - - [Test] - [Category("P1")] - [Description("Test: Handle event StateChangedEvent. Check whether the StateChangedEvent event will be triggered or not when the user finish to slide the slider")] - [Property("SPEC", "Tizen.NUI.Components.Slider.StateChangedEvent E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - [Precondition(1, "If test on TV, prepare mouse and connect to TV.")] - [Step(1, "Connect the mouse to the TV (TM-1 don't need)")] - [Step(2, "Click run button to run TC")] - [Step(3, "Touch or use mouse(on TV) to drag the slider.")] - [Step(4, "When you stop sliding, TC will pass")] - [Postcondition(1, "NA")] - public async Task StateChangedEvent_CB() - { - if (_isWearable) - { - _wearTestPage.ExecuteTC(_label); - await ManualTest.WaitForConfirm(); - _wearTestPage.ClearTestCase(_label); - } - else - { - CreateView("Press Key-Down"); - _slider = new Slider(); - CreateSlider(_slider); - _slider.StateChangedEvent += OnStateChangedEvent; - // Waits for user confirmation. - await ManualTest.WaitForConfirm(); - _slider.StateChangedEvent -= OnStateChangedEvent; - _testPage.ClearTestCase(_view); - } } [Test] diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.StateChangedEventArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.StateChangedEventArgs.cs deleted file mode 100755 index 22f17edd5..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.StateChangedEventArgs.cs +++ /dev/null @@ -1,131 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -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.StateChangedEventArgs Tests")] - public class ButtonStateChangedEventArgsTests - { - private const string TAG = "Components"; - - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test StateChangedEventArgs empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Button.StateChangedEventArgs.StateChangedEventArgs C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void StateChangedEventArgs_CHECK_VALUE() - { - /* TEST CODE */ - var stateChangeEventArgs = new Components.Button.StateChangedEventArgs(); - Assert.IsNotNull(stateChangeEventArgs, "Should be not null!"); - Assert.IsInstanceOf(stateChangeEventArgs, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test PreviousState. Check whether PreviousState is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.StateChangedEventArgs.PreviousState A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void PreviousState_SET_GET_VALUE() - { - /* TEST CODE */ - var stateChangeEventArgs = new Components.Button.StateChangedEventArgs(); - Assert.IsNotNull(stateChangeEventArgs, "Should be not null!"); - Assert.IsInstanceOf(stateChangeEventArgs, "Should be equal!"); - - stateChangeEventArgs.PreviousState = ControlStates.Normal; - Assert.AreEqual(ControlStates.Normal, stateChangeEventArgs.PreviousState, "Should be equal"); - - stateChangeEventArgs.PreviousState = ControlStates.Focused; - Assert.AreEqual(ControlStates.Focused, stateChangeEventArgs.PreviousState, "Should be equal"); - - stateChangeEventArgs.PreviousState = ControlStates.Disabled; - Assert.AreEqual(ControlStates.Disabled, stateChangeEventArgs.PreviousState, "Should be equal"); - - stateChangeEventArgs.PreviousState = ControlStates.Selected; - Assert.AreEqual(ControlStates.Selected, stateChangeEventArgs.PreviousState, "Should be equal"); - - stateChangeEventArgs.PreviousState = ControlStates.Pressed; - Assert.AreEqual(ControlStates.Pressed, stateChangeEventArgs.PreviousState, "Should be equal"); - - stateChangeEventArgs.PreviousState = ControlStates.DisabledFocused; - Assert.AreEqual(ControlStates.DisabledFocused, stateChangeEventArgs.PreviousState, "Should be equal"); - - stateChangeEventArgs.PreviousState = ControlStates.SelectedFocused; - Assert.AreEqual(ControlStates.SelectedFocused, stateChangeEventArgs.PreviousState, "Should be equal"); - - stateChangeEventArgs.PreviousState = ControlStates.DisabledSelected; - Assert.AreEqual(ControlStates.DisabledSelected, stateChangeEventArgs.PreviousState, "Should be equal"); - - //stateChangeEventArgs.PreviousState = ControlStates.PressedSelected; - //Assert.AreEqual(ControlStates.PressedSelected, stateChangeEventArgs.PreviousState, "Should be equal"); - - } - - [Test] - [Category("P1")] - [Description("Test CurrentState. Check whether CurrentState is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.StateChangedEventArgs.CurrentState A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CurrentState_SET_GET_VALUE() - { - /* TEST CODE */ - var stateChangeEventArgs = new Components.Button.StateChangedEventArgs(); - Assert.IsNotNull(stateChangeEventArgs, "Should be not null!"); - Assert.IsInstanceOf(stateChangeEventArgs, "Should be equal!"); - - stateChangeEventArgs.CurrentState = ControlStates.Normal; - Assert.AreEqual(ControlStates.Normal, stateChangeEventArgs.CurrentState, "Should be equal"); - - stateChangeEventArgs.CurrentState = ControlStates.Focused; - Assert.AreEqual(ControlStates.Focused, stateChangeEventArgs.CurrentState, "Should be equal"); - - stateChangeEventArgs.CurrentState = ControlStates.Disabled; - Assert.AreEqual(ControlStates.Disabled, stateChangeEventArgs.CurrentState, "Should be equal"); - - stateChangeEventArgs.CurrentState = ControlStates.Selected; - Assert.AreEqual(ControlStates.Selected, stateChangeEventArgs.CurrentState, "Should be equal"); - - stateChangeEventArgs.CurrentState = ControlStates.Pressed; - Assert.AreEqual(ControlStates.Pressed, stateChangeEventArgs.CurrentState, "Should be equal"); - - stateChangeEventArgs.CurrentState = ControlStates.DisabledFocused; - Assert.AreEqual(ControlStates.DisabledFocused, stateChangeEventArgs.CurrentState, "Should be equal"); - - stateChangeEventArgs.CurrentState = ControlStates.SelectedFocused; - Assert.AreEqual(ControlStates.SelectedFocused, stateChangeEventArgs.CurrentState, "Should be equal"); - - stateChangeEventArgs.CurrentState = ControlStates.DisabledSelected; - Assert.AreEqual(ControlStates.DisabledSelected, stateChangeEventArgs.CurrentState, "Should be equal"); - - //stateChangeEventArgs.CurrentState = ControlStates.PressedSelected; - //Assert.AreEqual(ControlStates.PressedSelected, stateChangeEventArgs.CurrentState, "Should be equal"); - } - } -} 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 ff5a2ed00..747d32e7a 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.cs @@ -16,13 +16,11 @@ namespace Tizen.NUI.Components.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"; [SetUp] public void Init() { - _stateChangedEvent = false; Tizen.Log.Info(TAG, "Init() is called!"); } @@ -655,27 +653,6 @@ namespace Tizen.NUI.Components.Tests } } - [Test] - [Category("P1")] - [Description("Test StateChangedEvent. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Button.StateChangedEvent E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void StateChangedEvent_CHECK_VALUE() - { - /* TEST CODE */ - var button = new Button(); - Assert.IsNotNull(button, "Should be not null"); - Assert.IsInstanceOf(button, "Should be equal!"); - - button.StateChangedEvent += OnStateChangedEvent; - button.IsSelectable = true; - button.IsSelected = true; - Assert.AreEqual(true, _stateChangedEvent, "Should be equal!"); - button.StateChangedEvent -= OnStateChangedEvent; - } - [Test] [Category("P1")] [Description("Test Dispose, try to dispose the Button.")] @@ -857,11 +834,6 @@ namespace Tizen.NUI.Components.Tests } } - private void OnStateChangedEvent(object sender, Components.Button.StateChangedEventArgs args) - { - _stateChangedEvent = true; - } - public class MyButton : Button { public MyButton() : base() {} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopup.ButtonClickEventArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopup.ButtonClickEventArgs.cs deleted file mode 100755 index 475354e74..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopup.ButtonClickEventArgs.cs +++ /dev/null @@ -1,65 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -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.Popup.ButtonClickEventArgs Tests")] - public class PopupButtonClickEventArgsTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test ButtonClickEventArgs empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Popup.ButtonClickEventArgs.ButtonClickEventArgs C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ButtonClickEventArgs_CHECK_VALUE() - { - /* TEST CODE */ - var buttonClickEventArgs = new Components.Popup.ButtonClickEventArgs(); - Assert.IsNotNull(buttonClickEventArgs, "Should be not null!"); - Assert.IsInstanceOf(buttonClickEventArgs, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test ButtonIndex. Check whether ButtonIndex is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.ButtonClickEventArgs.ButtonIndex A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ButtonIndex_SET_GET_VALUE() - { - /* TEST CODE */ - var buttonClickEventArgs = new Components.Popup.ButtonClickEventArgs(); - Assert.IsNotNull(buttonClickEventArgs, "Should be not null!"); - Assert.IsInstanceOf(buttonClickEventArgs, "Should be equal!"); - - buttonClickEventArgs.ButtonIndex = 0; - Assert.AreEqual(0, buttonClickEventArgs.ButtonIndex, "Should be equal"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopup.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopup.cs deleted file mode 100755 index 870184541..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopup.cs +++ /dev/null @@ -1,530 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.Components; -using Tizen.NUI.BaseComponents; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.Popup Tests")] - public class PopupTests - { - private const string TAG = "Components"; - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - private string _path = Tizen.Applications.Application.Current.DirectoryInfo.Resource; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test Popup empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Popup.Popup C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Popup_CHECK_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - Assert.IsNotNull(popup, "Should be not Null!"); - Assert.IsInstanceOf(popup, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Popup constructor using string. Check whether Popup is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.Popup C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Popup_INIT_WITH_STRING() - { - /* TEST CODE */ - StyleManager.Instance.Theme = "default"; - StyleManager.Instance.RegisterStyle("defaultPopup", "default", typeof(DefaultPopupStyle)); - var popup = new Popup("defaultPopup"); - Assert.IsNotNull(popup, "Should be not null!"); - Assert.IsInstanceOf(popup, "Should be an instance of Popup!"); - } - - [Test] - [Category("P2")] - [Description("Check exception when constructing a Popup with nonexistent style")] - [Property("SPEC", "Tizen.NUI.Components.Popup.Popup C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTX")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Popup_INIT_WITH_STRING_Exception() - { - /* TEST CODE */ - try - { - var popup = new Popup("defaultPopupX"); - Assert.Fail("Should throw the Exception: There is no style of defaultPopupX !"); - } - catch(InvalidOperationException e) - { - Assert.Pass("InvalidOperationException: passed!"); - } - } - - [Test] - [Category("P1")] - [Description("Test Popup constructor using style. Check whether Popup is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.Popup C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "PopupStyle")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Popup_INIT_WITH_STYLE() - { - /* TEST CODE */ - var style = new PopupStyle(); - Assert.IsNotNull(style, "Should be not null!"); - Assert.IsInstanceOf(style, "Should be an instance of PopupStyle!"); - - var popup = new Popup(style); - Assert.IsNotNull(popup, "Should be not null!"); - Assert.IsInstanceOf(popup, "Should be an instance of Popup!"); - } - - [Test] - [Category("P1")] - [Description("Test Style. Check whether Style is readable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.Style A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void Style_CHECK_GET_VALUE() - { - /* TEST CODE */ - var popup = new Popup(); - Assert.IsNotNull(popup, "Should be not null"); - Assert.IsInstanceOf(popup, "Should be an instance of Popup!"); - - var style = popup.Style; - Assert.IsNotNull(style, "Should be not null"); - Assert.IsInstanceOf(style, "Should be an instance of PopupStyle!"); - } - - [Test] - [Category("P1")] - [Description("Test TitleText. Check whether TitleText is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.TitleText A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TitleText_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - Assert.IsNotNull(popup, "Should be not Null!"); - Assert.IsInstanceOf(popup, "Should be equal!"); - - popup.TitleText = "Test TitleText"; - Assert.AreEqual("Test TitleText", popup.TitleText, "Should be equals to the set value of TitleText"); - } - - [Test] - [Category("P1")] - [Description("Test ButtonCount. Check whether ButtonCount is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.ButtonCount A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ButtonCount_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - Assert.IsNotNull(popup, "Should be not Null!"); - Assert.IsInstanceOf(popup, "Should be equal!"); - - popup.ButtonCount = 2; - Assert.AreEqual(2, popup.ButtonCount, "Should be equals to the set value of ButtonCount"); - } - - [Test] - [Category("P1")] - [Description("Test ContentView. Check whether ContentView is readable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.ContentView A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ContentView_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - Assert.IsNotNull(popup.ContentView, "Should be equals!"); - Assert.IsInstanceOf(popup.ContentView, "Should be an instance of view!"); - } - - [Test] - [Category("P1")] - [Description("Test TitlePointSize. Check whether TitlePointSize is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.TitlePointSize A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TitlePointSize_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - Assert.IsNotNull(popup, "Should be not Null!"); - Assert.IsInstanceOf(popup, "Should be equal!"); - - popup.TitlePointSize = 10.0f; - Assert.AreEqual(10.0f, popup.TitlePointSize, "Should be equals to the set value of TitlePointSize"); - } - - [Test] - [Category("P1")] - [Description("Test TitleTextColor. Check whether TitleTextColor is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.TitleTextColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TitleTextColor_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - Assert.IsNotNull(popup, "Should be not Null!"); - Assert.IsInstanceOf(popup, "Should be equal!"); - - 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!"); - popup.TitleTextColor = color; - - Assert.AreEqual(color.R, popup.TitleTextColor.R, "Should be equals to the color.R set"); - Assert.AreEqual(color.G, popup.TitleTextColor.G, "Should be equals to the color.G set"); - Assert.AreEqual(color.B, popup.TitleTextColor.B, "Should be equals to the color.B set"); - Assert.AreEqual(color.A, popup.TitleTextColor.A, "Should be equals to the color.A set"); - - } - - [Test] - [Category("P1")] - [Description("Test TitleTextHorizontalAlignment. Check whether TitleTextHorizontalAlignment is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.TitleTextHorizontalAlignment A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TitleTextHorizontalAlignment_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - Assert.IsNotNull(popup, "Should be not Null!"); - Assert.IsInstanceOf(popup, "Should be equal!"); - - popup.TitleTextHorizontalAlignment = HorizontalAlignment.Begin; - Assert.AreEqual(HorizontalAlignment.Begin, popup.TitleTextHorizontalAlignment, "Should be equals to the set value of TitleTextHorizontalAlignment"); - } - - [Test] - [Category("P1")] - [Description("Test TitleTextPosition. Check whether TitleTextPosition is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.TitleTextPosition A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TitleTextPosition_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - Assert.IsNotNull(popup, "Should be not Null!"); - Assert.IsInstanceOf(popup, "Should be equal!"); - - popup.TitleTextPosition = new Position(10, 10); - - Assert.AreEqual(10, popup.TitleTextPosition.X, "Should be equal"); - Assert.AreEqual(10, popup.TitleTextPosition.Y, "Should be equal"); - } - - [Test] - [Category("P1")] - [Description("Test TitleHeight. Check whether TitleHeight is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.TitleHeight A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TitleHeight_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - Assert.IsNotNull(popup, "Should be not Null!"); - Assert.IsInstanceOf(popup, "Should be equal!"); - - popup.TitleHeight = 10; - Assert.AreEqual(10, popup.TitleHeight, "Should be equals to the set value of TitleHeight"); - } - - [Test] - [Category("P1")] - [Description("Test ButtonHeight. Check whether ButtonHeight is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.ButtonHeight A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ButtonHeight_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - Assert.IsNotNull(popup, "Should be not Null!"); - Assert.IsInstanceOf(popup, "Should be equal!"); - - popup.ButtonHeight = 10; - Assert.AreEqual(10, popup.ButtonHeight, "Should be equals to the set value of ButtonHeight"); - } - - [Test] - [Category("P1")] - [Description("Test ButtonTextPointSize. Check whether ButtonTextPointSize is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.ButtonTextPointSize A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ButtonTextPointSize_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - Assert.IsNotNull(popup, "Should be not Null!"); - Assert.IsInstanceOf(popup, "Should be equal!"); - - popup.ButtonTextPointSize = 10.0f; - Assert.AreEqual(10.0f, popup.ButtonTextPointSize, "Should be equals to the set value of ButtonTextPointSize"); - } - - [Test] - [Category("P1")] - [Description("Test ButtonFontFamily. Check whether ButtonFontFamily is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.ButtonFontFamily A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ButtonFontFamily_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - Assert.IsNotNull(popup, "Should be not Null!"); - Assert.IsInstanceOf(popup, "Should be equal!"); - - popup.ButtonFontFamily = "SamsungOne 500"; - Assert.AreEqual("SamsungOne 500", popup.ButtonFontFamily, "Should be equals to the set value of ButtonFontFamily"); - } - - [Test] - [Category("P1")] - [Description("Test ButtonTextAlignment. Check whether ButtonTextAlignment is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.ButtonTextAlignment A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ButtonTextAlignment_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - Assert.IsNotNull(popup, "Should be not Null!"); - Assert.IsInstanceOf(popup, "Should be equal!"); - - popup.ButtonTextAlignment = HorizontalAlignment.Begin; - Assert.AreEqual(HorizontalAlignment.Begin, popup.ButtonTextAlignment, "Should be equal"); - } - - [Test] - [Category("P1")] - [Description("Test ButtonTextColor. Check whether ButtonTextColor is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.ButtonTextColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ButtonTextColor_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - Assert.IsNotNull(popup, "Should be not Null!"); - Assert.IsInstanceOf(popup, "Should be equal!"); - - var textColor = new Color(0.0f, 0.0f, 1.0f, 0.0f); - Assert.IsNotNull(textColor, "Should be not Null!"); - Assert.IsInstanceOf(textColor, "Should be equal!"); - popup.ButtonTextColor = textColor; - - Assert.AreEqual(textColor.R, popup.ButtonTextColor.R, "Should be equal"); - Assert.AreEqual(textColor.G, popup.ButtonTextColor.G, "Should be equal"); - Assert.AreEqual(textColor.B, popup.ButtonTextColor.B, "Should be equal"); - Assert.AreEqual(textColor.A, popup.ButtonTextColor.A, "Should be equal"); - } - - [Test] - [Category("P1")] - [Description("Test SetButtonText. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Popup.SetButtonText M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void SetButtonText_CHECK_VALUE() - { - /* TEST CODE */ - try - { - Popup popup = new Popup(); - Assert.IsNotNull(popup, "Should be not Null!"); - Assert.IsInstanceOf(popup, "Should be equal!"); - popup.SetButtonText(0, "YES"); - } - catch (Exception e) - { - 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 Dispose, try to dispose the Popup.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.Dispose M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Dispose_TEST() - { - /* TEST CODE */ - try - { - Popup popup = new Popup(); - Assert.IsNotNull(popup, "Should be not Null!"); - Assert.IsInstanceOf(popup, "Should be equal!"); - popup.Dispose(); - } - catch (Exception e) - { - 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 AddButton. Check whether AddButton works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.AddButton M")] - [Property("SPEC_URL", " - ")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string, string")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void AddButton_WITH_STRING_STRING() - { - try - { - var popup = new Popup(); - var style = new ButtonStyle(); - popup.AddButton("button1", "button"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test AddButton. Check whether AddButton works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.AddButton M")] - [Property("SPEC_URL", " - ")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string, ButtonStyle")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void AddButton_WITH_STRING_STYLE() - { - try - { - var popup = new Popup(); - var style = new ButtonStyle(); - popup.AddButton("button1", style); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test ApplyStyle. Check whether ApplyStyle works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.ApplyStyle M")] - [Property("SPEC_URL", " - ")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void ApplyStyle_NO_RETURN_VALUE() - { - try - { - var popup = new Popup(); - var style = new ButtonStyle(); - popup.ApplyStyle(style); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test CreateViewStyle. Check whether CreateViewStyle works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.CreateViewStyle M")] - [Property("SPEC_URL", " - ")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void CreateViewStyle_CHECK_RETURN_VALUE() - { - try - { - var popup = new MyPopup(); - ViewStyle style = popup.CreateMyViewStyle(); - Assert.IsNotNull(style, "Should be not null"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - public class MyPopup : Popup - { - public MyPopup() : base() {} - - public ViewStyle CreateMyViewStyle() - { - return base.CreateViewStyle(); - } - } - - public class DefaultPopupStyle : StyleBase - { - protected override ViewStyle GetViewStyle() - { - return new PopupStyle(); - } - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopupStyle.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopupStyle.cs deleted file mode 100755 index 802879041..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopupStyle.cs +++ /dev/null @@ -1,125 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; -using Tizen.NUI.BaseComponents; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.PopupStyle Tests")] - public class PopupStyleTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test PopupStyle empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.PopupStyle.PopupStyle C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void PopupStyle_INIT() - { - /* TEST CODE */ - var style = new PopupStyle(); - Assert.IsNotNull(style, "Should be not null!"); - Assert.IsInstanceOf(style, "Should be an instance of PopupStyle!"); - } - - [Test] - [Category("P1")] - [Description("Test PopupStyle constructor using style. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.PopupStyle.PopupStyle C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "PopupStyle")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void PopupStyle_INIT_WITH_STYLE() - { - /* TEST CODE */ - var style1 = new PopupStyle(); - Assert.IsNotNull(style1, "Should be not null!"); - Assert.IsInstanceOf(style1, "Should be an instance of PopupStyle!"); - - var style2 = new PopupStyle(style1); - Assert.IsNotNull(style2, "Should be not null!"); - Assert.IsInstanceOf(style2, "Should be an instance of PopupStyle!"); - } - - [Test] - [Category("P1")] - [Description("Test Buttons. Check whether Buttons is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.PopupStyle.Buttons A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Buttons_SET_GET_VALUE() - { - /* TEST CODE */ - var style = new PopupStyle(); - Assert.IsNotNull(style, "Should be not null"); - Assert.IsInstanceOf(style, "Should be equal!"); - //IsSelectable needs be set true to change IsSelected - style.Buttons = new ButtonStyle() { - IsSelectable = true, - IsSelected = true, - }; - Assert.AreEqual(true, style.Buttons.IsSelected, "Should be equals to the set value"); - } - - [Test] - [Category("P1")] - [Description("Test Title. Check whether Title is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.PopupStyle.Title A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Title_SET_GET_VALUE() - { - /* TEST CODE */ - var style = new PopupStyle(); - Assert.IsNotNull(style, "Should be not null"); - Assert.IsInstanceOf(style, "Should be equal!"); - style.Title = new TextLabelStyle() {Text = "test"}; - Assert.AreEqual("test", style.Title.Text.All, "Should be equals to the set value"); - } - - [Test] - [Category("P1")] - [Description("Test CopyFrom. Check whether CopyFrom works or not.")] - [Property("SPEC", "Tizen.NUI.Components.PopupStyle.CopyFrom M")] - [Property("SPEC_URL", " - ")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void CopyFrom_NO_RETURN_VALUE() - { - try - { - var style1 = new PopupStyle(); - var style2 = new PopupStyle(); - style2.CopyFrom(style1); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSlider.StateChangedArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSlider.StateChangedArgs.cs deleted file mode 100755 index 1e8778ae8..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSlider.StateChangedArgs.cs +++ /dev/null @@ -1,73 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.Slider.StateChangedArgs Tests")] - public class StateChangedArgsTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a StateChangedArgs object. Check whether StateChangedArgs is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Slider.StateChangedArgs.StateChangedArgs C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void StateChangedArgs_INIT() - { - var eventArgs = new Slider.StateChangedArgs(); - Assert.IsNotNull(eventArgs, "Should be not null!"); - Assert.IsInstanceOf(eventArgs, "Should return StateChangedArgs instance."); - } - - [Test] - [Category("P1")] - [Description("Test CurrentState. Check whether CurrentState is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Slider.StateChangedArgs.CurrentState A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void CurrentState_SET_GET_VALUE() - { - var eventArgs = new Slider.StateChangedArgs(); - Assert.IsNotNull(eventArgs, "Should be not null!"); - Assert.IsInstanceOf(eventArgs, "Should return StateChangedArgs instance."); - - eventArgs.CurrentState = ControlStates.Normal; - Assert.AreEqual(ControlStates.Normal, eventArgs.CurrentState, "Retrieved CurrentState should be equal to set value."); - eventArgs.CurrentState = ControlStates.Focused; - Assert.AreEqual(ControlStates.Focused, eventArgs.CurrentState, "Retrieved CurrentState should be equal to set value."); - eventArgs.CurrentState = ControlStates.Disabled; - Assert.AreEqual(ControlStates.Disabled, eventArgs.CurrentState, "Retrieved CurrentState should be equal to set value."); - eventArgs.CurrentState = ControlStates.Selected; - Assert.AreEqual(ControlStates.Selected, eventArgs.CurrentState, "Retrieved CurrentState should be equal to set value."); - eventArgs.CurrentState = ControlStates.Pressed; - Assert.AreEqual(ControlStates.Pressed, eventArgs.CurrentState, "Retrieved CurrentState should be equal to set value."); - eventArgs.CurrentState = ControlStates.DisabledFocused; - Assert.AreEqual(ControlStates.DisabledFocused, eventArgs.CurrentState, "Retrieved CurrentState should be equal to set value."); - eventArgs.CurrentState = ControlStates.SelectedFocused; - Assert.AreEqual(ControlStates.SelectedFocused, eventArgs.CurrentState, "Retrieved CurrentState should be equal to set value."); - eventArgs.CurrentState = ControlStates.DisabledSelected; - Assert.AreEqual(ControlStates.DisabledSelected, eventArgs.CurrentState, "Retrieved CurrentState should be equal to set value."); - //eventArgs.CurrentState = ControlStates.PressedSelected; - //Assert.AreEqual(ControlStates.PressedSelected, eventArgs.CurrentState, "Retrieved CurrentState should be equal to set value."); - } - } -} - diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.ItemChangedEventArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.ItemChangedEventArgs.cs deleted file mode 100755 index 165093dc9..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.ItemChangedEventArgs.cs +++ /dev/null @@ -1,73 +0,0 @@ -using NUnit.Framework; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.Tab.ItemChangedEventArgs Tests")] - public class ItemChangedEventArgsTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a ItemChangedEventArgs object. Check whether ItemChangedEventArgs is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.ItemChangedEventArgs.ItemChangedEventArgs C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void ItemChangedEventArgs_INIT() - { - var eventArgs = new Tab.ItemChangedEventArgs(); - Assert.IsNotNull(eventArgs, "Should be not null!"); - Assert.IsInstanceOf(eventArgs, "Should return ItemChangedEventArgs instance."); - } - - [Test] - [Category("P1")] - [Description("Test PreviousIndex. Check whether PreviousIndex is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.ItemChangedEventArgs.PreviousIndex A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void PreviousIndex_SET_GET_VALUE() - { - var eventArgs = new Tab.ItemChangedEventArgs(); - Assert.IsNotNull(eventArgs, "Should be not null!"); - Assert.IsInstanceOf(eventArgs, "Should return ItemChangedEventArgs instance."); - - eventArgs.PreviousIndex = 1; - Assert.AreEqual(1, eventArgs.PreviousIndex, "Retrieved PreviousIndex should be equal to set value."); - } - - [Test] - [Category("P1")] - [Description("Test CurrentIndex. Check whether CurrentIndex is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.ItemChangedEventArgs.CurrentIndex A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void CurrentIndex_SET_GET_VALUE() - { - var eventArgs = new Tab.ItemChangedEventArgs(); - Assert.IsNotNull(eventArgs, "Should be not null!"); - Assert.IsInstanceOf(eventArgs, "Should return ItemChangedEventArgs instance."); - - eventArgs.CurrentIndex = 2; - Assert.AreEqual(2, eventArgs.CurrentIndex, "Retrieved CurrentIndex should be equal to set value."); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.TabItemData.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.TabItemData.cs deleted file mode 100755 index e2a4fc4ba..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.TabItemData.cs +++ /dev/null @@ -1,55 +0,0 @@ -using NUnit.Framework; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.Tab.TabItemData Tests")] - public class TabItemDataTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test TabItemData. Check whether TabItemData is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.TabItemData.TabItemData C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void TabItemData_INIT() - { - var tabItemData = new Tab.TabItemData(); - Assert.IsNotNull(tabItemData, "Can't create success object TabItemData"); - Assert.IsInstanceOf(tabItemData, "Should be an instance of TabItemData type."); - } - - [Test] - [Category("P1")] - [Description("Test Text. Check whether Text works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.TabItemData.Text A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void Text_SET_GET_VALUE() - { - var tabItemData = new Tab.TabItemData(); - Assert.IsNotNull(tabItemData, "Can't create success object TabItemData"); - Assert.IsInstanceOf(tabItemData, "Should be an instance of TabItemData type."); - - tabItemData.Text = "Main"; - Assert.AreEqual("Main", tabItemData.Text, "Retrieved Text should be equal to set value"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.cs deleted file mode 100755 index 1ffffadfe..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.cs +++ /dev/null @@ -1,682 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI.Components.Test; -using Tizen.NUI.BaseComponents; -using System.Threading.Tasks; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.Tab Tests")] - public class TabTests - { - private const string TAG = "Components"; - private bool _checkValue; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - private void OnItemChangedEvent(object obj, Tab.ItemChangedEventArgs args) - { - _checkValue = true; - } - - [Test] - [Category("P1")] - [Description("Test Construct. Check whether Tab construct.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.Tab C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - [Property("COVPARAM", "")] - public void Tab_INIT() - { - var tab = new Tab(); - Assert.IsNotNull(tab, "Should be not null!"); - Assert.IsInstanceOf(tab, "Should return Tab instance."); - } - - [Test] - [Category("P1")] - [Description("Test Tab constructor using string. Check whether Tab is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.Tab C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Tab_INIT_WITH_STRING() - { - /* TEST CODE */ - StyleManager.Instance.Theme = "default"; - StyleManager.Instance.RegisterStyle("defaultTab", "default", typeof(DefaultTabStyle)); - var tab = new Tab("defaultTab"); - Assert.IsNotNull(tab, "Should be not null!"); - Assert.IsInstanceOf(tab, "Should be an instance of Tab!"); - } - - [Test] - [Category("P2")] - [Description("Check exception when constructing a Tab with nonexistent style.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.Tab C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTX")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Tab_INIT_WITH_STRING_Exception() - { - /* TEST CODE */ - try - { - var tab = new Tab("defaultTabX"); - Assert.Fail("Should throw the Exception: There is no style of defaultTabX !"); - } - catch(InvalidOperationException e) - { - Assert.Pass("InvalidOperationException: passed!"); - } - } - - [Test] - [Category("P1")] - [Description("Test Tab constructor using style. Check whether Tab is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.Tab C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "TabStyle")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Tab_INIT_WITH_STYLE() - { - /* TEST CODE */ - var style = new TabStyle(); - Assert.IsNotNull(style, "Should be not null!"); - Assert.IsInstanceOf(style, "Should be an instance of TabStyle!"); - - var tab = new Tab(style); - Assert.IsNotNull(tab, "Should be not null!"); - Assert.IsInstanceOf(tab, "Should be an instance of Tab!"); - } - - [Test] - [Category("P1")] - [Description("Test Style. Check whether Style is readable.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.Style A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void Style_CHECK_GET_VALUE() - { - /* TEST CODE */ - var tab = new Tab(); - Assert.IsNotNull(tab, "Should be not null"); - Assert.IsInstanceOf(tab, "Should be an instance of Tab!"); - - var style = tab.Style; - Assert.IsNotNull(style, "Should be not null"); - Assert.IsInstanceOf(style, "Should be an instance of TabStyle!"); - } - - [Test] - [Category("P1")] - [Description("Test SelectedItemIndex. Check whether SelectedItemIndex works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.SelectedItemIndex A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void SelectedItemIndex_SET_GET_VALUE() - { - /* TEST CODE */ - var tab = new Tab(); - Assert.IsNotNull(tab, "Should be not null!"); - Assert.IsInstanceOf(tab, "Should return Tab instance."); - - tab.SelectedItemIndex = 0; - Assert.AreEqual(0, tab.SelectedItemIndex, "Retrieved SelectedItemIndex should be equal to set value"); - } - - [Test] - [Category("P2")] - [Description("Check exception when SelectedItemIndex receive an invalid value.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.SelectedItemIndex A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PEX")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void SelectedItemIndex_SET_Exception() - { - /* TEST CODE */ - try - { - var tab = new Tab(); - Assert.IsNotNull(tab, "Should be not null!"); - Assert.IsInstanceOf(tab, "Should return Tab instance."); - - tab.SelectedItemIndex = -1; - Assert.Fail("Should throw the ArgumentException !"); - } - catch(ArgumentException e) - { - Assert.Pass("ArgumentException: passed!"); - } - } - - [Test] - [Category("P1")] - [Description("Test UseTextNaturalSize. Check whether UseTextNaturalSize works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.UseTextNaturalSize A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void UseTextNaturalSize_SET_GET_VALUE() - { - /* TEST CODE */ - var tab = new Tab(); - Assert.IsNotNull(tab, "Should be not null!"); - Assert.IsInstanceOf(tab, "Should be an instance of Tab type"); - tab.UseTextNaturalSize = true; - Assert.AreEqual(true, tab.UseTextNaturalSize, "Retrieved UseTextNaturalSize should be equal to set value"); - tab.UseTextNaturalSize = false; - Assert.AreEqual(false, tab.UseTextNaturalSize, "Retrieved UseTextNaturalSize should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test ItemSpace. Check whether ItemSpace works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.ItemSpace A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void ItemSpace_SET_GET_VALUE() - { - /* TEST CODE */ - var tab = new Tab(); - Assert.IsNotNull(tab, "Should be not null!"); - Assert.IsInstanceOf(tab, "Should be an instance of Tab type"); - tab.ItemSpace = 25; - Assert.AreEqual(25, tab.ItemSpace, "Retrieved ItemSpace should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test Space. Check whether Space works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.Space A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void Space_SET_GET_VALUE() - { - /* TEST CODE */ - var tab = new Tab(); - Assert.IsNotNull(tab, "Should be not null!"); - Assert.IsInstanceOf(tab, "Should be an instance of Tab type"); - tab.Space = new Extents(0, 0, 25, 25); - Assert.AreEqual(0, tab.Space.Start, "Retrieved Space.Start should be equal to set value"); - Assert.AreEqual(0, tab.Space.End, "Retrieved Space.End should be equal to set value"); - Assert.AreEqual(25, tab.Space.Top, "Retrieved Space.Top should be equal to set value"); - Assert.AreEqual(25, tab.Space.Bottom, "Retrieved Space.Bottom should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test UnderLineSize. Check whether UnderLineSize works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.UnderLineSize A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void UnderLineSize_SET_GET_VALUE() - { - /* TEST CODE */ - var tab = new Tab(); - Assert.IsNotNull(tab, "Should be not null!"); - Assert.IsInstanceOf(tab, "Should be an instance of Tab type"); - tab.UnderLineSize = new Size(100, 100); - Assert.AreEqual(100, tab.UnderLineSize.Width, "Retrieved UnderLineSize width should be equal to set value"); - Assert.AreEqual(100, tab.UnderLineSize.Height, "Retrieved UnderLineSize height should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test UnderLineBackgroundColor. Check whether UnderLineBackgroundColor works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.UnderLineBackgroundColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void UnderLineBackgroundColor_SET_GET_VALUE() - { - /* TEST CODE */ - var tab = new Tab(); - Assert.IsNotNull(tab, "Should be not null!"); - Assert.IsInstanceOf(tab, "Should be an instance of Tab type"); - - var color = Color.Red; - Assert.IsNotNull(color, "Should be not null!"); - Assert.IsInstanceOf(color, "Should be an instance of Color type"); - - tab.UnderLineBackgroundColor = color; - Assert.AreEqual(color.R, tab.UnderLineBackgroundColor.R, "Retrieved UnderLineBackgroundColor should be equal to set value"); - Assert.AreEqual(color.G, tab.UnderLineBackgroundColor.G, "Retrieved UnderLineBackgroundColor should be equal to set value"); - Assert.AreEqual(color.B, tab.UnderLineBackgroundColor.B, "Retrieved UnderLineBackgroundColor should be equal to set value"); - Assert.AreEqual(color.A, tab.UnderLineBackgroundColor.A, "Retrieved TextColor should be equal to set value"); - } - - - [Test] - [Category("P1")] - [Description("Test PointSize. Check whether PointSize works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.PointSize A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void PointSize_SET_GET_VALUE() - { - /* TEST CODE */ - var tab = new Tab(); - Assert.IsNotNull(tab, "Should be not null!"); - Assert.IsInstanceOf(tab, "Should be an instance of Tab type"); - - tab.PointSize = 38; - - Assert.AreEqual(38, tab.PointSize, "Should be equal!"); - } - - - [Test] - [Category("P1")] - [Description("Test FontFamily. Check whether FontFamily works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.FontFamily A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void FontFamily_SET_GET_VALUE() - { - /* TEST CODE */ - var tab = new Tab(); - Assert.IsNotNull(tab, "Should be not null!"); - Assert.IsInstanceOf(tab, "Should be an instance of Tab type"); - - tab.FontFamily = "FontFamily"; - Assert.AreEqual("FontFamily", tab.FontFamily, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test TextColor. Check whether TextColor works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.TextColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void TextColor_SET_GET_VALUE() - { - /* TEST CODE */ - var tab = new Tab(); - Assert.IsNotNull(tab, "Should be not null!"); - Assert.IsInstanceOf(tab, "Should be an instance of Tab type"); - - var color = Color.Red; - Assert.IsNotNull(color, "Should be not null!"); - Assert.IsInstanceOf(color, "Should be an instance of Color type"); - - tab.TextColor = color; - Assert.AreEqual(color.R, tab.TextColor.R, "Retrieved TextColor should be equal to set value"); - Assert.AreEqual(color.G, tab.TextColor.G, "Retrieved TextColor should be equal to set value"); - Assert.AreEqual(color.B, tab.TextColor.B, "Retrieved TextColor should be equal to set value"); - Assert.AreEqual(color.A, tab.TextColor.A, "Retrieved TextColor should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TextColorSelector. Check whether TextColorSelector works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.TextColorSelector A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void TextColorSelector_SET_GET_VALUE() - { - /* TEST CODE */ - var tab = new Tab(); - Assert.IsNotNull(tab, "Should be not null!"); - Assert.IsInstanceOf(tab, "Should be an instance of Tab type"); - - var color = Color.Red; - Assert.IsNotNull(color, "Should be not null!"); - Assert.IsInstanceOf(color, "Should be an instance of Color type"); - - tab.TextColorSelector = new ColorSelector() {All=Color.Red}; - Assert.AreEqual(color.R, tab.TextColorSelector.All.R, "Retrieved TextColorSelector should be equal to set value"); - Assert.AreEqual(color.G, tab.TextColorSelector.All.G, "Retrieved TextColorSelector should be equal to set value"); - Assert.AreEqual(color.B, tab.TextColorSelector.All.B, "Retrieved TextColorSelector should be equal to set value"); - Assert.AreEqual(color.A, tab.TextColorSelector.All.A, "Retrieved TextColorSelector should be equal to set value"); - } - - [Test] - [Category("P2")] - [Description("Check exception when TextColorSelector receive a null value.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.TextColorSelector A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PEX")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void TextColorSelector_SET_Exception() - { - /* TEST CODE */ - try - { - var tab = new Tab(); - Assert.IsNotNull(tab, "Should be not null!"); - Assert.IsInstanceOf(tab, "Should be an instance of Tab type"); - - tab.TextColorSelector = null; - Assert.Fail("Should throw the NullReferenceException!"); - } - catch(NullReferenceException e) - { - Assert.Pass("NullReferenceException: passed!"); - } - } - - [Test] - [Category("P1")] - [Description("Test AddItem. Check whether tab add child")] - [Property("SPEC", "Tizen.NUI.Components.Tab.AddItem M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void AddItem_CHECK_RETURN_VALUE() - { - try - { - 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(); - Assert.IsNotNull(temActor, "Should be not null!"); - Assert.IsInstanceOf(temActor, "Should be an instance of View type"); - - temActor.Name = "ChildActor"; - tab.AddItem(new Tab.TabItemData() { Text = "Main" }); - } - catch (Exception e) - { - Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test InsertItem. Check whether tab add child")] - [Property("SPEC", "Tizen.NUI.Components.Tab.InsertItem M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void InsertItem_CHECK_RETURN_VALUE() - { - try - { - 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(); - Assert.IsNotNull(temActor, "Should be not null!"); - Assert.IsInstanceOf(temActor, "Should be an instance of View type"); - - temActor.Name = "ChildActor"; - tab.InsertItem(new Tab.TabItemData() { Text = "" }, 0); - } - catch (Exception e) - { - Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P2")] - [Description("Check exception when tab add child by an invalid index")] - [Property("SPEC", "Tizen.NUI.Components.Tab.InsertItem M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void InsertItem_INVALID_INDEX_Exception() - { - try - { - var tab = new Tab(); - Assert.IsNotNull(tab, "Should be not null!"); - Assert.IsInstanceOf(tab, "Should be an instance of Tab type"); - - tab.InsertItem(new Tab.TabItemData() { Text = "" }, -1); - Assert.Fail("Should throw the ArgumentException!"); - } - catch (ArgumentException e) - { - Assert.Pass("ArgumentException: passed!"); - } - } - - [Test] - [Category("P1")] - [Description("Test DeleteItem. Check whether tab add child")] - [Property("SPEC", "Tizen.NUI.Components.Tab.DeleteItem M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void DeleteItem_CHECK_RETURN_VALUE() - { - try - { - 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(); - Assert.IsNotNull(temActor, "Should be not null!"); - Assert.IsInstanceOf(temActor, "Should be an instance of View type"); - - temActor.Name = "ChildActor"; - tab.DeleteItem(0); - } - catch (Exception e) - { - Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test ItemChangedEvent. Check Event Handler of Value Change.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.ItemChangedEvent E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public async Task ItemChangedEvent_CHECK_EVENT() - { - var myTab = new MyTab() - { - Size2D = new Size2D(700, 108), - Position2D = new Position2D(100, 300), - UseTextNaturalSize = true, - ItemSpace = 40, - Space = new Extents(56, 56, 1, 0), - UnderLineSize = new Size(1, 3), - UnderLineBackgroundColor = Color.Cyan, - PointSize = 25, - TextColorSelector = new ColorSelector - { - Normal = Color.Black, - Selected = Color.Blue, - }, - }; - for (int i = 0; i < 2; i++) - { - Tab.TabItemData item = new Tab.TabItemData(); - item.Text = "Tab " + i; - myTab.AddItem(item); - } - try - { - myTab.SelectedItemIndex = 0; - Window.Instance.Add(myTab); - _checkValue = false; - myTab.ItemChangedEvent += OnItemChangedEvent; - myTab.SelectedItemIndex = 1; - await Task.Delay(200); - Assert.IsTrue(_checkValue, "Item change event should received"); - myTab.ItemChangedEvent -= OnItemChangedEvent; - } - catch(Exception e) - { - Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); - LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); - Assert.Fail("Caught Exception" + e.ToString()); - } - finally - { - Window.Instance.Remove(myTab); - } - } - - [Test] - [Category("P1")] - [Description("Test Dispose, try to dispose the Tab.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.Dispose M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Dispose_CHECK_RETURN_TYPE() - { - /* TEST CODE */ - try - { - var tab = new Tab(); - Assert.IsNotNull(tab, "Should be not null!"); - Assert.IsInstanceOf(tab, "Should be an instance of Tab type"); - - tab.Dispose(); - } - catch (Exception e) - { - 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 ApplyStyle. Check whether ApplyStyle works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.ApplyStyle M")] - [Property("SPEC_URL", " - ")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void ApplyStyle_NO_RETURN_VALUE() - { - try - { - var tab = new Tab(); - var style = new TabStyle(); - tab.ApplyStyle(style); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test GetViewStyle. Check whether CreateViewStyle works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.CreateViewStyle M")] - [Property("SPEC_URL", " - ")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void CreateViewStyle_CHECK_RETURN_VALUE() - { - try - { - var tab = new MyTab(); - ViewStyle style = tab.CreateMyViewStyle(); - Assert.IsNotNull(style, "Should be not null"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - public class MyTab : Tab - { - public bool flagOnUpdate = false; - public bool flagLayoutChild = false; - - public MyTab() : base() - { } - - public MyTab(string style) : base(style) - { } - - public ViewStyle CreateMyViewStyle() - { - return base.CreateViewStyle(); - } - - protected override void OnUpdate() - { - base.OnUpdate(); - flagOnUpdate = true; - } - - protected override void LayoutChild() - { - base.LayoutChild(); - flagLayoutChild = true; - } - } - - public class DefaultTabStyle : StyleBase - { - protected override ViewStyle GetViewStyle() - { - return new TabStyle(); - } - } - } - - internal class UtilityTabStyle : StyleBase - { - protected override ViewStyle GetViewStyle() - { - TabStyle attributes = new TabStyle - { - ItemPadding = new Extents(56, 56, 1, 0), - UnderLine = new ViewStyle - { - Size = new Size(1, 3), - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft, - PivotPoint = Tizen.NUI.PivotPoint.BottomLeft, - }, - Text = new TextLabelStyle - { - PointSize = new FloatSelector { All = 25 }, - TextColor = new ColorSelector - { - Normal = Color.Black, - Selected = Color.Green - }, - }, - }; - return attributes; - } - } -} \ No newline at end of file diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTabStyle.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTabStyle.cs deleted file mode 100755 index d0094fbd0..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTabStyle.cs +++ /dev/null @@ -1,179 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; -using Tizen.NUI.BaseComponents; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.TabStyle Tests")] - public class TabStyleTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test TabStyle empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.TabStyle.TabStyle C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void TabStyle_INIT() - { - /* TEST CODE */ - var style = new TabStyle(); - Assert.IsNotNull(style, "Should be not null!"); - Assert.IsInstanceOf(style, "Should be an instance of TabStyle!"); - } - - [Test] - [Category("P1")] - [Description("Test TabStyle constructor using style. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.TabStyle.TabStyle C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "TabStyle")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void TabStyle_INIT_WITH_STYLE() - { - /* TEST CODE */ - var style1 = new TabStyle(); - Assert.IsNotNull(style1, "Should be not null!"); - Assert.IsInstanceOf(style1, "Should be an instance of TabStyle!"); - - var style2 = new TabStyle(style1); - Assert.IsNotNull(style2, "Should be not null!"); - Assert.IsInstanceOf(style2, "Should be an instance of TabStyle!"); - } - - [Test] - [Category("P1")] - [Description("Test UnderLine. Check whether UnderLine is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TabStyle.UnderLine A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void UnderLine_SET_GET_VALUE() - { - /* TEST CODE */ - var style = new TabStyle(); - Assert.IsNotNull(style, "Should be not null"); - Assert.IsInstanceOf(style, "Should be equal!"); - style.UnderLine = new ViewStyle() {BackgroundImage = "test.png"}; - Assert.AreEqual("test.png", style.UnderLine.BackgroundImage.All, "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.TabStyle.Text A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Text_SET_GET_VALUE() - { - /* TEST CODE */ - var style = new TabStyle(); - Assert.IsNotNull(style, "Should be not null"); - Assert.IsInstanceOf(style, "Should be equal!"); - style.Text = new TextLabelStyle() {Text = "test"}; - Assert.AreEqual("test", style.Text.Text.All, "Should be equals to the set value"); - } - - [Test] - [Category("P1")] - [Description("Test UseTextNaturalSize. Check whether UseTextNaturalSize is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TabStyle.UseTextNaturalSize A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void UseTextNaturalSize_SET_GET_VALUE() - { - /* TEST CODE */ - var style = new TabStyle(); - Assert.IsNotNull(style, "Should be not null"); - Assert.IsInstanceOf(style, "Should be equal!"); - style.UseTextNaturalSize = true; - Assert.AreEqual(true, style.UseTextNaturalSize, "Should be equals to the set value"); - style.UseTextNaturalSize = false; - Assert.AreEqual(false, style.UseTextNaturalSize, "Should be equals to the set value"); - } - - [Test] - [Category("P1")] - [Description("Test ItemSpace. Check whether ItemSpace is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TabStyle.ItemSpace A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void ItemSpace_SET_GET_VALUE() - { - /* TEST CODE */ - var style = new TabStyle(); - Assert.IsNotNull(style, "Should be not null"); - Assert.IsInstanceOf(style, "Should be equal!"); - style.ItemSpace = 20; - Assert.AreEqual(20, style.ItemSpace, "Should be equals to the set value"); - style.ItemSpace = 30; - Assert.AreEqual(30, style.ItemSpace, "Should be equals to the set value"); - } - - [Test] - [Category("P1")] - [Description("Test ItemPadding. Check whether ItemPadding is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TabStyle.ItemPadding A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void ItemPadding_SET_GET_VALUE() - { - /* TEST CODE */ - var style = new TabStyle(); - Assert.IsNotNull(style, "Should be not null"); - Assert.IsInstanceOf(style, "Should be equal!"); - style.ItemPadding = new Extents(1,2,3,4); - Assert.AreEqual(1, style.ItemPadding.Start, "Should be equals to the set value"); - Assert.AreEqual(2, style.ItemPadding.End, "Should be equals to the set value"); - Assert.AreEqual(3, style.ItemPadding.Top, "Should be equals to the set value"); - Assert.AreEqual(4, style.ItemPadding.Bottom, "Should be equals to the set value"); - } - - [Test] - [Category("P1")] - [Description("Test CopyFrom. Check whether CopyFrom works or not.")] - [Property("SPEC", "Tizen.NUI.Components.TabStyle.CopyFrom M")] - [Property("SPEC_URL", " - ")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void CopyFrom_NO_RETURN_VALUE() - { - try - { - var style1 = new TabStyle(); - var style2 = new TabStyle(); - style2.CopyFrom(style1); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSToast.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSToast.cs deleted file mode 100644 index 5240de9c9..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSToast.cs +++ /dev/null @@ -1,380 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI.Components.Test; -using Tizen.NUI.BaseComponents; -using System.Threading.Tasks; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.Toast Tests")] - public class ToastTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test Construct. Check whether Toast construct.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.Toast C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - [Property("COVPARAM", "")] - public void Toast_INIT() - { - var toast = new Toast(); - Assert.IsNotNull(toast, "Should be not null!"); - Assert.IsInstanceOf(toast, "Should return Toast instance."); - } - - [Test] - [Category("P1")] - [Description("Test Toast constructor using string. Check whether Toast is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.Toast C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Toast_INIT_WITH_STRING() - { - /* TEST CODE */ - StyleManager.Instance.Theme = "default"; - StyleManager.Instance.RegisterStyle("defaultToast", "default", typeof(DefaultToastStyle)); - var toast1 = new Toast("defaultToast"); - Assert.IsNotNull(toast1, "Should be not null!"); - Assert.IsInstanceOf(toast1, "Should be an instance of Toast!"); - } - - [Test] - [Category("P2")] - [Description("Check exception when constructing a Toast with nonexistent style.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.Toast C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTX")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Toast_INIT_WITH_STRING_Exception() - { - /* TEST CODE */ - try - { - var toast1 = new Toast("defaultToastX"); - Assert.Fail("Should throw the Exception: There is no style of defaultToastX !"); - } - catch(InvalidOperationException e) - { - Assert.Pass("InvalidOperationException: passed!"); - } - } - - [Test] - [Category("P1")] - [Description("Test Toast constructor using style. Check whether Toast is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.Toast C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "ToastStyle")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Toast_INIT_WITH_STYLE() - { - /* TEST CODE */ - var style = new ToastStyle(); - Assert.IsNotNull(style, "Should be not null!"); - Assert.IsInstanceOf(style, "Should be an instance of ToastStyle!"); - - var toast = new Toast(style); - Assert.IsNotNull(toast, "Should be not null!"); - Assert.IsInstanceOf(toast, "Should be an instance of Toast!"); - } - - [Test] - [Category("P1")] - [Description("Test Style. Check whether Style is readable.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.Style A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void Style_CHECK_GET_VALUE() - { - /* TEST CODE */ - var toast = new Toast(); - Assert.IsNotNull(toast, "Should be not null"); - Assert.IsInstanceOf(toast, "Should be an instance of Toast!"); - - var style = toast.Style; - Assert.IsNotNull(style, "Should be not null"); - Assert.IsInstanceOf(style, "Should be an instance of ToastStyle!"); - } - - [Test] - [Category("P1")] - [Description("Test TextArray. Check whether TextArray works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.TextArray A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void TextArray_SET_GET_VALUE() - { - /* TEST CODE */ - var toast = new Toast(); - Assert.IsNotNull(toast, "Should be not null!"); - Assert.IsInstanceOf(toast, "Should return Toast instance."); - - string[] textArraySet = new string[] { "aaa", "bbb", "ccc" }; - toast.TextArray = textArraySet; - string[] textArrayGet = toast.TextArray; - Assert.AreEqual(textArraySet[0], textArrayGet[0], "Retrieved TextArray should be equal to set value"); - Assert.AreEqual(textArraySet[1], textArrayGet[1], "Retrieved TextArray should be equal to set value"); - Assert.AreEqual(textArraySet[2], textArrayGet[2], "Retrieved TextArray should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test PointSize. Check whether PointSize works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.PointSize A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void PointSize_SET_GET_VALUE() - { - /* TEST CODE */ - var toast = new Toast(); - Assert.IsNotNull(toast, "Should be not null!"); - Assert.IsInstanceOf(toast, "Should be an instance of Toast type"); - toast.PointSize = 10; - Assert.AreEqual(10, toast.PointSize, "Retrieved PointSize should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test FontFamily. Check whether FontFamily works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.FontFamily A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void FontFamily_SET_GET_VALUE() - { - /* TEST CODE */ - var toast = new Toast(); - Assert.IsNotNull(toast, "Should be not null!"); - Assert.IsInstanceOf(toast, "Should be an instance of Toast type"); - toast.FontFamily = "Test"; - Assert.AreEqual("Test", toast.FontFamily, "Retrieved FontFamily should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TextColor. Check whether TextColor works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.TextColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void TextColor_SET_GET_VALUE() - { - /* TEST CODE */ - var toast = new Toast(); - Assert.IsNotNull(toast, "Should be not null!"); - Assert.IsInstanceOf(toast, "Should be an instance of Toast type"); - var textColor = new Color(1.0f, 0.0f, 0.0f, 1.0f); - Assert.IsNotNull(textColor, "Should be not null!"); - Assert.IsInstanceOf(textColor, "Should be an instance of Toast type"); - - toast.TextColor = textColor; - Assert.AreEqual(textColor.R, toast.TextColor.R, "Retrieved TextColor should be equal to set value"); - Assert.AreEqual(textColor.G, toast.TextColor.G, "Retrieved TextColor should be equal to set value"); - Assert.AreEqual(textColor.B, toast.TextColor.B, "Retrieved TextColor should be equal to set value"); - Assert.AreEqual(textColor.A, toast.TextColor.A, "Retrieved TextColor should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TextAlignment. Check whether TextAlignment works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.TextAlignment A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void TextAlignment_SET_GET_VALUE() - { - /* TEST CODE */ - var toast = new Toast(); - Assert.IsNotNull(toast, "Should be not null!"); - Assert.IsInstanceOf(toast, "Should be an instance of Toast type"); - toast.TextAlignment = HorizontalAlignment.Begin; - Assert.AreEqual(HorizontalAlignment.Begin, toast.TextAlignment, "Retrieved TextAlignment should be equal to set value"); - toast.TextAlignment = HorizontalAlignment.Center; - Assert.AreEqual(HorizontalAlignment.Center, toast.TextAlignment, "Retrieved TextAlignment should be equal to set value"); - toast.TextAlignment = HorizontalAlignment.End; - Assert.AreEqual(HorizontalAlignment.End, toast.TextAlignment, "Retrieved TextAlignment should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TextPadding. Check whether TextPadding works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.TextPadding A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void TextPadding_SET_GET_VALUE() - { - /* TEST CODE */ - var toast = new Toast(); - Assert.IsNotNull(toast, "Should be not null!"); - Assert.IsInstanceOf(toast, "Should be an instance of Toast type"); - toast.TextPadding = new Extents(0, 0, 30, 30); - Assert.AreEqual(0, toast.TextPadding.Start, "Retrieved TextPadding.Start should be equal to set value"); - Assert.AreEqual(0, toast.TextPadding.End, "Retrieved TextPadding.End should be equal to set value"); - Assert.AreEqual(30, toast.TextPadding.Top, "Retrieved TextPadding.Top should be equal to set value"); - Assert.AreEqual(30, toast.TextPadding.Bottom, "Retrieved TextPadding.Bottom should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TextLineHeight. Check whether TextLineHeight works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.TextLineHeight A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void TextLineHeight_SET_GET_VALUE() - { - /* TEST CODE */ - var toast = new Toast(); - Assert.IsNotNull(toast, "Should be not null!"); - Assert.IsInstanceOf(toast, "Should be an instance of Toast type"); - toast.TextLineHeight = 50; - Assert.AreEqual(50, toast.TextLineHeight, "Retrieved TextLineHeight should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TextLineSpace. Check whether TextLineSpace works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.TextLineSpace A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void TextLineSpace_SET_GET_VALUE() - { - /* TEST CODE */ - var toast = new Toast(); - Assert.IsNotNull(toast, "Should be not null!"); - Assert.IsInstanceOf(toast, "Should be an instance of Toast type"); - toast.TextLineSpace = 30; - Assert.AreEqual(30, toast.TextLineSpace, "Retrieved TextLineSpace should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test Duration. Check whether Duration works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.Duration A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Duration_SET_GET_VALUE() - { - /* TEST CODE */ - var toast = new Toast(); - Assert.IsNotNull(toast, "Should be not null!"); - Assert.IsInstanceOf(toast, "Should be an instance of Toast type"); - toast.Duration = 30; - Assert.AreEqual(30, toast.Duration, "Retrieved Duration should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test Dispose, try to dispose the Toast.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.Dispose M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Dispose_CHECK_RETURN_TYPE() - { - /* TEST CODE */ - try - { - var toast = new Toast(); - Assert.IsNotNull(toast, "Should be not null!"); - Assert.IsInstanceOf(toast, "Should be an instance of Toast type"); - - toast.Dispose(); - } - catch (Exception e) - { - 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 ApplyStyle. Check whether ApplyStyle works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.ApplyStyle M")] - [Property("SPEC_URL", " - ")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void ApplyStyle_NO_RETURN_VALUE() - { - try - { - var button = new Toast(); - var style = new ToastStyle(); - button.ApplyStyle(style); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test GetViewStyle. Check whether CreateViewStyle works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.CreateViewStyle M")] - [Property("SPEC_URL", " - ")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void CreateViewStyle_CHECK_RETURN_VALUE() - { - try - { - var button = new MyToast(); - ViewStyle style = button.CreateMyViewStyle(); - Assert.IsNotNull(style, "Should be not null"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - public class MyToast : Toast - { - public MyToast() : base() { } - - public ViewStyle CreateMyViewStyle() - { - return base.CreateViewStyle(); - } - } - - public class DefaultToastStyle : StyleBase - { - protected override ViewStyle GetViewStyle() - { - return new ToastStyle(); - } - } - } -} \ No newline at end of file diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSToastStyle.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSToastStyle.cs deleted file mode 100755 index c0b09c0ed..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSToastStyle.cs +++ /dev/null @@ -1,123 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; -using Tizen.NUI.BaseComponents; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.ToastStyle Tests")] - public class ToastStyleTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test ToastStyle empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.ToastStyle.ToastStyle C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void ToastStyle_INIT() - { - /* TEST CODE */ - var style = new ToastStyle(); - Assert.IsNotNull(style, "Should be not null!"); - Assert.IsInstanceOf(style, "Should be an instance of ToastStyle!"); - } - - [Test] - [Category("P1")] - [Description("Test ToastStyle constructor using style. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.ToastStyle.ToastStyle C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "ToastStyle")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void ToastStyle_INIT_WITH_STYLE() - { - /* TEST CODE */ - var style1 = new ToastStyle(); - Assert.IsNotNull(style1, "Should be not null!"); - Assert.IsInstanceOf(style1, "Should be an instance of ToastStyle!"); - - var style2 = new ToastStyle(style1); - Assert.IsNotNull(style2, "Should be not null!"); - Assert.IsInstanceOf(style2, "Should be an instance of ToastStyle!"); - } - - [Test] - [Category("P1")] - [Description("Test Text. Check whether Text is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.ToastStyle.Text A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Text_SET_GET_VALUE() - { - /* TEST CODE */ - var style = new ToastStyle(); - Assert.IsNotNull(style, "Should be not null"); - Assert.IsInstanceOf(style, "Should be an instance of ToastStyle!"); - style.Text = new TextLabelStyle() {Text = "test"}; - Assert.AreEqual("test", style.Text.Text.All, "Should be equals to the set value"); - } - - [Test] - [Category("P1")] - [Description("Test Duration. Check whether Duration is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.ToastStyle.Duration A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Duration_SET_GET_VALUE() - { - /* TEST CODE */ - var style = new ToastStyle(); - Assert.IsNotNull(style, "Should be not null"); - Assert.IsInstanceOf(style, "Should be an instance of ToastStyle!"); - style.Duration = 20; - Assert.AreEqual(20, style.Duration, "Should be equals to the set value"); - style.Duration = 30; - Assert.AreEqual(30, style.Duration, "Should be equals to the set value"); - } - - [Test] - [Category("P1")] - [Description("Test CopyFrom. Check whether CopyFrom works or not.")] - [Property("SPEC", "Tizen.NUI.Components.ToastStyle.CopyFrom M")] - [Property("SPEC_URL", " - ")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void CopyFrom_NO_RETURN_VALUE() - { - try - { - var style1 = new ToastStyle(); - var style2 = new ToastStyle(); - style2.CopyFrom(style1); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - } -}