From: junqing.ma Date: Wed, 25 Sep 2019 02:11:40 +0000 (+0800) Subject: [NUI.Components][ACR-248][Update auto and manual TCT base on public API] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=368b360a077c74f57cc22b5a645bf89dd8c4aa4c;p=test%2Ftct%2Fcsharp%2Fapi.git [NUI.Components][ACR-248][Update auto and manual TCT base on public API] Change-Id: I6e0e3e372cbb2532119140151858a6e2a686a182 --- diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSButton.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSButton.cs index 5eb7cbc0e..4ef7e1e54 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSButton.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSButton.cs @@ -79,7 +79,9 @@ namespace Tizen.NUI.Components.Tests private void CreateMyButton(string buttonText) { - _button = new MyButton(); + _button = new Button(); + Assert.IsNotNull(_button, "Should be not null"); + Assert.IsInstanceOf(_button, "Should be equal!"); _button.Text = buttonText; _button.PointSize = _pointSize; _button.BackgroundColor = Color.Cyan; @@ -103,60 +105,6 @@ namespace Tizen.NUI.Components.Tests ManualTest.Confirm(); } - [Test] - [Category("P1")] - [Description("Test OnTapGestureDetected. Check whether the method will be called when user tap the button")] - [Property("SPEC", "Tizen.NUI.Components.Button.OnTapGestureDetected M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [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 button.")] - [Step(3, "TC will pass after touch or click.")] - [Postcondition(1, "NA")] - public async Task OnTapGestureDetected_CHECK_VALUE() - { - CreateMyButton("Click me!"); - await ManualTest.WaitForConfirm(); - if (ManualTest.IsWearable()) - { - _wearTestPage.ClearTestCase(_button); - } - else - { - _testPage.ClearTestCase(_button); - } - - } - - [Test] - [Category("P1")] - [Description("Test OnTouch. Check whether the method will be called when user touch the button")] - [Property("SPEC", "Tizen.NUI.Components.Button.OnTouch M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [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 button.")] - [Step(3, "TC will pass after touch or click.")] - [Postcondition(1, "NA")] - public async Task OnTouch_CHECK_VALUE() - { - CreateMyButton("Click me!"); - await ManualTest.WaitForConfirm(); - if (ManualTest.IsWearable()) - { - _wearTestPage.ClearTestCase(_button); - } - else - { - _testPage.ClearTestCase(_button); - } - - } - [Test] [Category("P1")] [Description("Test: Click. Check whether the event will be triggered when user click the button")] @@ -184,22 +132,6 @@ namespace Tizen.NUI.Components.Tests _testPage.ClearTestCase(_button); } } - - public class MyButton : Components.Button - { - protected override void OnTapGestureDetected(object source, TapGestureDetector.DetectedEventArgs e) - { - base.OnTapGestureDetected(source, e); - ManualTest.Confirm(); - } - - public override bool OnTouch(Touch touch) - { - ManualTest.Confirm(); - return base.OnTouch(touch); - } - - } } } diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSControl.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSControl.cs deleted file mode 100755 index 3ea3f95bc..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSControl.cs +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2017 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.Components; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.Control test")] - public class ControlTests - { - private ManualTestComponents _testPage; - private WearableManualTestNUI _wearTestPage; - private Components.Button _button; - private float _pointSize = 5.0f; - private TextLabel _label; - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST"); - if (Window.Instance.Size.Width > 1000) - { - _pointSize = 20.0f; - } - - if (ManualTest.IsWearable()) - { - _pointSize = 2.0f; - _label = ManualTest.CreateLabel("This case is unsuitable for wearable, please press PASS button to continue!"); - _wearTestPage = WearableManualTestNUI.GetInstance(); - } - else - { - _testPage = ManualTestComponents.GetInstance(); - } - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST"); - } - - private void CreateView(string information) - { - _button = new Components.Button(); - _button.BackgroundImageURL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "c_basic_button_white_bg_normal_9patch.png"; - _button.BackgroundImageBorder = new Rectangle(4, 4, 5, 5); - _button.Size2D = new Size2D(300, 80); - _button.Text = information; - - // Invoke ExecuteTC() method to add UI to test area. - _testPage.ExecuteTC(_button); - } - - public bool OnClickEvent(object sender, EventArgs e) - { - Tizen.Log.Fatal("NUI.CommonNUI", "TUnit OnTapGestureDetected!!!!!!!!!!!!!!!!!!!!!"); - ManualTest.Confirm(); - return false; - } - - [Test] - [Category("P1")] - [Description("Test: OnTapGestureDetected. Try to click the button to call this function.")] - [Property("SPEC", "Tizen.NUI.Components.Control.OnTapGestureDetected M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - [Precondition(1, "If test on TV, prepare mouse and connect to TV.")] - [Step(1, "If test on TV, connect the mouse to the TV")] - [Step(2, "Click run button to run TC")] - [Step(3, "Touch the Button. If on the TV, click left mouse on the Button.")] - [Step(4, "TC will pass after touch or click.")] - [Postcondition(1, "NA")] - public async Task OnTapGestureDetected_TEST() - { - if (ManualTest.IsWearable()) - { - _wearTestPage.ExecuteTC(_label); - await ManualTest.WaitForConfirm(); - _wearTestPage.ClearTestCase(_label); - } - else - { - CreateView("Touch or click me"); - _button.TouchEvent += OnClickEvent; - // Waits for user confirmation. - await ManualTest.WaitForConfirm(); - _button.TouchEvent -= OnClickEvent; - _testPage.ClearTestCase(_button); - } - } - - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSDropDown.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSDropDown.cs deleted file mode 100755 index a54517948..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSDropDown.cs +++ /dev/null @@ -1,155 +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.DropDown test")] - public class DropDownTests - { - private ManualTestComponents _testPage; - private WearableManualTestNUI _wearTestPage; - private DropDown _dropDown; - private float _pointSize = 5.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 (Window.Instance.Size.Width > 1000) - { - _pointSize = 20.0f; - } - - if (ManualTest.IsWearable()) - { - _pointSize = 4.0f; - _wearTestPage = WearableManualTestNUI.GetInstance(); - } - else - { - _testPage = ManualTestComponents.GetInstance(); - } - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST"); - } - - private void CreateDropDown() - { - _dropDown = new DropDown(); - _dropDown.Size2D = new Size2D(900, 108); - _dropDown.HeaderText = "TitleArea"; - _dropDown.HeaderTextColor = new Color(0, 0, 0, 1); - _dropDown.HeaderTextPointSize = _pointSize; - _dropDown.HeaderTextFontFamily = "SamsungOneUI 500C"; - _dropDown.ButtonText = "DropDown Text"; - _dropDown.ButtonTextColor = new Color(0, 0, 0, 1); - _dropDown.ButtonTextPointSize = _pointSize; - _dropDown.ButtonTextFontFamily = "SamsungOneUI 500"; - _dropDown.ButtonIconImageURL = _resourcePath + "/images/list_ic_dropdown.png"; - _dropDown.ButtonIconSize2D = new Size2D(18, 18); - _dropDown.LeftSpace = 56; - _dropDown.SpaceBetweenButtonTextAndIcon = 8; - _dropDown.ListBackgroundImageURL = _resourcePath + "/images/dropdown_bg.png"; - _dropDown.ListLeftMargin = 20; - _dropDown.ListTopMargin = 20; - _dropDown.BackgroundColor = new Color(1, 1, 1, 1); - _dropDown.ListSize2D = new Size2D(360, 500); - _dropDown.ListPadding = new Extents(4, 4, 4, 4); - - for (int i = 0; i < 8; i++) - { - DropDown.DropDownItemData item = new DropDown.DropDownItemData(); - item.Size2D = new Size2D(360, 96); - item.BackgroundColorSelector = new ColorSelector - { - Pressed = new Color(0, 0, 0, 0.4f), - Other = new Color(1, 1, 1, 0), - }; - item.Text = "Normal list " + i; - item.PointSize = 18; - item.FontFamily = "SamsungOne 500"; - item.TextPosition2D = new Position2D(28, 0); - item.CheckImageSize2D = new Size2D(40, 40); - item.CheckImageResourceUrl = _resourcePath + "images/dropdown_checkbox_on.png"; - item.CheckImageRightSpace = 16; - _dropDown.AddItem(item); - } - - _dropDown.SelectedItemIndex = 0; - - if (ManualTest.IsWearable()) - { - _dropDown.Size2D = new Size2D(200, 50); - _wearTestPage.ExecuteTC(_dropDown); - } - else - { - _testPage.ExecuteTC(_dropDown); - } - } - - public void OnItemClicked(object sender, EventArgs e) - { - Tizen.Log.Fatal("Components", "Item OnClicked!!!!!!!!!!!!!!!!!!!!!"); - ManualTest.Confirm(); - } - - [Test] - [Category("P1")] - [Description("Test: ItemClickEvent. Check whether the ItemClickEvent will be triggered or not when user click the item.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.ItemClickEvent 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 dropdown.")] - [Step(3, "Select dropdown item.")] - [Step(4, "TC will pass after touch or click.")] - [Postcondition(1, "NA")] - public async Task ItemClickEvent_CB() - { - CreateDropDown(); - _dropDown.ItemClickEvent += OnItemClicked; - await ManualTest.WaitForConfirm(); - _dropDown.ItemClickEvent -= OnItemClicked; - if (ManualTest.IsWearable()) - { - _wearTestPage.ClearTestCase(_dropDown); - } - else - { - _testPage.ClearTestCase(_dropDown); - } - } - - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSFlexibleView.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSFlexibleView.cs deleted file mode 100755 index 1932eab75..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSFlexibleView.cs +++ /dev/null @@ -1,307 +0,0 @@ -/* - * Copyright (c) 2017 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.Components; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; -using System.Collections.Generic; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.FlexibleView test")] - public class FlexibleViewTests - { - private ManualTestComponents _testPage; - private WearableManualTestNUI _wearTestPage; - private Components.FlexibleView _flexibleView; - private ListBridge _adapter; - private float _pointSize = 5.0f; - private TextLabel _label; - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST"); - if (Window.Instance.Size.Width > 1000) - { - _pointSize = 20.0f; - } - - if (ManualTest.IsWearable()) - { - _pointSize = 2.0f; - _label = ManualTest.CreateLabel("This case is unsuitable for wearable, please press PASS button to continue!"); - _wearTestPage = WearableManualTestNUI.GetInstance(); - } - else - { - _testPage = ManualTestComponents.GetInstance(); - } - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST"); - } - - private void CreateView() - { - _flexibleView = new FlexibleView(); - _flexibleView.Name = "RecyclerView"; - _flexibleView.Size2D = new Size2D(200, 100); - _flexibleView.Padding = new Extents(10, 10, 10, 10); - _flexibleView.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.4f); - - List dataList = new List(); - for (int i = 0; i < 20; ++i) - { - dataList.Add(new ListItemData(i)); - } - _adapter = new ListBridge(dataList); - _flexibleView.SetAdapter(_adapter); - - LinearLayoutManager layoutManager1 = new LinearLayoutManager(LinearLayoutManager.VERTICAL); - _flexibleView.SetLayoutManager(layoutManager1); - - // Invoke ExecuteTC() method to add UI to test area. - _testPage.ExecuteTC(_flexibleView); - } - - public void OnItemClickEvent(object sender, FlexibleView.ItemClickEventArgs e) - { - Tizen.Log.Fatal("NUI.CommonNUI", "TUnit ItemClickEvent!!!!!!!!!!!!!!!!!!!!!"); - ManualTest.Confirm(); - } - - public void OnItemTouchEvent(object sender, FlexibleView.ItemTouchEventArgs e) - { - Tizen.Log.Fatal("NUI.CommonNUI", "TUnit ItemTouchEvent!!!!!!!!!!!!!!!!!!!!!"); - ManualTest.Confirm(); - } - - [Test] - [Category("P1")] - [Description("Test: ItemClickEvent. Try to click the button to call this function.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.ItemClickEvent M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - [Precondition(1, "If test on TV, prepare mouse and connect to TV.")] - [Step(1, "If test on TV, connect the mouse to the TV")] - [Step(2, "Click run button to run TC")] - [Step(3, "Touch the Button. If on the TV, click left mouse on the Button.")] - [Step(4, "TC will pass after touch or click.")] - [Postcondition(1, "NA")] - public async Task ItemClickEvent_CB() - { - if (ManualTest.IsWearable()) - { - _wearTestPage.ExecuteTC(_label); - await ManualTest.WaitForConfirm(); - _wearTestPage.ClearTestCase(_label); - } - else - { - CreateView(); - _flexibleView.ItemClickEvent += OnItemClickEvent; - // Waits for user confirmation. - await ManualTest.WaitForConfirm(); - _flexibleView.ItemClickEvent -= OnItemClickEvent; - _testPage.ClearTestCase(_flexibleView); - } - } - - [Test] - [Category("P1")] - [Description("Test: ItemTouchEvent. Try to click the button to call this function.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.ItemTouchEvent M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - [Precondition(1, "If test on TV, prepare mouse and connect to TV.")] - [Step(1, "If test on TV, connect the mouse to the TV")] - [Step(2, "Click run button to run TC")] - [Step(3, "Touch the Button. If on the TV, click left mouse on the Button.")] - [Step(4, "TC will pass after touch or click.")] - [Postcondition(1, "NA")] - public async Task ItemTouchEvent_CB() - { - if (ManualTest.IsWearable()) - { - _wearTestPage.ExecuteTC(_label); - await ManualTest.WaitForConfirm(); - _wearTestPage.ClearTestCase(_label); - } - else - { - CreateView(); - _flexibleView.ItemTouchEvent += OnItemTouchEvent; - // Waits for user confirmation. - await ManualTest.WaitForConfirm(); - _flexibleView.ItemTouchEvent -= OnItemTouchEvent; - _testPage.ClearTestCase(_flexibleView); - } - } - } - - public class ListItemData - { - private string _str; - - public ListItemData(int i) - { - _str = "Text" + i.ToString(); - } - - public string TextString - { - get - { - return _str; - } - } - } - - public class ListItemView : View - { - private TextLabel _mText; - - public ListItemView() - { - _mText = new TextLabel(); - _mText.WidthResizePolicy = ResizePolicyType.FillToParent; - _mText.HeightResizePolicy = ResizePolicyType.FillToParent; - _mText.PointSize = 22; - _mText.HorizontalAlignment = HorizontalAlignment.Center; - _mText.VerticalAlignment = VerticalAlignment.Center; - Add(_mText); - } - - public string MainText - { - get - { - return _mText.Text; - } - set - { - _mText.Text = value; - } - } - } - - public class ListBridge : FlexibleView.Adapter - { - private List _mDatas; - - public ListBridge(List datas) - { - _mDatas = datas; - } - - public void InsertData(int position) - { - _mDatas.Insert(position, new ListItemData(1000 + position)); - NotifyItemInserted(position); - } - - public void RemoveData(int position) - { - _mDatas.RemoveAt(position); - NotifyItemRemoved(position); - } - - public override FlexibleView.ViewHolder OnCreateViewHolder(int viewType) - { - FlexibleView.ViewHolder viewHolder = new FlexibleView.ViewHolder(new ListItemView()); - //Console.WriteLine($"OnCreateViewHolder... viewType: {viewType} viewID: {viewHolder.ItemView.ID}"); - - return viewHolder; - } - - public override void OnBindViewHolder(FlexibleView.ViewHolder holder, int position) - { - //Console.WriteLine($"OnBindItemView... position: {position}"); - ListItemData listItemData = _mDatas[position]; - - ListItemView listItemView = holder.ItemView as ListItemView; - listItemView.Name = "Item" + position; - //Random rd = new Random(); - listItemView.SizeWidth = 100; - listItemView.SizeHeight = 40; - if (listItemView != null) - { - listItemView.MainText = String.Format("{0:D2}", position) + " : " + listItemData.TextString; - } - listItemView.Margin = new Extents(2, 2, 2, 2); - if (position % 2 == 0) - listItemView.BackgroundColor = Color.Cyan; - else - listItemView.BackgroundColor = Color.Yellow; - } - - public override void OnDestroyViewHolder(FlexibleView.ViewHolder holder) - { - //Console.WriteLine($"OnDestroyViewHolder... viewID: {holder.ItemView?.ID}"); - if (holder.ItemView != null) - { - holder.ItemView.Dispose(); - } - } - - public override int GetItemCount() - { - return _mDatas.Count; - } - - public override void OnFocusChange(FlexibleView flexibleView, int previousFocus, int currentFocus) - { - FlexibleView.ViewHolder previousFocusView = flexibleView.FindViewHolderForAdapterPosition(previousFocus); - if (previousFocusView != null) - { - //Console.WriteLine($"previousFocus {previousFocus.AdapterPosition}"); - if (previousFocusView.AdapterPosition % 2 == 0) - previousFocusView.ItemView.BackgroundColor = Color.Cyan; - else - previousFocusView.ItemView.BackgroundColor = Color.Yellow; - //previousFocus.SizeWidth = 150; - //previousFocus.SizeHeight = 60; - //NotifyItemChanged(previousFocus.AdapterPosition); - } - FlexibleView.ViewHolder currentFocusView = flexibleView.FindViewHolderForAdapterPosition(currentFocus); - if (currentFocusView != null) - { - //Console.WriteLine($"currentFocus {currentFocus.AdapterPosition}"); - currentFocusView.ItemView.BackgroundColor = Color.Magenta; - //currentFocus.SizeWidth = 200; - //currentFocus.SizeHeight = 100; - //NotifyItemChanged(currentFocus.AdapterPosition); - } - } - } - - -} - - - diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSInputField.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSInputField.cs deleted file mode 100755 index 7e4547ddb..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSInputField.cs +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Copyright (c) 2017 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.UIComponents; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.InputField test")] - public class InputFieldTests - { - private ManualTestComponents _testPage; - private WearableManualTestNUI _wearTestPage; - private Window _window; - private PushButton _button; - private float _pointSize = 5.0f; - private TextLabel _label; - private static MyInputField _inputField; - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST"); - _window = Window.Instance; - if (Window.Instance.Size.Width > 1000) - { - _pointSize = 20.0f; - } - if (ManualTest.IsWearable()) - { - _pointSize = 2.0f; - _label = ManualTest.CreateLabel("This case is unsuitable for wearable, please press PASS button to continue!"); - _wearTestPage = WearableManualTestNUI.GetInstance(); - } - else - { - _testPage = ManualTestComponents.GetInstance(); - } - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST"); - } - - private MyInputField CreateInputField() - { - InputFieldAttributes inputFieldAttributes = new InputFieldAttributes() - { - Space = 24, - BackgroundImageAttributes = new ImageAttributes - { - ResourceURL = new StringSelector { All = "1. Action bar/search_bg.png" }, - Border = new RectangleSelector { All = new Rectangle(45, 45, 0, 0) } - }, - - InputBoxAttributes = new TextFieldAttributes - { - TextColor = new ColorSelector - { - Normal = new Color(0, 0, 0, 1), - Pressed = new Color(0, 0, 0, 1), - Disabled = new Color(0, 0, 0, 0.4f) - }, - PlaceholderTextColor = new ColorSelector - { - All = new Color(0, 0, 0, 0.4f) - }, - HorizontalAlignment = HorizontalAlignment.Begin, - VerticalAlignment = VerticalAlignment.Center, - FontFamily = "SamsungOne 500", - PointSize = new FloatSelector - { - All = 38 - }, - CursorWidth = 2, - }, - }; - return new MyInputField(inputFieldAttributes); - } - - private PropertyMap CreateTextMap(float pointSize, string text) - { - PropertyMap map = new PropertyMap(); - map.Insert("visualType", new PropertyValue("TEXT")); - map.Insert("pointSize", new PropertyValue(pointSize)); - map.Insert("text", new PropertyValue(text)); - return map; - } - - private void CreateView(string information) - { - _button = new PushButton(); - _button.Label = CreateTextMap(_pointSize, information); - - _testPage.ExecuteTC(_button); - } - - [Test] - [Category("P1")] - [Description("Test OnTextFieldTextChanged. Check it has been triggered.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.OnTextFieldFocusGained M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - [Step(1, "If test on TV, connect the mouse to the TV")] - [Step(2, "Click run button to run TC")] - [Step(3, "Click input area on the input field.")] - [Step(4, "TC will pass when the input field focused")] - [Postcondition(1, "NA")] - public async Task OnTextFieldFocusGained_CB() - { - if (ManualTest.IsWearable()) - { - _wearTestPage.ExecuteTC(_label); - await ManualTest.WaitForConfirm(); - _wearTestPage.ClearTestCase(_label); - } - else - { - CreateView("Click InputField"); - _inputField = CreateInputField(); - _inputField.Size2D = new Size2D(1600, 95); - _inputField.Position2D = new Position2D(320, 300); - _inputField.BackgroundColor = Color.Green; - _window.Add(_inputField); - // Waits for user confirmation. - await ManualTest.WaitForConfirm(); - _testPage.ClearTestCase(_button); - } - } - - [Test] - [Category("P1")] - [Description("Test OnTextFieldFocusLost. Check it has been triggered.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.OnTextFieldFocusLost M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - [Step(1, "Connect the mouse to the TV (TM-1 don't need)")] - [Step(2, "Click run button to run TC")] - [Step(3, "Click input area of the input field.")] - [Step(4, "Click the outside area of the input field.")] - [Step(5, "When you stop click, TC will pass")] - [Postcondition(1, "NA")] - public async Task OnTextFieldFocusLost_CB() - { - if (ManualTest.IsWearable()) - { - _wearTestPage.ExecuteTC(_label); - await ManualTest.WaitForConfirm(); - _wearTestPage.ClearTestCase(_label); - } - else - { - CreateView("Click outside area of InputField"); - _inputField = CreateInputField(); - _inputField.Size2D = new Size2D(1600, 95); - _inputField.Position2D = new Position2D(320, 300); - _inputField.BackgroundColor = Color.Green; - _window.Add(_inputField); - // Waits for user confirmation. - await ManualTest.WaitForConfirm(); - _testPage.ClearTestCase(_button); - } - } - - [Test] - [Category("P1")] - [Description("Test OnTextFieldTextChanged. Check it has been triggered.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.OnTextFieldTextChanged M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [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, "Click input area on the input field.")] - [Step(4, "When you enter a letter, TC will pass")] - [Postcondition(1, "NA")] - public async Task OnTextFieldTextChanged_CB() - { - if (ManualTest.IsWearable()) - { - _wearTestPage.ExecuteTC(_label); - await ManualTest.WaitForConfirm(); - _wearTestPage.ClearTestCase(_label); - } - else - { - CreateView("Enter a letter"); - _inputField = CreateInputField(); - _inputField.Size2D = new Size2D(1600, 95); - _inputField.Position2D = new Position2D(320, 300); - _inputField.BackgroundColor = Color.Green; - _window.Add(_inputField); - // Waits for user confirmation. - await ManualTest.WaitForConfirm(); - _testPage.ClearTestCase(_button); - } - } - - [Test] - [Category("P1")] - [Description("Test OnTextFieldKeyEvent. Check it has been triggered.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.OnTextFieldKeyEvent M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [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, "Connect the keyboard to the TV (TM-1 don't need)")] - [Step(3, "Click run button to run TC")] - [Step(4, "Click input area on the input field.")] - [Step(5, "When you enter a letter, TC will pass")] - [Postcondition(1, "NA")] - public async Task OnTextFieldKeyEvent_CB() - { - if (ManualTest.IsWearable()) - { - _wearTestPage.ExecuteTC(_label); - await ManualTest.WaitForConfirm(); - _wearTestPage.ClearTestCase(_label); - } - else - { - CreateView("Enter a letter"); - _inputField = CreateInputField(); - _inputField.Size2D = new Size2D(1600, 95); - _inputField.Position2D = new Position2D(320, 300); - _inputField.BackgroundColor = Color.Green; - _window.Add(_inputField); - // Waits for user confirmation. - await ManualTest.WaitForConfirm(); - _testPage.ClearTestCase(_button); - } - } - - internal class MyInputField : InputField - { - public MyInputField() : base() - { } - - public MyInputField(InputFieldAttributes inputFieldAttributes) : base(inputFieldAttributes) - { } - - protected override void OnTextFieldFocusGained(object source, EventArgs e) - { - Tizen.Log.Fatal("NUI", "OnTextFieldFocusGained event !!!!!"); - ManualTest.Confirm(); - Window.Instance.Remove(_inputField); - } - - protected override void OnTextFieldFocusLost(object source, EventArgs e) - { - Tizen.Log.Fatal("NUI", "OnTextFieldFocusLost event !!!!!"); - ManualTest.Confirm(); - Window.Instance.Remove(_inputField); - } - - protected override void OnTextFieldTextChanged(object sender, Tizen.NUI.BaseComponents.TextField.TextChangedEventArgs e) - { - Tizen.Log.Fatal("NUI", "OnTextFieldTextChanged event !!!!!"); - ManualTest.Confirm(); - Window.Instance.Remove(_inputField); - } - - protected override bool OnTextFieldKeyEvent(object source, KeyEventArgs e) - { - Tizen.Log.Fatal("NUI", "OnTextFieldKeyEvent event !!!!!"); - ManualTest.Confirm(); - Window.Instance.Remove(_inputField); - return false; - } - } - } -} - - - 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 index 6259e0cad..b537d5866 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSPopup.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSPopup.cs @@ -65,6 +65,8 @@ namespace Tizen.NUI.Components.Tests private void CreatePopup() { _popup = new Popup(); + Assert.IsNotNull(_popup, "Should be not null"); + Assert.IsInstanceOf(_popup, "Should be equal!"); _popup.MinimumSize = new Size2D(232, 184); _popup.Size2D = new Size2D(232, 200); @@ -72,7 +74,7 @@ namespace Tizen.NUI.Components.Tests _popup.TitleTextColor = Color.Black; _popup.TitleHeight = 68; _popup.TitleTextHorizontalAlignment = HorizontalAlignment.Begin; - _popup.TitleTextPosition2D = new Position2D(64, 52); + _popup.TitleTextPosition = new Position(64, 52); _popup.TitleText = "Popup Title"; _popup.BackgroundImageURL = _resourcePath + "/images/popup_background.png"; @@ -119,8 +121,8 @@ namespace Tizen.NUI.Components.Tests [Test] [Category("P1")] - [Description("Test: PopupButtonClickedEvent. Check whether the PopupButtonClickedEvent will be triggered when user click the button on the popup")] - [Property("SPEC", "Tizen.NUI.Components.Popup.PopupButtonClickedEvent E")] + [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")] @@ -129,12 +131,12 @@ namespace Tizen.NUI.Components.Tests [Step(2, "Click(Touch) the 'Yes' button.")] [Step(3, "TC will pass after touch or click.")] [Postcondition(1, "NA")] - public async Task PopupButtonClickedEvent_CB() + public async Task PopupButtonClickEvent_CB() { CreatePopup(); - _popup.PopupButtonClickedEvent += OnPopupButtonClicked; + _popup.PopupButtonClickEvent += OnPopupButtonClicked; await ManualTest.WaitForConfirm(); - _popup.PopupButtonClickedEvent -= OnPopupButtonClicked; + _popup.PopupButtonClickEvent -= OnPopupButtonClicked; if (ManualTest.IsWearable()) { _wearTestPage.ClearTestCase(_popup); diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSRadioButton.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSRadioButton.cs deleted file mode 100755 index b6a5b0a80..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSRadioButton.cs +++ /dev/null @@ -1,139 +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.Components; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.RadioButton test")] - public class RadioButtonTests - { - private ManualTestComponents _testPage; - private WearableManualTestNUI _wearTestPage; - private Components.Button _button; - private float _pointSize = 5.0f; - private MyRadioButton _radioButton; - private string _resourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource; - private TextLabel _label; - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST"); - if (Window.Instance.Size.Width > 1000) - { - _pointSize = 20.0f; - } - - if (ManualTest.IsWearable()) - { - _pointSize = 2.0f; - _label = ManualTest.CreateLabel("This case is unsuitable for wearable, please press PASS button to continue!"); - _wearTestPage = WearableManualTestNUI.GetInstance(); - } - else - { - _testPage = ManualTestComponents.GetInstance(); - } - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST"); - } - - private void CreateRadioButton() - { - _radioButton = new MyRadioButton(); - _radioButton.Size2D = new Size2D(150, 48); - _radioButton.CheckImageSize2D = new Size2D(48, 48); - _radioButton.CheckImagePaddingLeft = 0; - _radioButton.CheckImagePaddingRight = 0; - _radioButton.CheckImagePaddingTop = 0; - _radioButton.CheckImagePaddingBottom = 0; - _radioButton.CheckBackgroundImageURLSelector = new StringSelector - { - Normal = _resourcePath + "/images/controller_btn_check_off.png", - Selected = _resourcePath + "/images/controller_btn_check_on.png", - }; - _radioButton.CheckImageURLSelector = new StringSelector - { - Normal = "", - Selected = _resourcePath + "/images/controller_btn_check.png", - }; - _radioButton.CheckShadowImageURLSelector = new StringSelector - { - Normal = "", - Selected = _resourcePath + "/images/controller_btn_check_shadow.png", - }; - - if (ManualTest.IsWearable()) - { - _radioButton.Size2D = new Size2D(150, 48); - _wearTestPage.ExecuteTC(_radioButton); - } - else - { - _testPage.ExecuteTC(_radioButton); - } - } - - [Test] - [Category("P1")] - [Description("Test: OnSelected. Try to click the button to call this function.")] - [Property("SPEC", "Tizen.NUI.Components.RadioButton.OnSelected M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - [Precondition(1, "If test on TV, prepare mouse and connect to TV.")] - [Step(1, "If test on TV, connect the mouse to the TV")] - [Step(2, "Click run button to run TC")] - [Step(3, "Touch the RadioButton. If on the TV, click left mouse on the RadioButton.")] - [Step(4, "TC will pass after touch or click.")] - [Postcondition(1, "NA")] - public async Task OnSelected_TEST() - { - CreateRadioButton(); - await ManualTest.WaitForConfirm(); - if (ManualTest.IsWearable()) - { - _wearTestPage.ClearTestCase(_radioButton); - } - else - { - _testPage.ClearTestCase(_radioButton); - } - } - } - - public class MyRadioButton: RadioButton - { - protected override void OnSelected() - { - ManualTest.Confirm(); - base.OnSelected(); - } - } -} \ No newline at end of file diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSRadioButtonGroup.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSRadioButtonGroup.cs deleted file mode 100755 index bbfe457bc..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSRadioButtonGroup.cs +++ /dev/null @@ -1,143 +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.Components; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.RadioButtonGroup test")] - public class RadioButtonGroupTests - { - private ManualTestComponents _testPage; - private WearableManualTestNUI _wearTestPage; - private Components.Button _button; - private float _pointSize = 5.0f; - private MyRadioButtonGroup _radioButtonGroup; - private RadioButton _radioButton; - private string _resourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource; - private TextLabel _label; - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST"); - if (Window.Instance.Size.Width > 1000) - { - _pointSize = 20.0f; - } - - if (ManualTest.IsWearable()) - { - _pointSize = 2.0f; - _label = ManualTest.CreateLabel("This case is unsuitable for wearable, please press PASS button to continue!"); - _wearTestPage = WearableManualTestNUI.GetInstance(); - } - else - { - _testPage = ManualTestComponents.GetInstance(); - } - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST"); - } - - private void CreateRadioButtonGroup() - { - _radioButtonGroup = new MyRadioButtonGroup(); - _radioButton = new MyRadioButton(); - _radioButton.Size2D = new Size2D(150, 48); - _radioButton.CheckImageSize2D = new Size2D(48, 48); - _radioButton.CheckImagePaddingLeft = 0; - _radioButton.CheckImagePaddingRight = 0; - _radioButton.CheckImagePaddingTop = 0; - _radioButton.CheckImagePaddingBottom = 0; - _radioButton.CheckBackgroundImageURLSelector = new StringSelector - { - Normal = _resourcePath + "/images/controller_btn_check_off.png", - Selected = _resourcePath + "/images/controller_btn_check_on.png", - }; - _radioButton.CheckImageURLSelector = new StringSelector - { - Normal = "", - Selected = _resourcePath + "/images/controller_btn_check.png", - }; - _radioButton.CheckShadowImageURLSelector = new StringSelector - { - Normal = "", - Selected = _resourcePath + "/images/controller_btn_check_shadow.png", - }; - - _radioButtonGroup.Add(_radioButton); - - if (ManualTest.IsWearable()) - { - _radioButton.Size2D = new Size2D(150, 48); - _wearTestPage.ExecuteTC(_radioButton); - } - else - { - _testPage.ExecuteTC(_radioButton); - } - } - - [Test] - [Category("P1")] - [Description("Test: SelectionHandler. Try to click the button to call this function.")] - [Property("SPEC", "Tizen.NUI.Components.RadioButtonGroup.SelectionHandler M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - [Precondition(1, "If test on TV, prepare mouse and connect to TV.")] - [Step(1, "If test on TV, connect the mouse to the TV")] - [Step(2, "Click run button to run TC")] - [Step(3, "Touch the RadioButton. If on the TV, click left mouse on the RadioButton.")] - [Step(4, "TC will pass after touch or click.")] - [Postcondition(1, "NA")] - public async Task SelectionHandler_TEST() - { - CreateRadioButtonGroup(); - await ManualTest.WaitForConfirm(); - if (ManualTest.IsWearable()) - { - _wearTestPage.ClearTestCase(_radioButton); - } - else - { - _testPage.ClearTestCase(_radioButton); - } - } - } - - public class MyRadioButtonGroup : RadioButtonGroup - { - protected override void SelectionHandler(SelectButton selection) - { - ManualTest.Confirm(); - base.SelectionHandler(selection); - } - } -} \ No newline at end of file diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSelectButton.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSelectButton.cs deleted file mode 100755 index 41018e425..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSelectButton.cs +++ /dev/null @@ -1,204 +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.SelectButton test")] - public class SelectButtonTests - { - private ManualTestComponents _testPage; - private WearableManualTestNUI _wearTestPage; - private MySelectButton _selectButton; - private float _pointSize = 5.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 (Window.Instance.Size.Width > 1000) - { - _pointSize = 20.0f; - } - - if (ManualTest.IsWearable()) - { - _pointSize = 4.0f; - _wearTestPage = WearableManualTestNUI.GetInstance(); - } - else - { - _testPage = ManualTestComponents.GetInstance(); - } - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST"); - } - - private void CreateSelectButton() - { - _selectButton = new MySelectButton(); - _selectButton.Size2D = new Size2D(150, 48); - _selectButton.CheckImageSize2D = new Size2D(48, 48); - _selectButton.CheckImagePaddingLeft = 0; - _selectButton.CheckImagePaddingRight = 0; - _selectButton.CheckImagePaddingTop = 0; - _selectButton.CheckImagePaddingBottom = 0; - _selectButton.CheckBackgroundImageURLSelector = new StringSelector - { - Normal = _resourcePath + "/images/controller_btn_check_off.png", - Selected = _resourcePath + "/images/controller_btn_check_on.png", - }; - _selectButton.CheckImageURLSelector = new StringSelector - { - Normal = "", - Selected = _resourcePath + "/images/controller_btn_check.png", - }; - _selectButton.CheckShadowImageURLSelector = new StringSelector - { - Normal = "", - Selected = _resourcePath + "/images/controller_btn_check_shadow.png", - }; - - if (ManualTest.IsWearable()) - { - _selectButton.Size2D = new Size2D(150, 48); - _wearTestPage.ExecuteTC(_selectButton); - } - else - { - _testPage.ExecuteTC(_selectButton); - } - } - - private void OnSelectedEvent(object sender, SelectButton.SelectEventArgs e) - { - Tizen.Log.Fatal("Components", "SelectButton Selected!!!!!!!!!!!!!!!!!!!!!"); - ManualTest.Confirm(); - } - - [Test] - [Category("P1")] - [Description("Test: OnTouch. Check whether the OnTouch method will be called or not when the user touch the select button")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.OnTouch M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [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 select button.")] - [Step(3, "TC will pass after touch or click.")] - [Postcondition(1, "NA")] - public async Task OnTouch_CHECK_VALUE() - { - CreateSelectButton(); - await ManualTest.WaitForConfirm(); - if (ManualTest.IsWearable()) - { - _wearTestPage.ClearTestCase(_selectButton); - } - else - { - _testPage.ClearTestCase(_selectButton); - } - - } - - [Test] - [Category("P1")] - [Description("Test: OnSelected. Check whether the OnSelected method will be called or not when the user touch the select button")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.OnSelected M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [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 select button.")] - [Step(3, "TC will pass after touch or click.")] - [Postcondition(1, "NA")] - public async Task OnSelected_CHECK_VALUE() - { - CreateSelectButton(); - await ManualTest.WaitForConfirm(); - if (ManualTest.IsWearable()) - { - _wearTestPage.ClearTestCase(_selectButton); - } - else - { - _testPage.ClearTestCase(_selectButton); - } - - } - - [Test] - [Category("P1")] - [Description("Test: SelectedEvent. Check whether the SelectedEvent will be triggered or not when the user click the select button")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.SelectedEvent 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 select button.")] - [Step(3, "TC will pass after touch or click.")] - [Postcondition(1, "NA")] - public async Task SelectedEvent_CB() - { - CreateSelectButton(); - _selectButton.SelectedEvent += OnSelectedEvent; - await ManualTest.WaitForConfirm(); - _selectButton.SelectedEvent -= OnSelectedEvent; - if (ManualTest.IsWearable()) - { - _wearTestPage.ClearTestCase(_selectButton); - } - else - { - _testPage.ClearTestCase(_selectButton); - } - } - - public class MySelectButton : SelectButton - { - public override bool OnTouch(Touch touch) - { - ManualTest.Confirm(); - return base.OnTouch(touch); - } - - protected override void OnSelected() - { - ManualTest.Confirm(); - base.OnSelected(); - } - - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSelectGroup.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSelectGroup.cs deleted file mode 100755 index a64931673..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSelectGroup.cs +++ /dev/null @@ -1,134 +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.Components; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.SelectGroup test")] - public class SelectGroupTests - { - private ManualTestComponents _testPage; - private WearableManualTestNUI _wearTestPage; - private Components.Button _button; - private float _pointSize = 5.0f; - private MyRadioButtonGroup _radioButtonGroup; - private RadioButton _radioButton; - private string _resourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource; - private TextLabel _label; - - [SetUp] - public void Init() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST"); - if (Window.Instance.Size.Width > 1000) - { - _pointSize = 20.0f; - } - - if (ManualTest.IsWearable()) - { - _pointSize = 2.0f; - _label = ManualTest.CreateLabel("This case is unsuitable for wearable, please press PASS button to continue!"); - _wearTestPage = WearableManualTestNUI.GetInstance(); - } - else - { - _testPage = ManualTestComponents.GetInstance(); - } - } - - [TearDown] - public void Destroy() - { - LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST"); - } - - private void CreateRadioButtonGroup() - { - _radioButtonGroup = new MyRadioButtonGroup(); - _radioButton = new MyRadioButton(); - _radioButton.Size2D = new Size2D(150, 48); - _radioButton.CheckImageSize2D = new Size2D(48, 48); - _radioButton.CheckImagePaddingLeft = 0; - _radioButton.CheckImagePaddingRight = 0; - _radioButton.CheckImagePaddingTop = 0; - _radioButton.CheckImagePaddingBottom = 0; - _radioButton.CheckBackgroundImageURLSelector = new StringSelector - { - Normal = _resourcePath + "/images/controller_btn_check_off.png", - Selected = _resourcePath + "/images/controller_btn_check_on.png", - }; - _radioButton.CheckImageURLSelector = new StringSelector - { - Normal = "", - Selected = _resourcePath + "/images/controller_btn_check.png", - }; - _radioButton.CheckShadowImageURLSelector = new StringSelector - { - Normal = "", - Selected = _resourcePath + "/images/controller_btn_check_shadow.png", - }; - - _radioButtonGroup.Add(_radioButton); - - if (ManualTest.IsWearable()) - { - _radioButton.Size2D = new Size2D(150, 48); - _wearTestPage.ExecuteTC(_radioButton); - } - else - { - _testPage.ExecuteTC(_radioButton); - } - } - - [Test] - [Category("P1")] - [Description("Test: SelectionHandler. Try to click the button to call this function.")] - [Property("SPEC", "Tizen.NUI.Components.SelectGroup.SelectionHandler M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - [Precondition(1, "If test on TV, prepare mouse and connect to TV.")] - [Step(1, "If test on TV, connect the mouse to the TV")] - [Step(2, "Click run button to run TC")] - [Step(3, "Touch the RadioButton. If on the TV, click left mouse on the RadioButton.")] - [Step(4, "TC will pass after touch or click.")] - [Postcondition(1, "NA")] - public async Task SelectionHandler_TEST() - { - CreateRadioButtonGroup(); - await ManualTest.WaitForConfirm(); - if (ManualTest.IsWearable()) - { - _wearTestPage.ClearTestCase(_radioButton); - } - else - { - _testPage.ClearTestCase(_radioButton); - } - } - } -} \ No newline at end of file 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 82eeee290..678bd0ddb 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 @@ -77,7 +77,7 @@ namespace Tizen.NUI.Components.Tests Normal = "9. Controller/controller_btn_slide_handler_normal.png", Pressed = "9. Controller/controller_btn_slide_handler_press.png", }, - ThumbSize = new Size2D(60, 60), + ThumbSize = new Size(60, 60), ThumbImageBackgroundURLSelector = new StringSelector { Normal = "", diff --git a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSwitch.cs b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSwitch.cs index 82b728c94..625374c4d 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSwitch.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSwitch.cs @@ -31,7 +31,7 @@ namespace Tizen.NUI.Components.Tests { private ManualTestComponents _testPage; private WearableManualTestNUI _wearTestPage; - private MySwitch _switch; + private Switch _switch; private float _pointSize = 5.0f; private string _resourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource; @@ -63,9 +63,11 @@ namespace Tizen.NUI.Components.Tests private void CreateSwitch() { - _switch = new MySwitch(); + _switch = new Switch(); + Assert.IsNotNull(_switch, "Should be not null"); + Assert.IsInstanceOf(_switch, "Should be equal!"); _switch.Size2D = new Size2D(96, 60); - _switch.SwitchHandlerImageSize2D = new Size2D(60, 60); + _switch.SwitchHandlerImageSize = new Size(60, 60); _switch.SwitchBackgroundImageURLSelector = new StringSelector { Normal = _resourcePath + "/images/controller_switch_bg_off.png", @@ -93,33 +95,6 @@ namespace Tizen.NUI.Components.Tests ManualTest.Confirm(); } - [Test] - [Category("P1")] - [Description("Test: OnTouch. Check whether the OnTouch method will be called or not when the user touch the switch")] - [Property("SPEC", "Tizen.NUI.Components.Switch.OnTouch M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [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, "Use mouse to click the Switch")] - [Step(3, "TC will pass after touch or click.")] - [Postcondition(1, "NA")] - public async Task OnTouch_CHECK_VALUE() - { - CreateSwitch(); - await ManualTest.WaitForConfirm(); - if (ManualTest.IsWearable()) - { - _wearTestPage.ClearTestCase(_switch); - } - else - { - _testPage.ClearTestCase(_switch); - } - - } - [Test] [Category("P1")] [Description("Test: SelectedEvent. Check whether the SelectedEvent event will be triggered or not when the user click the switch")] @@ -147,14 +122,5 @@ namespace Tizen.NUI.Components.Tests _testPage.ClearTestCase(_switch); } } - - public class MySwitch : Switch - { - public override bool OnTouch(Touch touch) - { - ManualTest.Confirm(); - return base.OnTouch(touch); - } - } } } diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSAttributes.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSAttributes.cs deleted file mode 100755 index bdfb23757..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSAttributes.cs +++ /dev/null @@ -1,73 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Threading.Tasks; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.Attributes Tests")] - public class AttributesTests - { - private const string TAG = "NUI.Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("AttributesTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a Attributes object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Attributes.Attributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Attributes_INIT() - { - /* TEST CODE */ - var attributes = new ViewAttributes(); - Assert.IsNotNull(attributes, "Can't create success object Attributes"); - Assert.IsInstanceOf(attributes, "Should be an instance of Attributes type."); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check Whether Clone works or not")] - [Property("SPEC", "Tizen.NUI.Components.Attributes.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Clone_TEST() - { - /* TEST CODE */ - try - { - var viewAttributes = new ViewAttributes(); - viewAttributes.PaddingLeft = 10; - var attributes = viewAttributes.Clone() as ViewAttributes; - Assert.IsNotNull(attributes, "Can't create success object Attributes"); - Assert.IsInstanceOf(attributes, "Should be an instance of Attributes type."); - Assert.AreEqual(10, attributes.PaddingLeft, "Should be equal!"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.StateChangeEventArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.StateChangeEventArgs.cs deleted file mode 100755 index 31c8cb269..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.StateChangeEventArgs.cs +++ /dev/null @@ -1,80 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.Button.StateChangeEventArgs Tests")] - public class ButtonStateChangeEventArgsTests - { - private const string TAG = "Components"; - - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("ButtonStateChangeEventArgsTests"); - App.MainTitleChangeBackgroundColor(null); - - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test StateChangeEventArgs empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Button.StateChangeEventArgs.StateChangeEventArgs C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void StateChangeEventArgs_CHECK_VALUE() - { - /* TEST CODE */ - var stateChangeEventArgs = new Components.Button.StateChangeEventArgs(); - 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.StateChangeEventArgs.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.StateChangeEventArgs(); - stateChangeEventArgs.PreviousState = ControlStates.Normal; - Assert.AreEqual(ControlStates.Normal, stateChangeEventArgs.PreviousState, "Should be equal"); - } - - [Test] - [Category("P1")] - [Description("Test CurrentState. Check whether CurrentState is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.StateChangeEventArgs.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.StateChangeEventArgs(); - stateChangeEventArgs.CurrentState = ControlStates.Normal; - Assert.AreEqual(ControlStates.Normal, stateChangeEventArgs.CurrentState, "Should be equal"); - } - } -} 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 new file mode 100755 index 000000000..69067ccc2 --- /dev/null +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.StateChangedEventArgs.cs @@ -0,0 +1,135 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; +using System; +using Tizen.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.Components; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using Tizen.NUI.Components.Test; + +namespace Tizen.NUI.Components.Tests +{ + [TestFixture] + [Description("Tizen.NUI.Components.Button.StateChangedEventArgs Tests")] + public class ButtonStateChangedEventArgsTests + { + private const string TAG = "Components"; + + public void Init() + { + Tizen.Log.Info(TAG, "Init() is called!"); + App.MainTitleChangeText("ButtonStateChangedEventArgsTests"); + App.MainTitleChangeBackgroundColor(null); + + } + + [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.Max; + Assert.AreEqual(ControlStates.Max, 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.Max; + Assert.AreEqual(ControlStates.Max, 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 172be2dab..72950755e 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.cs @@ -59,65 +59,6 @@ namespace Tizen.NUI.Components.Tests [Test] [Category("P1")] - [Description("Test Button style constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Button.Button C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Button_Style_CHECK_VALUE() - { - /* TEST CODE */ - StyleManager.Instance.RegisterStyle("BasicButton", null, typeof(ButtonStyle)); - var button = new Components.Button("BasicButton"); - Assert.IsNotNull(button, "Should be not null"); - Assert.IsInstanceOf(button, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Button ButtonAttributes constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Button.Button C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "ButtonAttributes")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Button_ButtonAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var buttonAttributes = new ButtonAttributes - { - IsSelectable = true, - BackgroundImageAttributes = new ImageAttributes - { - ResourceURL = new StringSelector { All = _image_path }, - Border = new RectangleSelector { All = new Rectangle(5, 5, 5, 5) } - }, - - TextAttributes = new TextAttributes - { - PointSize = new FloatSelector { All = 20 }, - HorizontalAlignment = HorizontalAlignment.Center, - VerticalAlignment = VerticalAlignment.Center, - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent, - - TextColor = new ColorSelector - { - Normal = new Color(0, 0, 0, 1), - Pressed = new Color(0, 0, 0, 0.7f), - Selected = new Color(0.141f, 0.769f, 0.278f, 1), - Disabled = new Color(0, 0, 0, 0.4f), - }, - } - }; - var button = new Components.Button(buttonAttributes); - Assert.IsNotNull(button, "Should be not null"); - Assert.IsInstanceOf(button, "Should be equal!"); - } - - [Test] - [Category("P1")] [Description("Test IsSelectable. Check whether IsSelectable is readable and writable.")] [Property("SPEC", "Tizen.NUI.Components.Button.IsSelectable A")] [Property("SPEC_URL", "-")] @@ -127,111 +68,14 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var button = new Components.Button(); + Assert.IsNotNull(button, "Should be not null"); + Assert.IsInstanceOf(button, "Should be equal!"); button.IsSelectable = true; Assert.AreEqual(true, button.IsSelectable, "Should be equals to the set value"); button.IsSelectable = false; Assert.AreEqual(false, button.IsSelectable, "Should be equals to the set value"); } - [Test] - [Category("P1")] - [Description("Test BackgroundImageURL. Check whether BackgroundImageURL is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.BackgroundImageURL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void BackgroundImageURL_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); - button.BackgroundImageURL = _image_path; - Assert.AreEqual(_image_path, button.BackgroundImageURL, "Should be equals to the set value of BackgroundImageURL"); - } - - [Test] - [Category("P1")] - [Description("Test BackgroundImageBorder. Check whether BackgroundImageBorder is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.BackgroundImageBorder A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void BackgroundImageBorder_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); - button.BackgroundImageBorder = new Rectangle(0, 0, 10, 10); - Assert.AreEqual(0, button.BackgroundImageBorder.X, "Retrieved BackgroundImageBorder should be equal to set value"); - Assert.AreEqual(0, button.BackgroundImageBorder.Y, "Retrieved BackgroundImageBorder should be equal to set value"); - Assert.AreEqual(10, button.BackgroundImageBorder.Width, "Retrieved BackgroundImageBorder should be equal to set value"); - Assert.AreEqual(10, button.BackgroundImageBorder.Height, "Retrieved BackgroundImageBorder should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test ShadowImageURL. Check whether ShadowImageURL is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.ShadowImageURL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ShadowImageURL_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); - button.ShadowImageURL = _image_path; - Assert.AreEqual(_image_path, button.ShadowImageURL, "Should be equals to the set value of ShadowImageURL"); - } - - [Test] - [Category("P1")] - [Description("Test ShadowImageBorder. Check whether ShadowImageBorder is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.ShadowImageBorder A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ShadowImageBorder_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); - button.ShadowImageBorder = new Rectangle(0, 0, 10, 10); - Assert.AreEqual(0, button.ShadowImageBorder.X, "Retrieved ShadowImageBorder should be equal to set value"); - Assert.AreEqual(0, button.ShadowImageBorder.Y, "Retrieved ShadowImageBorder should be equal to set value"); - Assert.AreEqual(10, button.ShadowImageBorder.Width, "Retrieved ShadowImageBorder should be equal to set value"); - Assert.AreEqual(10, button.ShadowImageBorder.Height, "Retrieved ShadowImageBorder should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test OverlayImageURL. Check whether OverlayImageURL is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.OverlayImageURL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void OverlayImageURL_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); - button.OverlayImageURL = _image_path; - Assert.AreEqual(_image_path, button.OverlayImageURL, "Should be equals to the set value of OverlayImageURL"); - } - - [Test] - [Category("P1")] - [Description("Test OverlayImageBorder. Check whether OverlayImageBorder is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.OverlayImageBorder A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void OverlayImageBorder_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); - button.OverlayImageBorder = new Rectangle(0, 0, 10, 10); - Assert.AreEqual(0, button.OverlayImageBorder.X, "Retrieved OverlayImageBorder should be equal to set value"); - Assert.AreEqual(0, button.OverlayImageBorder.Y, "Retrieved OverlayImageBorder should be equal to set value"); - Assert.AreEqual(10, button.OverlayImageBorder.Width, "Retrieved OverlayImageBorder should be equal to set value"); - Assert.AreEqual(10, button.OverlayImageBorder.Height, "Retrieved OverlayImageBorder should be equal to set value"); - } - [Test] [Category("P1")] [Description("Test Text. Check whether Text is readable and writable.")] @@ -243,6 +87,8 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var button = new Components.Button(); + Assert.IsNotNull(button, "Should be not null"); + Assert.IsInstanceOf(button, "Should be equal!"); button.Text = "Test Text"; Assert.AreEqual("Test Text", button.Text, "Should be equals to the set value of Text"); } @@ -258,6 +104,8 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var button = new Components.Button(); + Assert.IsNotNull(button, "Should be not null"); + Assert.IsInstanceOf(button, "Should be equal!"); button.TranslatableText = "Test TranslatableText"; Assert.AreEqual("Test TranslatableText", button.TranslatableText, "Should be equals to the set value of TranslatableText"); } @@ -273,6 +121,8 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var button = new Components.Button(); + Assert.IsNotNull(button, "Should be not null"); + Assert.IsInstanceOf(button, "Should be equal!"); button.PointSize = 10.0f; Assert.AreEqual(10.0f, button.PointSize, "Should be equals to the set value of PointSize"); } @@ -288,6 +138,8 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var button = new Components.Button(); + Assert.IsNotNull(button, "Should be not null"); + Assert.IsInstanceOf(button, "Should be equal!"); button.FontFamily = "SamsungOne 500"; Assert.AreEqual("SamsungOne 500", button.FontFamily, "Should be equals to the set value of FontFamily"); } @@ -303,7 +155,11 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var button = new Components.Button(); + Assert.IsNotNull(button, "Should be not null"); + Assert.IsInstanceOf(button, "Should be equal!"); var color = new Color(1.0f, 0.0f, 0.0f, 1.0f); + Assert.IsNotNull(color, "Should be not null"); + Assert.IsInstanceOf(color, "Should be equal!"); button.TextColor = color; Assert.AreEqual(color.R, button.TextColor.R, "Should be equals to the color.R set"); @@ -324,6 +180,8 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var button = new Components.Button(); + Assert.IsNotNull(button, "Should be not null"); + Assert.IsInstanceOf(button, "Should be equal!"); button.TextAlignment = HorizontalAlignment.Begin; Assert.AreEqual(HorizontalAlignment.Begin, button.TextAlignment, "Should be equals to the set value of TextAlignment"); button.TextAlignment = HorizontalAlignment.Center; @@ -343,6 +201,8 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var button = new Components.Button(); + Assert.IsNotNull(button, "Should be not null"); + Assert.IsInstanceOf(button, "Should be equal!"); button.IconURL = _image_path; Assert.AreEqual(_image_path, button.IconURL, "Should be equals to the set value of IconURL"); } @@ -358,11 +218,15 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var button = new Components.Button(); + Assert.IsNotNull(button, "Should be not null"); + Assert.IsInstanceOf(button, "Should be equal!"); var stringSelector = new StringSelector { Normal = "Normal", Selected = "Selected", }; + Assert.IsNotNull(stringSelector, "Should be not null"); + Assert.IsInstanceOf(stringSelector, "Should be equal!"); button.TextSelector = stringSelector; Assert.AreEqual(stringSelector.Normal, button.TextSelector.Normal, "Should be equals to the set value of TextSelector"); @@ -380,11 +244,15 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var button = new Components.Button(); + Assert.IsNotNull(button, "Should be not null"); + Assert.IsInstanceOf(button, "Should be equal!"); var stringSelector = new StringSelector { Normal = "Normal", Selected = "Selected", }; + Assert.IsNotNull(stringSelector, "Should be not null"); + Assert.IsInstanceOf(stringSelector, "Should be equal!"); button.TranslatableTextSelector = stringSelector; Assert.AreEqual(stringSelector.Normal, button.TranslatableTextSelector.Normal, "Should be equals to the set value of TranslatableTextSelector"); @@ -402,11 +270,15 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var button = new Components.Button(); + Assert.IsNotNull(button, "Should be not null"); + Assert.IsInstanceOf(button, "Should be equal!"); var colorSelector = new ColorSelector { Normal = new Color(0.0f, 0.0f, 1.0f, 1.0f), Selected = new Color(0.0f, 1.0f, 0.0f, 1.0f), }; + Assert.IsNotNull(colorSelector, "Should be not null"); + Assert.IsInstanceOf(colorSelector, "Should be equal!"); button.TextColorSelector = colorSelector; Assert.AreEqual(colorSelector.Normal.R, button.TextColorSelector.Normal.R, "Should be equals to the set value of TextColorSelector Normal R"); @@ -431,11 +303,15 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var button = new Components.Button(); + Assert.IsNotNull(button, "Should be not null"); + Assert.IsInstanceOf(button, "Should be equal!"); var floatSelector = new FloatSelector { Normal = 10.0f, Selected = 12.0f, }; + Assert.IsNotNull(floatSelector, "Should be not null"); + Assert.IsInstanceOf(floatSelector, "Should be equal!"); button.PointSizeSelector = floatSelector; Assert.AreEqual(floatSelector.Normal, button.PointSizeSelector.Normal, "Should be equals to the set value of PointSizeSelector Normal"); @@ -453,166 +329,21 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var button = new Components.Button(); + Assert.IsNotNull(button, "Should be not null"); + Assert.IsInstanceOf(button, "Should be equal!"); var stringSelector = new StringSelector { Normal = _image_path, Selected = _image_path, }; + Assert.IsNotNull(stringSelector, "Should be not null"); + Assert.IsInstanceOf(stringSelector, "Should be equal!"); + button.IconURLSelector = stringSelector; Assert.AreEqual(stringSelector.Normal, button.IconURLSelector.Normal, "Should be equals to the set value of IconURLSelector Normal"); Assert.AreEqual(stringSelector.Selected, button.IconURLSelector.Selected, "Should be equals to the set value of IconURLSelector Selected"); } - [Test] - [Category("P1")] - [Description("Test BackgroundImageURLSelector. Check whether BackgroundImageURLSelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.BackgroundImageURLSelector A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void BackgroundImageURLSelector_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); - var stringSelector = new StringSelector - { - Normal = _image_path, - Selected = _image_path, - }; - button.BackgroundImageURLSelector = stringSelector; - Assert.AreEqual(stringSelector.Normal, button.BackgroundImageURLSelector.Normal, "Should be equals to the set value of BackgroundImageURLSelector Normal"); - Assert.AreEqual(stringSelector.Selected, button.BackgroundImageURLSelector.Selected, "Should be equals to the set value of BackgroundImageURLSelector Selected"); - } - - [Test] - [Category("P1")] - [Description("Test BackgroundImageBorderSelector. Check whether BackgroundImageBorderSelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.BackgroundImageBorderSelector A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void BackgroundImageBorderSelector_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); - var rectangleSelector = new RectangleSelector - { - Normal = new Rectangle(0, 0, 10, 10), - Selected = new Rectangle(0, 0, 11, 11), - }; - button.BackgroundImageBorderSelector = rectangleSelector; - - Assert.AreEqual(0, button.BackgroundImageBorderSelector.Normal.X, "Retrieved BackgroundImageBorderSelector Normal X should be equal to set value"); - Assert.AreEqual(0, button.BackgroundImageBorderSelector.Normal.Y, "Retrieved BackgroundImageBorderSelector Normal Y should be equal to set value"); - Assert.AreEqual(10, button.BackgroundImageBorderSelector.Normal.Width, "Retrieved BackgroundImageBorderSelector Normal Width should be equal to set value"); - Assert.AreEqual(10, button.BackgroundImageBorderSelector.Normal.Height, "Retrieved BackgroundImageBorderSelector Normal Height should be equal to set value"); - - Assert.AreEqual(0, button.BackgroundImageBorderSelector.Selected.X, "Retrieved BackgroundImageBorderSelector Selected X should be equal to set value"); - Assert.AreEqual(0, button.BackgroundImageBorderSelector.Selected.Y, "Retrieved BackgroundImageBorderSelector Selected Y should be equal to set value"); - Assert.AreEqual(11, button.BackgroundImageBorderSelector.Selected.Width, "Retrieved BackgroundImageBorderSelector Selected Width should be equal to set value"); - Assert.AreEqual(11, button.BackgroundImageBorderSelector.Selected.Height, "Retrieved BackgroundImageBorderSelector Selected Height should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test ShadowImageURLSelector. Check whether ShadowImageURLSelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.ShadowImageURLSelector A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ShadowImageURLSelector_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); - var stringSelector = new StringSelector - { - Normal = _image_path, - Selected = _image_path, - }; - button.ShadowImageURLSelector = stringSelector; - Assert.AreEqual(stringSelector.Normal, button.ShadowImageURLSelector.Normal, "Should be equals to the set value of ShadowImageURLSelector Normal"); - Assert.AreEqual(stringSelector.Selected, button.ShadowImageURLSelector.Selected, "Should be equals to the set value of ShadowImageURLSelector Selected"); - } - - [Test] - [Category("P1")] - [Description("Test ShadowImageBorderSelector. Check whether ShadowImageBorderSelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.ShadowImageBorderSelector A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ShadowImageBorderSelector_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); - var rectangleSelector = new RectangleSelector - { - Normal = new Rectangle(0, 0, 10, 10), - Selected = new Rectangle(0, 0, 11, 11), - }; - button.ShadowImageBorderSelector = rectangleSelector; - - Assert.AreEqual(0, button.ShadowImageBorderSelector.Normal.X, "Retrieved ShadowImageBorderSelector Normal X should be equal to set value"); - Assert.AreEqual(0, button.ShadowImageBorderSelector.Normal.Y, "Retrieved ShadowImageBorderSelector Normal Y should be equal to set value"); - Assert.AreEqual(10, button.ShadowImageBorderSelector.Normal.Width, "Retrieved ShadowImageBorderSelector Normal Width should be equal to set value"); - Assert.AreEqual(10, button.ShadowImageBorderSelector.Normal.Height, "Retrieved ShadowImageBorderSelector Normal Height should be equal to set value"); - - Assert.AreEqual(0, button.ShadowImageBorderSelector.Selected.X, "Retrieved ShadowImageBorderSelector Selected X should be equal to set value"); - Assert.AreEqual(0, button.ShadowImageBorderSelector.Selected.Y, "Retrieved ShadowImageBorderSelector Selected Y should be equal to set value"); - Assert.AreEqual(11, button.ShadowImageBorderSelector.Selected.Width, "Retrieved ShadowImageBorderSelector Selected Width should be equal to set value"); - Assert.AreEqual(11, button.ShadowImageBorderSelector.Selected.Height, "Retrieved ShadowImageBorderSelector Selected Height should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test OverlayImageURLSelector. Check whether OverlayImageURLSelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.OverlayImageURLSelector A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void OverlayImageURLSelector_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); - var stringSelector = new StringSelector - { - Normal = _image_path, - Selected = _image_path, - }; - button.OverlayImageURLSelector = stringSelector; - Assert.AreEqual(stringSelector.Normal, button.OverlayImageURLSelector.Normal, "Should be equals to the set value of OverlayImageURLSelector Normal"); - Assert.AreEqual(stringSelector.Selected, button.OverlayImageURLSelector.Selected, "Should be equals to the set value of OverlayImageURLSelector Selected"); - } - - [Test] - [Category("P1")] - [Description("Test OverlayImageBorderSelector. Check whether OverlayImageBorderSelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.OverlayImageBorderSelector A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void OverlayImageBorderSelector_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); - var rectangleSelector = new RectangleSelector - { - Normal = new Rectangle(0, 0, 10, 10), - Selected = new Rectangle(0, 0, 11, 11), - }; - button.OverlayImageBorderSelector = rectangleSelector; - - Assert.AreEqual(0, button.OverlayImageBorderSelector.Normal.X, "Retrieved OverlayImageBorderSelector Normal X should be equal to set value"); - Assert.AreEqual(0, button.OverlayImageBorderSelector.Normal.Y, "Retrieved OverlayImageBorderSelector Normal Y should be equal to set value"); - Assert.AreEqual(10, button.OverlayImageBorderSelector.Normal.Width, "Retrieved OverlayImageBorderSelector Normal Width should be equal to set value"); - Assert.AreEqual(10, button.OverlayImageBorderSelector.Normal.Height, "Retrieved OverlayImageBorderSelector Normal Height should be equal to set value"); - - Assert.AreEqual(0, button.OverlayImageBorderSelector.Selected.X, "Retrieved OverlayImageBorderSelector Selected X should be equal to set value"); - Assert.AreEqual(0, button.OverlayImageBorderSelector.Selected.Y, "Retrieved OverlayImageBorderSelector Selected Y should be equal to set value"); - Assert.AreEqual(11, button.OverlayImageBorderSelector.Selected.Width, "Retrieved OverlayImageBorderSelector Selected Width should be equal to set value"); - Assert.AreEqual(11, button.OverlayImageBorderSelector.Selected.Height, "Retrieved OverlayImageBorderSelector Selected Height should be equal to set value"); - } - [Test] [Category("P1")] [Description("Test IsSelected. Check whether IsSelected is readable and writable.")] @@ -624,6 +355,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var button = new Components.Button(); + Assert.IsNotNull(button, "Should be not null"); + Assert.IsInstanceOf(button, "Should be equal!"); + button.IsSelected = true; Assert.AreEqual(true, button.IsSelected, "Retrieved IsSelected should be equal to set value"); button.IsSelected = false; @@ -641,6 +375,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var button = new Components.Button(); + Assert.IsNotNull(button, "Should be not null"); + Assert.IsInstanceOf(button, "Should be equal!"); + button.IsEnabled = true; Assert.AreEqual(true, button.IsEnabled, "Retrieved IsEnabled should be equal to set value"); button.IsEnabled = false; @@ -649,143 +386,44 @@ namespace Tizen.NUI.Components.Tests [Test] [Category("P1")] - [Description("Test IconRelativeOrientation. Check whether IconRelativeOrientation is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.IconRelativeOrientation A")] + [Description("Test IconPadding. Check whether IconPadding is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Components.Button.IconPadding A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IconRelativeOrientation_SET_GET_VALUE() + public void IconPadding_SET_GET_VALUE() { /* TEST CODE */ var button = new Components.Button(); - button.IconRelativeOrientation = Components.Button.IconOrientation.Left; - Assert.AreEqual(Components.Button.IconOrientation.Left, button.IconRelativeOrientation, "Retrieved IconRelativeOrientation should be equal to set value"); - button.IconRelativeOrientation = Components.Button.IconOrientation.Right; - Assert.AreEqual(Components.Button.IconOrientation.Right, button.IconRelativeOrientation, "Retrieved IconRelativeOrientation should be equal to set value"); - button.IconRelativeOrientation = Components.Button.IconOrientation.Top; - Assert.AreEqual(Components.Button.IconOrientation.Top, button.IconRelativeOrientation, "Retrieved IconRelativeOrientation should be equal to set value"); - button.IconRelativeOrientation = Components.Button.IconOrientation.Bottom; - Assert.AreEqual(Components.Button.IconOrientation.Bottom, button.IconRelativeOrientation, "Retrieved IconRelativeOrientation should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test IconPaddingLeft. Check whether IconPaddingLeft is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.IconPaddingLeft A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IconPaddingLeft_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); - button.IconPaddingLeft = 10; - Assert.AreEqual(10, button.IconPaddingLeft, "Retrieved IconPaddingLeft should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test IconPaddingRight. Check whether IconPaddingRight is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.IconPaddingRight A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IconPaddingRight_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); - button.IconPaddingRight = 10; - Assert.AreEqual(10, button.IconPaddingRight, "Retrieved IconPaddingRight should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test IconPaddingTop. Check whether IconPaddingTop is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.IconPaddingTop A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IconPaddingTop_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); - button.IconPaddingTop = 10; - Assert.AreEqual(10, button.IconPaddingTop, "Retrieved IconPaddingTop should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test IconPaddingBottom. Check whether IconPaddingBottom is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.IconPaddingBottom A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IconPaddingBottom_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); - button.IconPaddingBottom = 10; - Assert.AreEqual(10, button.IconPaddingBottom, "Retrieved IconPaddingBottom should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TextPaddingLeft. Check whether TextPaddingLeft is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.TextPaddingLeft A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TextPaddingLeft_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); - button.TextPaddingLeft = 10; - Assert.AreEqual(10, button.TextPaddingLeft, "Retrieved TextPaddingLeft should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TextPaddingRight. Check whether TextPaddingRight is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.TextPaddingRight A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TextPaddingRight_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); - button.TextPaddingRight = 10; - Assert.AreEqual(10, button.TextPaddingRight, "Retrieved TextPaddingRight should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TextPaddingTop. Check whether TextPaddingTop is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.TextPaddingTop A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TextPaddingTop_SET_GET_VALUE() - { - /* TEST CODE */ - var button = new Components.Button(); - button.TextPaddingTop = 10; - Assert.AreEqual(10, button.TextPaddingTop, "Retrieved TextPaddingTop should be equal to set value"); + Assert.IsNotNull(button, "Should be not null"); + Assert.IsInstanceOf(button, "Should be equal!"); + + button.IconPadding = new Extents(0, 0, 10, 10); + Assert.AreEqual(0, button.IconPadding.Start, "Retrieved IconPadding.Start should be equal to set value"); + Assert.AreEqual(0, button.IconPadding.End, "Retrieved IconPadding.End should be equal to set value"); + Assert.AreEqual(10, button.IconPadding.Top, "Retrieved IconPadding.Top should be equal to set value"); + Assert.AreEqual(10, button.IconPadding.Bottom, "Retrieved IconPadding.Bottom should be equal to set value"); } [Test] [Category("P1")] - [Description("Test TextPaddingBottom. Check whether TextPaddingBottom is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Button.TextPaddingBottom A")] + [Description("Test TextPadding. Check whether TextPadding is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Components.Button.TextPadding A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TextPaddingBottom_SET_GET_VALUE() + public void TextPadding_SET_GET_VALUE() { /* TEST CODE */ var button = new Components.Button(); - button.TextPaddingBottom = 10; - Assert.AreEqual(10, button.TextPaddingBottom, "Retrieved TextPaddingBottom should be equal to set value"); + Assert.IsNotNull(button, "Should be not null"); + Assert.IsInstanceOf(button, "Should be equal!"); + + button.TextPadding = new Extents(0, 0, 10, 10); + Assert.AreEqual(0, button.TextPadding.Start, "Retrieved TextPadding.Start should be equal to set value"); + Assert.AreEqual(0, button.TextPadding.End, "Retrieved TextPadding.End should be equal to set value"); + Assert.AreEqual(10, button.TextPadding.Top, "Retrieved TextPadding.Top should be equal to set value"); + Assert.AreEqual(10, button.TextPadding.Bottom, "Retrieved TextPadding.Bottom should be equal to set value"); } [Test] @@ -801,6 +439,9 @@ namespace Tizen.NUI.Components.Tests try { var button = new Components.Button(); + Assert.IsNotNull(button, "Should be not null"); + Assert.IsInstanceOf(button, "Should be equal!"); + bool flag = true; flag = button.OnKey(new Key()); Assert.AreEqual(false, flag, "OnKey return check fail."); @@ -813,270 +454,6 @@ namespace Tizen.NUI.Components.Tests } } - public class ButtonStyle : StyleBase - { - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - public ButtonStyle() - { - - } - protected override Attributes GetAttributes() - { - ButtonAttributes attributes = new ButtonAttributes - { - IsSelectable = true, - BackgroundImageAttributes = new ImageAttributes - { - ResourceURL = new StringSelector - { - Normal = _image_path, - Selected = _image_path, - }, - Border = new RectangleSelector { All = new Rectangle(5, 5, 5, 5) } - }, - - ShadowImageAttributes = new ImageAttributes - { - ResourceURL = new StringSelector { All = _image_path }, - Border = new RectangleSelector { All = new Rectangle(5, 5, 5, 5) } - }, - - OverlayImageAttributes = new ImageAttributes - { - ResourceURL = new StringSelector { Pressed = _image_path, Other = "" }, - Border = new RectangleSelector { All = new Rectangle(5, 5, 5, 5) }, - }, - - IconAttributes = new ImageAttributes - { - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent, - } - }; - return attributes; - } - } - - public class MyButton : Components.Button - { - public override void OnFocusGained() - { - _focusGainedFlag = true; - base.OnFocusGained(); - } - - public override void OnFocusLost() - { - _focusLostFlag = true; - base.OnFocusLost(); - } - - protected override void OnUpdate() - { - _updateFlag = true; - base.OnUpdate(); - } - - protected override void MeasureText() - { - _measureTextFlag = true; - base.MeasureText(); - } - - protected override void LayoutChild() - { - _layoutChildFlag = true; - base.LayoutChild(); - } - - protected override void OnThemeChangedEvent(object sender, Components.StyleManager.ThemeChangeEventArgs e) - { - _themeFlag = true; - base.OnThemeChangedEvent(sender, e); - } - - protected override Attributes GetAttributes() - { - return base.GetAttributes(); - } - - public Attributes TestGetAttributes() - { - return GetAttributes(); - } - } - - [Test] - [Category("P1")] - [Description("Test OnFocusGained. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Button.OnFocusGained M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void OnFocusGained_CHECK_VALUE() - { - /* TEST CODE */ - _focusGainedFlag = false; - var myButton = new MyButton(); - myButton.Focusable = true; - Window.Instance.Add(myButton); - FocusManager.Instance.SetCurrentFocusView(myButton); - Assert.AreEqual(true, _focusGainedFlag, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test OnFocusLost. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Button.OnFocusLost M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void OnFocusLost_CHECK_VALUE() - { - /* TEST CODE */ - _focusLostFlag = false; - var myButton = new MyButton(); - var view = new BaseComponents.View(); - view.Focusable = true; - myButton.Focusable = true; - Window.Instance.Add(myButton); - Window.Instance.Add(view); - FocusManager.Instance.SetCurrentFocusView(myButton); - FocusManager.Instance.SetCurrentFocusView(view); - Assert.AreEqual(true, _focusLostFlag, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test OnThemeChangedEvent. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Button.OnThemeChangedEvent M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public async Task OnThemeChangedEvent_CHECK_VALUE() - { - _themeFlag = false; - Tizen.NUI.Components.StyleManager.Instance.Theme = "Utility"; - var myButton = new MyButton(); - Window window = Window.Instance; - window.Add(myButton); - Tizen.NUI.Components.StyleManager.Instance.Theme = "Food"; - await Task.Delay(500); - Assert.AreEqual(true, _themeFlag, "OnThemeChangedEvent trigger Check Fail."); - window.Remove(myButton); - } - - [Test] - [Category("P1")] - [Description("Test OnUpdate. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Button.OnUpdate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public async Task OnUpdate_CHECK_VALUE() - { - /* TEST CODE */ - _updateFlag = false; - var myButton = new MyButton(); - myButton.Focusable = true; - myButton.Size2D = new Size2D(400, 80); - myButton.BackgroundColor = Color.Red; - Window.Instance.Add(myButton); - await Task.Delay(500); - Assert.AreEqual(true, _updateFlag, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test MeasureText. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Button.MeasureText M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public async Task MeasureText_CHECK_VALUE() - { - /* TEST CODE */ - _measureTextFlag = false; - var myButton = new MyButton(); - myButton.Focusable = true; - myButton.Size2D = new Size2D(400, 80); - myButton.BackgroundColor = Color.Red; - myButton.Text = "Button"; - Window.Instance.Add(myButton); - await Task.Delay(500); - Assert.AreEqual(true, _measureTextFlag, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test LayoutChild. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Button.LayoutChild M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public async Task LayoutChild_CHECK_VALUE() - { - /* TEST CODE */ - _layoutChildFlag = false; - var myButton = new MyButton(); - myButton.Focusable = true; - myButton.Size2D = new Size2D(400, 80); - myButton.BackgroundColor = Color.Red; - myButton.Text = "Button"; - Window.Instance.Add(myButton); - await Task.Delay(500); - Assert.AreEqual(true, _layoutChildFlag, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test GetAttributes. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Button.GetAttributes M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void GetAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var myButton = new MyButton(); - var attr = myButton.TestGetAttributes(); - Assert.IsNotNull(attr, "Should be not null!"); - Assert.IsInstanceOf(attr, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test UpdateState. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Button.UpdateState M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void UpdateState_CHECK_VALUE() - { - /* TEST CODE */ - try - { - var myButton = new MyButton(); - myButton.Size2D = new Size2D(400, 80); - myButton.BackgroundColor = Color.Red; - Window.Instance.Add(myButton); - myButton.IsSelected = true; - Assert.IsTrue(_updateFlag, "Should be true!"); - } - 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 StateChangedEvent. Check it has been triggered")] @@ -1087,11 +464,14 @@ namespace Tizen.NUI.Components.Tests public void StateChangedEvent_CHECK_VALUE() { /* TEST CODE */ - var myButton = new MyButton(); - myButton.StateChangedEvent += OnStateChangedEvent; - myButton.IsSelected = true; + var button = new Button(); + Assert.IsNotNull(button, "Should be not null"); + Assert.IsInstanceOf(button, "Should be equal!"); + + button.StateChangedEvent += OnStateChangedEvent; + button.IsSelected = true; Assert.AreEqual(true, _stateChangedEvent, "Should be equal!"); - myButton.StateChangedEvent -= OnStateChangedEvent; + button.StateChangedEvent -= OnStateChangedEvent; } [Test] @@ -1107,6 +487,8 @@ namespace Tizen.NUI.Components.Tests try { Button button = new Button(); + Assert.IsNotNull(button, "Should be not null"); + Assert.IsInstanceOf(button, "Should be equal!"); button.Dispose(); } catch (Exception e) @@ -1117,7 +499,7 @@ namespace Tizen.NUI.Components.Tests } } - private void OnStateChangedEvent(object sender, Components.Button.StateChangeEventArgs args) + private void OnStateChangedEvent(object sender, Components.Button.StateChangedEventArgs args) { _stateChangedEvent = true; } diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButtonAttributes.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButtonAttributes.cs deleted file mode 100755 index 4ffea9707..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButtonAttributes.cs +++ /dev/null @@ -1,231 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.ButtonAttributes Tests")] - public class ButtonAttributesTests - { - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("ButtonAttributesTests"); - App.MainTitleChangeBackgroundColor(null); - - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test ButtonAttributes empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.ButtonAttributes.ButtonAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ButtonAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var buttonAttributes = new ButtonAttributes(); - Assert.IsNotNull(buttonAttributes, "Should be not null!"); - Assert.IsInstanceOf(buttonAttributes, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test ButtonAttributes copy constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.ButtonAttributes.ButtonAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "ButtonAttributes")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ButtonAttributes_ButtonAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var buttonAttributes = new ButtonAttributes - { - IsSelectable = true, - BackgroundImageAttributes = new ImageAttributes - { - ResourceURL = new StringSelector { All = _image_path }, - Border = new RectangleSelector { All = new Rectangle(5, 5, 5, 5) } - }, - - TextAttributes = new TextAttributes - { - PointSize = new FloatSelector { All = 20 }, - HorizontalAlignment = HorizontalAlignment.Center, - VerticalAlignment = VerticalAlignment.Center, - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent, - - TextColor = new ColorSelector - { - Normal = new Color(0, 0, 0, 1), - Pressed = new Color(0, 0, 0, 0.7f), - Selected = new Color(0.141f, 0.769f, 0.278f, 1), - Disabled = new Color(0, 0, 0, 0.4f), - }, - } - }; - var _buttonAttributes = new ButtonAttributes(buttonAttributes); - Assert.IsNotNull(_buttonAttributes, "Should be not null!"); - Assert.IsInstanceOf(_buttonAttributes, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test ShadowImageAttributes. Check whether ShadowImageAttributes is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ButtonAttributes.ShadowImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ShadowImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var buttonAttributes = new ButtonAttributes(); - buttonAttributes.ShadowImageAttributes = new ImageAttributes(); - Assert.IsNotNull(buttonAttributes.ShadowImageAttributes, "Should be not null!"); - Assert.IsInstanceOf(buttonAttributes.ShadowImageAttributes, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test BackgroundImageAttributes. Check whether BackgroundImageAttributes is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ButtonAttributes.BackgroundImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void BackgroundImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var buttonAttributes = new ButtonAttributes(); - buttonAttributes.BackgroundImageAttributes = new ImageAttributes(); - Assert.IsNotNull(buttonAttributes.BackgroundImageAttributes, "Should be not null!"); - Assert.IsInstanceOf(buttonAttributes.BackgroundImageAttributes, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test OverlayImageAttributes. Check whether OverlayImageAttributes is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ButtonAttributes.OverlayImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void OverlayImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var buttonAttributes = new ButtonAttributes(); - buttonAttributes.OverlayImageAttributes = new ImageAttributes(); - Assert.IsNotNull(buttonAttributes.OverlayImageAttributes, "Should be not null!"); - Assert.IsInstanceOf(buttonAttributes.OverlayImageAttributes, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test TextAttributes. Check whether TextAttributes is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ButtonAttributes.TextAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TextAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var buttonAttributes = new ButtonAttributes(); - buttonAttributes.TextAttributes = new TextAttributes(); - Assert.IsNotNull(buttonAttributes.TextAttributes, "Should be not null!"); - Assert.IsInstanceOf(buttonAttributes.TextAttributes, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test IconAttributes. Check whether IconAttributes is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ButtonAttributes.IconAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IconAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var buttonAttributes = new ButtonAttributes(); - buttonAttributes.IconAttributes = new ImageAttributes(); - Assert.IsNotNull(buttonAttributes.IconAttributes, "Should be not null!"); - Assert.IsInstanceOf(buttonAttributes.IconAttributes, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test IsSelectable. Check whether IsSelectable is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ButtonAttributes.IsSelectable A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IsSelectable_SET_GET_VALUE() - { - /* TEST CODE */ - var buttonAttributes = new ButtonAttributes(); - buttonAttributes.IsSelectable = true; - Assert.AreEqual(true, buttonAttributes.IsSelectable, "Should be equals!"); - buttonAttributes.IsSelectable = false; - Assert.AreEqual(false, buttonAttributes.IsSelectable, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test IconRelativeOrientation. Check whether IconRelativeOrientation is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ButtonAttributes.IconRelativeOrientation A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IconRelativeOrientation_SET_GET_VALUE() - { - /* TEST CODE */ - var buttonAttributes = new ButtonAttributes(); - buttonAttributes.IconRelativeOrientation = Components.Button.IconOrientation.Top; - Assert.AreEqual(Components.Button.IconOrientation.Top, buttonAttributes.IconRelativeOrientation, "Should be equals!"); - buttonAttributes.IconRelativeOrientation = Components.Button.IconOrientation.Bottom; - Assert.AreEqual(Components.Button.IconOrientation.Bottom, buttonAttributes.IconRelativeOrientation, "Should be equals!"); - buttonAttributes.IconRelativeOrientation = Components.Button.IconOrientation.Left; - Assert.AreEqual(Components.Button.IconOrientation.Left, buttonAttributes.IconRelativeOrientation, "Should be equals!"); - buttonAttributes.IconRelativeOrientation = Components.Button.IconOrientation.Right; - Assert.AreEqual(Components.Button.IconOrientation.Right, buttonAttributes.IconRelativeOrientation, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.ButtonAttributes.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Clone_CHECK_VALUE() - { - var buttonAttributes = new ButtonAttributes(); - buttonAttributes.IsSelectable = true; - var attr = buttonAttributes.Clone() as ButtonAttributes; - Assert.IsNotNull(attr, "Should be not null!"); - Assert.IsInstanceOf(attr, "Should be an instance of ButtonAttributes!"); - Assert.AreEqual(true, attr.IsSelectable, "Should be equal!"); - } - - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSChecBox.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSChecBox.cs deleted file mode 100755 index bc7039874..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSChecBox.cs +++ /dev/null @@ -1,152 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.CheckBox Tests")] - public class ChecBoxTests - { - private const string TAG = "Components"; - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("CommonChecBoxTests"); - App.MainTitleChangeBackgroundColor(null); - - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test CheckBox empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.CheckBox.CheckBox C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckBox_CHECK_VALUE() - { - /* TEST CODE */ - var checkBox = new CheckBox(); - Assert.IsInstanceOf(checkBox, "Should be equal!"); - Assert.IsNotNull(checkBox, "Should be not null!"); - - } - - [Test] - [Category("P1")] - [Description("Test CheckBox style constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.CheckBox.CheckBox C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckBox_Style_CHECK_VALUE() - { - /* TEST CODE */ - StyleManager.Instance.RegisterStyle("BasicCheckBox", null, typeof(CheckBoxStyle)); - var checkBox = new CheckBox("BasicCheckBox"); - Assert.IsNotNull(checkBox, "Should be not null!"); - Assert.IsInstanceOf(checkBox, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test CheckBox SelectButtonAttributes constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.CheckBox.CheckBox C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "SelectButtonAttributes")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckBox_SelectButtonAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var selectButtonAttributes = new SelectButtonAttributes - { - CheckImageAttributes = new ImageAttributes - { - Size2D = new Size2D(48, 48), - ResourceURL = new StringSelector - { - All = _image_path, - }, - Opacity = new FloatSelector - { - Normal = 1.0f, - Selected = 1.0f, - Disabled = 0.4f, - DisabledSelected = 0.4f - }, - }, - }; - var checkBox = new CheckBox(selectButtonAttributes); - Assert.IsNotNull(checkBox, "Should be not null!"); - Assert.IsInstanceOf(checkBox, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test ItemGroup. Check whether ItemGroup is readable.")] - [Property("SPEC", "Tizen.NUI.Components.CheckBox.ItemGroup A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ItemGroup_GET_VALUE() - { - /* TEST CODE */ - var checkBoxGroup = new CheckBoxGroup(); - var checkBox = new CheckBox(); - checkBoxGroup.Add(checkBox); - Assert.IsNotNull(checkBox.ItemGroup, "Should be equal!"); - } - } - - public class CheckBoxStyle : StyleBase - { - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - protected override Attributes GetAttributes() - { - SelectButtonAttributes attributes = new SelectButtonAttributes - { - IsSelectable = true, - CheckImageAttributes = new ImageAttributes - { - Size2D = new Size2D(48, 48), - Position2D = new Position2D(0, 0), - ResourceURL = new StringSelector - { - Normal = _image_path, - Selected = _image_path, - Disabled = _image_path, - DisabledSelected = _image_path, - }, - Opacity = new FloatSelector - { - Normal = 1.0f, - Selected = 1.0f, - Disabled = 0.4f, - DisabledSelected = 0.4f - }, - }, - }; - - return attributes; - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSCheckBoxGroup.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSCheckBoxGroup.cs deleted file mode 100755 index 10e7c8745..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSCheckBoxGroup.cs +++ /dev/null @@ -1,225 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.CheckBoxGroup Tests")] - public class CheckBoxGroupTests - { - private const string TAG = "Components"; - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("CheckBoxGroupTests"); - App.MainTitleChangeBackgroundColor(null); - - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test CheckBoxGroup. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.CheckBoxGroup C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckBoxGroup_CHECK_VALUE() - { - var checkBoxGroup = new CheckBoxGroup(); - Assert.IsNotNull(checkBoxGroup, "Should be not null!"); - Assert.IsInstanceOf(checkBoxGroup, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Add. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.Add M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Add_CHECK_VALUE() - { - var checkBox1 = new CheckBox(); - checkBox1.Name = "checkbox1"; - - var checkBoxGroup = new CheckBoxGroup(); - checkBoxGroup.Add(checkBox1); - - string checkboxName1 = checkBoxGroup.GetItemByIndex(0).Name; - - Assert.AreEqual("checkbox1", checkboxName1, "Should be equals to the name of CheckBox"); - } - - [Test] - [Category("P1")] - [Description("Test Remove. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.Remove M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Remove_CHECK_VALUE() - { - var checkBox1 = new CheckBox(); - checkBox1.Name = "checkbox1"; - var checkBox2 = new CheckBox(); - checkBox2.Name = "checkbox2"; - - var checkBoxGroup = new CheckBoxGroup(); - checkBoxGroup.Add(checkBox1); - checkBoxGroup.Add(checkBox2); - - checkBoxGroup.Remove(checkBox1); - - string checkboxName1 = checkBoxGroup.GetItemByIndex(0).Name; - - Assert.AreEqual("checkbox2", checkboxName1, "Should be equals to the name of CheckBox"); - } - - [Test] - [Category("P1")] - [Description("Test GetItemByIndex. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.GetItemByIndex M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void GetItemByIndex_CHECK_VALUE() - { - var checkBox1 = new CheckBox(); - checkBox1.Name = "checkbox1"; - var checkBox2 = new CheckBox(); - checkBox2.Name = "checkbox2"; - - var checkBoxGroup = new CheckBoxGroup(); - checkBoxGroup.Add(checkBox1); - checkBoxGroup.Add(checkBox2); - - string checkboxName1 = checkBoxGroup.GetItemByIndex(0).Name; - string checkboxName2 = checkBoxGroup.GetItemByIndex(1).Name; - - Assert.AreEqual("checkbox1", checkboxName1, "Should be equals to the name of CheckBox"); - Assert.AreEqual("checkbox2", checkboxName2, "Should be equals to the name of CheckBox"); - } - - [Test] - [Category("P1")] - [Description("Test GetCheckedIndexArray. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.GetCheckedIndexArray M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void GetCheckedIndexArray_CHECK_VALUE() - { - var checkBox1 = new CheckBox(); - checkBox1.Name = "checkbox1"; - var checkBox2 = new CheckBox(); - checkBox2.Name = "checkbox2"; - - var checkBoxGroup = new CheckBoxGroup(); - checkBoxGroup.Add(checkBox1); - checkBoxGroup.Add(checkBox2); - - checkBoxGroup.CheckingAll(true); - - int[] indexArray = new int[2]; - indexArray = checkBoxGroup.GetCheckedIndexArray(); - - Assert.AreEqual(0, indexArray[0], "Should be equal to GetCheckedIndexArray return value"); - Assert.AreEqual(1, indexArray[1], "Should be equal to GetCheckedIndexArray return value"); - } - - [Test] - [Category("P1")] - [Description("Test GetCheckedItemArray. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.GetCheckedItemArray M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void GetCheckedItemArray_CHECK_VALUE() - { - var checkBox1 = new CheckBox(); - checkBox1.Name = "checkbox1"; - var checkBox2 = new CheckBox(); - checkBox2.Name = "checkbox2"; - - var checkBoxGroup = new CheckBoxGroup(); - checkBoxGroup.Add(checkBox1); - checkBoxGroup.Add(checkBox2); - - checkBoxGroup.CheckingAll(true); - - CheckBox[] checkboxArray = new CheckBox[2]; - checkboxArray = checkBoxGroup.GetCheckedItemArray(); - - Assert.AreEqual("checkbox1", checkboxArray[0].Name, "Should be equal to GetCheckedItemArray return value"); - Assert.AreEqual("checkbox2", checkboxArray[1].Name, "Should be equal to GetCheckedItemArray return value"); - } - - [Test] - [Category("P1")] - [Description("Test IsCheckedAll. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.IsCheckedAll M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IsCheckedAll_CHECK_VALUE() - { - var checkBox1 = new CheckBox(); - checkBox1.Name = "checkbox1"; - var checkBox2 = new CheckBox(); - checkBox2.Name = "checkbox2"; - - var checkBoxGroup = new CheckBoxGroup(); - checkBoxGroup.Add(checkBox1); - checkBoxGroup.Add(checkBox2); - - checkBoxGroup.CheckingAll(false); - bool flag = checkBoxGroup.IsCheckedAll(); - Assert.AreEqual(false, flag, "Should be equal!"); - checkBoxGroup.CheckingAll(true); - Assert.AreEqual(true, checkBoxGroup.IsCheckedAll(), "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test CheckingAll. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.CheckingAll M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckingAll_CHECK_VALUE() - { - var checkBox1 = new CheckBox(); - checkBox1.Name = "checkbox1"; - var checkBox2 = new CheckBox(); - checkBox2.Name = "checkbox2"; - - var checkBoxGroup = new CheckBoxGroup(); - checkBoxGroup.Add(checkBox1); - checkBoxGroup.Add(checkBox2); - - checkBoxGroup.CheckingAll(true); - - bool flag = checkBoxGroup.IsCheckedAll(); - Assert.AreEqual(true, flag, "Should be equal!"); - checkBoxGroup.CheckingAll(false); - Assert.AreEqual(false, checkBoxGroup.IsCheckedAll(), "Should be equal!"); - } - - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSColorSelector.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSColorSelector.cs deleted file mode 100755 index 4fe3e4b02..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSColorSelector.cs +++ /dev/null @@ -1,67 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Threading.Tasks; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.ColorSelector Tests")] - public class ColorSelectorTests - { - private const string TAG = "NUI.Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("ColorSelectorTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a ColorSelector object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.ColorSelector.ColorSelector C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ColorSelector_INIT() - { - /* TEST CODE */ - var colorSelector = new ColorSelector(); - Assert.IsNotNull(colorSelector, "Can't create success object ColorSelector"); - Assert.IsInstanceOf(colorSelector, "Should be an instance of ColorSelector type."); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check Whether Clone works or not")] - [Property("SPEC", "Tizen.NUI.Components.ColorSelector.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Clone_TEST() - { - /* TEST CODE */ - var colorSelector1 = new ColorSelector(); - colorSelector1.All = Color.Red; - var colorSelector = colorSelector1.Clone(); - Assert.IsNotNull(colorSelector, "should be not null!"); - Assert.AreEqual(1.0f, colorSelector.All.R, "Should be equal!"); - Assert.AreEqual(0.0f, colorSelector.All.G, "Should be equal!"); - Assert.AreEqual(0.0f, colorSelector.All.B, "Should be equal!"); - Assert.AreEqual(1.0f, colorSelector.All.A, "Should be equal!"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSControl.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSControl.cs deleted file mode 100755 index c3d610c71..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSControl.cs +++ /dev/null @@ -1,526 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Threading.Tasks; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.Control Tests")] - public class ControlTests - { - private const string TAG = "NUI.Components"; - private static bool _styleRegiesterFlag = false; - private static bool _focusGainedFlag = false; - private static bool _focusLostFlag = false; - private static bool _relayoutFlag = false; - private static bool _updateFlag = false; - private static bool _themeChanged = false; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("ControlTests"); - App.MainTitleChangeBackgroundColor(null); - - if (!_styleRegiesterFlag) - { - StyleManager.Instance.RegisterStyle("DAMyControl", null, typeof(Tizen.NUI.Components.Tests.DAMyControlStyle)); - _styleRegiesterFlag = true; - } - - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a Control object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Control.Control C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Control_INIT() - { - /* TEST CODE */ - var myControl = new MyControl(); - Assert.IsNotNull(myControl, "Can't create success object MyControl"); - Assert.IsInstanceOf(myControl, "Should be an instance of MyControl type."); - } - - [Test] - [Category("P1")] - [Description("Create a Control object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Control.Control C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "Attributes")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Control_INIT_WITH_ATTRIBUTES() - { - /* TEST CODE */ - var attr = new MyControlAttributes - { - BGImageAttributes = new ImageAttributes - { - BackgroundColor = new ColorSelector - { - All = new Color(0.43f, 0.43f, 0.43f, 0.1f), - } - }, - }; - var myControl = new MyControl(attr); - Assert.IsNotNull(myControl, "Can't create success object MyControl"); - Assert.IsInstanceOf(myControl, "Should be an instance of MyControl type."); - } - - [Test] - [Category("P1")] - [Description("Create a Control object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Control.Control C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Control_INIT_WITH_STYLE() - { - /* TEST CODE */ - var myControl = new MyControl("DAMyControl"); - Assert.IsNotNull(myControl, "Can't create success object MyControl"); - Assert.IsInstanceOf(myControl, "Should be an instance of MyControl type."); - } - - [Test] - [Category("P1")] - [Description("Test State.Check whether State is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.Control.State A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void State_SET_GET_VALUE() - { - /* TEST CODE */ - var myControl = new MyControl(); - myControl.State = ControlStates.Normal; - Assert.AreEqual(ControlStates.Normal, myControl.State, "Should be equal"); - myControl.State = ControlStates.Focused; - Assert.AreEqual(ControlStates.Focused, myControl.State, "Should be equal"); - myControl.State = ControlStates.Disabled; - Assert.AreEqual(ControlStates.Disabled, myControl.State, "Should be equal"); - myControl.State = ControlStates.Selected; - Assert.AreEqual(ControlStates.Selected, myControl.State, "Should be equal"); - myControl.State = ControlStates.Pressed; - Assert.AreEqual(ControlStates.Pressed, myControl.State, "Should be equal"); - myControl.State = ControlStates.DisabledFocused; - Assert.AreEqual(ControlStates.DisabledFocused, myControl.State, "Should be equal"); - myControl.State = ControlStates.SelectedFocused; - Assert.AreEqual(ControlStates.SelectedFocused, myControl.State, "Should be equal"); - myControl.State = ControlStates.DisabledSelected; - Assert.AreEqual(ControlStates.DisabledSelected, myControl.State, "Should be equal"); - myControl.State = ControlStates.Max; - Assert.AreEqual(ControlStates.Max, myControl.State, "Should be equal"); - } - - [Test] - [Category("P1")] - [Description("Test ApplyAttributes. Check Whether ApplyAttributes works or not")] - [Property("SPEC", "Tizen.NUI.Components.Control.ApplyAttributes M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ApplyAttributes_TEST() - { - /* TEST CODE */ - try - { - var attr = new MyControlAttributes - { - BGImageAttributes = new ImageAttributes - { - BackgroundColor = new ColorSelector - { - All = new Color(0.43f, 0.43f, 0.43f, 0.1f), - } - }, - }; - - var myControl = new MyControl(); - myControl.ApplyAttributes(attr); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test GetAttributes. Check Whether GetAttributes works or not")] - [Property("SPEC", "Tizen.NUI.Components.Control.GetAttributes M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetAttributes_TEST() - { - /* TEST CODE */ - try - { - var myControl = new MyControl(); - var attr = myControl.TestGetAttributes() as MyControlAttributes; - Assert.IsNotNull(attr, "Should be not null"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test OnTouch. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Control.OnTouch M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OnTouch_CHECK_VALUE() - { - /* TEST CODE */ - try - { - var view = new MyControl(); - var touch = new Touch(); - bool flag = true; - flag = view.OnTouch(touch); - Assert.AreEqual(false, flag, "OnTouch trigger Check Fail."); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test OnKey. Check return the right value or not")] - [Property("SPEC", "Tizen.NUI.Components.Control.OnKey M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OnKey_CHECK_RETURN_VALUE() - { - /* TEST CODE */ - try - { - var view = new MyControl(); - bool flag = true; - flag = view.OnKey(new Key()); - Assert.AreEqual(false, flag, "OnKey return check fail."); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test OnRelayout. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Control.OnRelayout M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public async Task OnRelayout_CHECK_VALUE() - { - /* TEST CODE */ - try - { - _relayoutFlag = false; - var view = new MyControl(); - Window window = Window.Instance; - window.Add(view); - await Task.Delay(500); - Assert.AreEqual(true, _relayoutFlag, "OnRelayout trigger Check Fail."); - window.Remove(view); - } - catch (Exception e) - { - Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test OnFocusGained. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Control.OnFocusGained M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com.com")] - public void OnFocusGained_CHECK_VALUE() - { - /* TEST CODE */ - _focusGainedFlag = false; - Window window = Window.Instance; - var view = new MyControl(); - view.Focusable = true; - window.Add(view); - FocusManager.Instance.SetCurrentFocusView(view); - Assert.AreEqual(true, _focusGainedFlag, "OnFocusGained Check Fail."); - window.Remove(view); - } - - [Test] - [Category("P1")] - [Description("Test OnFocusLost. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Control.OnFocusLost M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OnFocusLost_CHECK_VALUE() - { - /* TEST CODE */ - _focusLostFlag = false; - Window window = Window.Instance; - var view = new MyControl(); - var view2 = new MyControl(); - view.Focusable = true; - view2.Focusable = true; - window.Add(view); - window.Add(view2); - FocusManager.Instance.SetCurrentFocusView(view); - FocusManager.Instance.SetCurrentFocusView(view2); - Assert.AreEqual(true, _focusLostFlag, "OnFocusLost Check Fail."); - window.Remove(view); - window.Remove(view2); - } - - [Test] - [Category("P1")] - [Description("Test OnUpdate. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Control.OnUpdate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public async Task OnUpdate_CHECK_VALUE() - { - /* TEST CODE */ - _updateFlag = false; - var view = new MyControl(); - view.Size2D = new Size2D(200, 200); - view.BackgroundColor = Color.Red; - Window.Instance.Add(view); - view.BackgroundColor = Color.Cyan; - await Task.Delay(500); - Assert.AreEqual(true, _updateFlag, "OnUpdate trigger Check Fail."); - Window.Instance.Remove(view); - } - - [Test] - [Category("P1")] - [Description("Test OnThemeChangedEvent. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Control.OnThemeChangedEvent M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public async Task OnThemeChangedEvent_CHECK_VALUE() - { - /* TEST CODE */ - try - { - _themeChanged = false; - Tizen.NUI.Components.StyleManager.Instance.Theme = "Utility"; - var view = new MyControl(); - Window window = Window.Instance; - window.Add(view); - Tizen.NUI.Components.StyleManager.Instance.Theme = "Food"; - await Task.Delay(500); - Assert.AreEqual(true, _themeChanged, "OnThemeChangedEvent trigger Check Fail."); - window.Remove(view); - } - catch (Exception e) - { - Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Dispose, try to dispose the Control.")] - [Property("SPEC", "Tizen.NUI.Components.Control.Dispose M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Dispose_TEST() - { - /* TEST CODE */ - try - { - MyControl control = new MyControl(); - control.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()); - } - } - - - public class MyControlAttributes : ViewAttributes - { - public MyControlAttributes() : base() - { - - } - - public MyControlAttributes(MyControlAttributes attributes) : base(attributes) - { - if (attributes == null) - { - return; - } - - if (attributes.BGImageAttributes != null) - { - BGImageAttributes = attributes.BGImageAttributes.Clone() as ImageAttributes; - } - } - public ImageAttributes BGImageAttributes - { - get; - set; - } - - public override Attributes Clone() - { - return new MyControlAttributes(this); - } - } - - public class MyControl : Control - { - private MyControlAttributes _myControlAttrs; - private ImageView _bgImage; - public MyControl() : base() - { - Initialize(); - } - - public MyControl(string style) : base(style) - { - Initialize(); - } - - public MyControl(MyControlAttributes attributes) : base(attributes) - { - Initialize(); - } - - private void Initialize() - { - _myControlAttrs = this.attributes as MyControlAttributes; - if (_myControlAttrs == null) - { - throw new Exception("ScrollBar attribute parse error."); - } - - _bgImage = new ImageView - { - Focusable = false, - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent, - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft, - PivotPoint = Tizen.NUI.PivotPoint.TopLeft - - }; - } - - public void ApplyAttributes(ViewAttributes attrs) - { - ApplyAttributes(this, _myControlAttrs); - } - - public Attributes TestGetAttributes() - { - return GetAttributes(); - } - protected override Attributes GetAttributes() - { - return new MyControlAttributes() - { - BGImageAttributes = new ImageAttributes - { - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent, - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft, - PivotPoint = Tizen.NUI.PivotPoint.TopLeft - } - - }; - } - - public override void OnRelayout(Vector2 size, RelayoutContainer container) - { - _relayoutFlag = true; - ApplyAttributes(this, _myControlAttrs); - ApplyAttributes(_bgImage, _myControlAttrs.BGImageAttributes); - base.OnRelayout(size, container); - } - - public override void OnFocusGained() - { - _focusGainedFlag = true; - base.OnFocusGained(); - } - - public override void OnFocusLost() - { - _focusLostFlag = true; - base.OnFocusLost(); - } - - protected override void OnUpdate() - { - _updateFlag = true; - base.OnUpdate(); - } - - protected override void OnThemeChangedEvent(object sender, Tizen.NUI.Components.StyleManager.ThemeChangeEventArgs e) - { - _themeChanged = true; - base.OnThemeChangedEvent(sender, e); - } - } - } - - public class DAMyControlStyle : StyleBase - { - protected override Attributes GetAttributes() - { - ControlTests.MyControlAttributes attributes = new ControlTests.MyControlAttributes - { - BGImageAttributes = new ImageAttributes - { - BackgroundColor = new ColorSelector - { - All = new Color(0.0f, 0.0f, 0.0f, 0.2f) - } - }, - }; - return attributes; - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSDropDown.DropDownItemData.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSDropDown.DropDownItemData.cs deleted file mode 100755 index 363bc14c1..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSDropDown.DropDownItemData.cs +++ /dev/null @@ -1,353 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.DropDown.DropDownItemData Tests")] - public class DropDownItemDataTests - { - private const string TAG = "Components"; - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("DropDownItemDataTests"); - App.MainTitleChangeBackgroundColor(null); - - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test DropDownItemData empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.DropDownItemData C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void DropDownItemData_CHECK_VALUE() - { - /* TEST CODE */ - var dropDownItemData = new DropDown.DropDownItemData(); - Assert.IsNotNull(dropDownItemData, "Should be not null"); - Assert.IsInstanceOf(dropDownItemData, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test DropDown style constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.DropDownItemData C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void DropDownItemData_Style_CHECK_VALUE() - { - /* TEST CODE */ - StyleManager.Instance.RegisterStyle("IconListItemStyle", null, typeof(IconListItemStyle)); - var dropDownItemData = new DropDown.DropDownItemData("IconListItemStyle"); - Assert.IsNotNull(dropDownItemData, "Should be not null"); - Assert.IsInstanceOf(dropDownItemData, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test DropDownItemData DropDownItemAttributes constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.DropDownItemData C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "DropDownItemAttributes")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void DropDownItemData_DropDownItemAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var itemAttrs = new DropDownItemAttributes - { - BackgroundColor = new ColorSelector - { - Pressed = new Color(0, 0, 0, 0.4f), - Other = new Color(1, 1, 1, 0), - }, - TextAttributes = new TextAttributes - { - PointSize = new FloatSelector { All = 18 }, - FontFamily = "SamsungOne 500", - Position2D = new Position2D(28, 0), - }, - CheckImageAttributes = new ImageAttributes - { - Size2D = new Size2D(40, 40), - ResourceURL = new StringSelector { All = _image_path }, - }, - CheckImageRightSpace = 16, - }; - var dropDownItemData = new DropDown.DropDownItemData(itemAttrs); - Assert.IsNotNull(dropDownItemData, "Should be not null"); - Assert.IsInstanceOf(dropDownItemData, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Size2D. Check whether Size2D is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.Size2D A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Size2D_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownItemData = new DropDown.DropDownItemData(); - dropDownItemData.Size2D = new Size2D(10, 10); - Assert.AreEqual(10, dropDownItemData.Size2D.Width, "Should be equals to the set value of dropDownItemData.Size2D.Width"); - Assert.AreEqual(10, dropDownItemData.Size2D.Height, "Should be equals to the set value of dropDownItemData.Size2D.Height"); - } - - [Test] - [Category("P1")] - [Description("Test BackgroundColorSelector. Check whether BackgroundColorSelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.BackgroundColorSelector A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void BackgroundColorSelector_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownItemData = new DropDown.DropDownItemData(); - var colorSelector = new ColorSelector - { - Normal = new Color(0.0f, 0.0f, 1.0f, 1.0f), - Selected = new Color(0.0f, 1.0f, 0.0f, 1.0f), - }; - - dropDownItemData.BackgroundColorSelector = colorSelector; - Assert.AreEqual(colorSelector.Normal.R, dropDownItemData.BackgroundColorSelector.Normal.R, "Should be equals to the set value of BackgroundColorSelector Normal R"); - Assert.AreEqual(colorSelector.Normal.G, dropDownItemData.BackgroundColorSelector.Normal.G, "Should be equals to the set value of BackgroundColorSelector Normal G"); - Assert.AreEqual(colorSelector.Normal.B, dropDownItemData.BackgroundColorSelector.Normal.B, "Should be equals to the set value of BackgroundColorSelector Normal B"); - Assert.AreEqual(colorSelector.Normal.A, dropDownItemData.BackgroundColorSelector.Normal.A, "Should be equals to the set value of BackgroundColorSelector Normal A"); - - Assert.AreEqual(colorSelector.Selected.R, dropDownItemData.BackgroundColorSelector.Selected.R, "Should be equals to the set value of BackgroundColorSelector Selected R"); - Assert.AreEqual(colorSelector.Selected.G, dropDownItemData.BackgroundColorSelector.Selected.G, "Should be equals to the set value of BackgroundColorSelector Selected G"); - Assert.AreEqual(colorSelector.Selected.B, dropDownItemData.BackgroundColorSelector.Selected.B, "Should be equals to the set value of BackgroundColorSelector Selected B"); - Assert.AreEqual(colorSelector.Selected.A, dropDownItemData.BackgroundColorSelector.Selected.A, "Should be equals to the set value of BackgroundColorSelector Selected A"); - } - - [Test] - [Category("P1")] - [Description("Test Text. Check whether Text is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.Text A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Text_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownItemData = new DropDown.DropDownItemData(); - dropDownItemData.Text = "Test Text"; - Assert.AreEqual("Test Text", dropDownItemData.Text, "Should be equals to the set value of Text"); - } - - [Test] - [Category("P1")] - [Description("Test PointSize. Check whether PointSize is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.PointSize A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void PointSize_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownItemData = new DropDown.DropDownItemData(); - dropDownItemData.PointSize = 10.0f; - Assert.AreEqual(10.0f, dropDownItemData.PointSize, "Should be equals to the set value of PointSize"); - } - - [Test] - [Category("P1")] - [Description("Test FontFamily. Check whether FontFamily is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.FontFamily A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void FontFamily_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownItemData = new DropDown.DropDownItemData(); - dropDownItemData.FontFamily = "SamsungOne 500"; - Assert.AreEqual("SamsungOne 500", dropDownItemData.FontFamily, "Should be equals to the set value of FontFamily"); - } - - [Test] - [Category("P1")] - [Description("Test TextPosition2D. Check whether TextPosition2D is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.TextPosition2D A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TextPosition2D_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownItemData = new DropDown.DropDownItemData(); - dropDownItemData.TextPosition2D = new Position2D(10, 10); - Assert.AreEqual(10, dropDownItemData.TextPosition2D.X, "Should be equals to the set value of TextPosition2D.X"); - Assert.AreEqual(10, dropDownItemData.TextPosition2D.Y, "Should be equals to the set value of TextPosition2D.Y"); - } - - [Test] - [Category("P1")] - [Description("Test IconResourceUrl. Check whether IconResourceUrl is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.IconResourceUrl A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IconResourceUrl_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownItemData = new DropDown.DropDownItemData(); - dropDownItemData.IconResourceUrl = _image_path; - Assert.AreEqual(_image_path, dropDownItemData.IconResourceUrl, "Should be equals to the set value of IconResourceUrl"); - } - - [Test] - [Category("P1")] - [Description("Test IconSize2D. Check whether IconSize2D is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.IconSize2D A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IconSize2D_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownItemData = new DropDown.DropDownItemData(); - dropDownItemData.IconSize2D = new Size2D(10, 10); - Assert.AreEqual(10, dropDownItemData.IconSize2D.Width, "Should be equals to the set value of IconSize2D.Width"); - Assert.AreEqual(10, dropDownItemData.IconSize2D.Height, "Should be equals to the set value of IconSize2D.Height"); - } - - [Test] - [Category("P1")] - [Description("Test IconPosition2D. Check whether IconPosition2D is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.IconPosition2D A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IconPosition2D_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownItemData = new DropDown.DropDownItemData(); - dropDownItemData.IconPosition2D = new Position2D(10, 10); - Assert.AreEqual(10, dropDownItemData.IconPosition2D.X, "Should be equals to the set value of IconPosition2D.X"); - Assert.AreEqual(10, dropDownItemData.IconPosition2D.Y, "Should be equals to the set value of IconPosition2D.Y"); - } - - [Test] - [Category("P1")] - [Description("Test CheckImageResourceUrl. Check whether CheckImageResourceUrl is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.CheckImageResourceUrl A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckImageResourceUrl_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownItemData = new DropDown.DropDownItemData(); - dropDownItemData.CheckImageResourceUrl = _image_path; - Assert.AreEqual(_image_path, dropDownItemData.CheckImageResourceUrl, "Should be equals to the set value of CheckImageResourceUrl"); - } - - [Test] - [Category("P1")] - [Description("Test CheckImageSize2D. Check whether CheckImageSize2D is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.CheckImageSize2D A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckImageSize2D_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownItemData = new DropDown.DropDownItemData(); - dropDownItemData.CheckImageSize2D = new Size2D(10, 10); - Assert.AreEqual(10, dropDownItemData.CheckImageSize2D.Width, "Should be equals to the set value of CheckImageSize2D.Width"); - Assert.AreEqual(10, dropDownItemData.CheckImageSize2D.Height, "Should be equals to the set value of CheckImageSize2D.Height"); - } - - [Test] - [Category("P1")] - [Description("Test CheckImageRightSpace. Check whether CheckImageRightSpace is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.CheckImageRightSpace A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckImageRightSpace_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownItemData = new DropDown.DropDownItemData(); - dropDownItemData.CheckImageRightSpace = 10; - Assert.AreEqual(10, dropDownItemData.CheckImageRightSpace, "Should be equals to the set value of CheckImageRightSpace"); - } - - [Test] - [Category("P1")] - [Description("Test IsSelected. Check whether IsSelected is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.IsSelected A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IsSelected_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownItemData = new DropDown.DropDownItemData(); - dropDownItemData.IsSelected = true; - Assert.AreEqual(true, dropDownItemData.IsSelected, "Should be equals to the set value of IsSelected"); - dropDownItemData.IsSelected = false; - Assert.AreEqual(false, dropDownItemData.IsSelected, "Should be equals to the set value of IsSelected"); - } - - public class IconListItemStyle : StyleBase - { - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - protected override Attributes GetAttributes() - { - DropDownItemAttributes attributes = new DropDownItemAttributes - { - BackgroundColor = new ColorSelector - { - Pressed = new Color(0, 0, 0, 0.4f), - Other = new Color(1, 1, 1, 0), - }, - IconAttributes = new ImageAttributes - { - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft, - PivotPoint = Tizen.NUI.PivotPoint.TopLeft, - Size2D = new Size2D(28, 28), - Position2D = new Position2D(28, 0), - }, - CheckImageAttributes = new ImageAttributes - { - Size2D = new Size2D(40, 40), - ResourceURL = new StringSelector { All = _image_path }, - }, - CheckImageRightSpace = 16, - }; - - return attributes; - } - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSDropDown.DropDownListBridge.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSDropDown.DropDownListBridge.cs deleted file mode 100755 index 716519bc4..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSDropDown.DropDownListBridge.cs +++ /dev/null @@ -1,219 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.DropDown.DropDownListBridge Tests")] - public class DropDownListBridgeTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("DropDownListBridgeTests"); - App.MainTitleChangeBackgroundColor(null); - - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test DropDownListBridge empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownListBridge.DropDownListBridge C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void DropDownListBridge_CHECK_VALUE() - { - /* TEST CODE */ - var dropDownListBridge = new DropDown.DropDownListBridge(); - Assert.IsNotNull(dropDownListBridge, "Should be not null!"); - Assert.IsInstanceOf(dropDownListBridge, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test InsertData. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownListBridge.InsertData M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void InsertData_CHECK_VALUE() - { - /* TEST CODE */ - var dropDownListBridge = new DropDown.DropDownListBridge(); - var dropDownItemData = new DropDown.DropDownItemData(); - dropDownListBridge.InsertData(0, dropDownItemData); - - int num = dropDownListBridge.GetItemCount(); - Assert.AreEqual(1, num, "Should be equal"); - } - - [Test] - [Category("P1")] - [Description("Test RemoveData. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownListBridge.RemoveData M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void RemoveData_CHECK_VALUE() - { - /* TEST CODE */ - var dropDownListBridge = new DropDown.DropDownListBridge(); - var dropDownItemData = new DropDown.DropDownItemData(); - dropDownListBridge.InsertData(0, dropDownItemData); - dropDownListBridge.RemoveData(0); - - int num = dropDownListBridge.GetItemCount(); - Assert.AreEqual(0, num, "Should be equal"); - } - - [Test] - [Category("P1")] - [Description("Test GetData. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownListBridge.GetData M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void GetData_CHECK_VALUE() - { - /* TEST CODE */ - var dropDownListBridge = new DropDown.DropDownListBridge(); - var dropDownItemData = new DropDown.DropDownItemData(); - dropDownItemData.Text = "Item0"; - dropDownListBridge.InsertData(0, dropDownItemData); - var dropDownRet = dropDownListBridge.GetData(0); - Assert.IsNotNull(dropDownRet, "Should not be null"); - Assert.AreEqual("Item0", dropDownRet.Text, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test GetItemCount. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownListBridge.GetItemCount M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void GetItemCount_CHECK_VALUE() - { - /* TEST CODE */ - var dropDownListBridge = new DropDown.DropDownListBridge(); - var dropDownItemData = new DropDown.DropDownItemData(); - var dropDownItemData1 = new DropDown.DropDownItemData(); - dropDownListBridge.InsertData(0, dropDownItemData); - dropDownListBridge.InsertData(1, dropDownItemData); - - int num = dropDownListBridge.GetItemCount(); - Assert.AreEqual(2, num, "Should be equal"); - } - - [Test] - [Category("P1")] - [Description("Test OnCreateViewHolder. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownListBridge.OnCreateViewHolder M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void OnCreateViewHolder_CHECK_VALUE() - { - /* TEST CODE */ - var myDropDownListBridge = new MyDropDownListBridge(); - myDropDownListBridge.TestOnCreateViewHolder(); - Assert.AreEqual(true, myDropDownListBridge.createViewHolderFlag, "Should be equal"); - } - - [Test] - [Category("P1")] - [Description("Test OnBindViewHolder. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownListBridge.OnBindViewHolder M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void OnBindViewHolder_CHECK_VALUE() - { - /* TEST CODE */ - - var myDropDownListBridge = new MyDropDownListBridge(); - var dropDownItemData = new DropDown.DropDownItemData(); - myDropDownListBridge.InsertData(0, dropDownItemData); - myDropDownListBridge.TestOnBindViewHolder(); - Assert.AreEqual(true, myDropDownListBridge.bindViewHolderFlag, "Should be equal"); - } - - [Test] - [Category("P1")] - [Description("Test OnDestroyViewHolder. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownListBridge.OnDestroyViewHolder M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void OnDestroyViewHolder_CHECK_VALUE() - { - /* TEST CODE */ - var myDropDownListBridge = new MyDropDownListBridge(); - myDropDownListBridge.TestDestroyViewHolderFlag(); - Assert.AreEqual(true, myDropDownListBridge.destroyViewHolderFlag, "Should be equal"); - } - - } - - public class MyDropDownListBridge : DropDown.DropDownListBridge - { - public bool createViewHolderFlag = false; - public bool bindViewHolderFlag = false; - public bool destroyViewHolderFlag = false; - - public override FlexibleView.ViewHolder OnCreateViewHolder(int viewType) - { - createViewHolderFlag = true; - return base.OnCreateViewHolder(viewType); - } - - public override void OnBindViewHolder(FlexibleView.ViewHolder holder, int position) - { - bindViewHolderFlag = true; - } - - public override void OnDestroyViewHolder(FlexibleView.ViewHolder holder) - { - destroyViewHolderFlag = true; - base.OnDestroyViewHolder(holder); - } - - public void TestOnCreateViewHolder() - { - OnCreateViewHolder(0); - - } - - public void TestOnBindViewHolder() - { - FlexibleView.ViewHolder holder = new FlexibleView.ViewHolder(new BaseComponents.View()); - OnBindViewHolder(holder, 0); - Assert.AreEqual(true, bindViewHolderFlag, "Should be equal"); - } - - public void TestDestroyViewHolderFlag() - { - FlexibleView.ViewHolder holder = new FlexibleView.ViewHolder(new BaseComponents.View()); - OnDestroyViewHolder(holder); - Assert.AreEqual(true, destroyViewHolderFlag, "Should be equal"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSDropDown.ItemClickEventArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSDropDown.ItemClickEventArgs.cs deleted file mode 100755 index c4c170ddd..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSDropDown.ItemClickEventArgs.cs +++ /dev/null @@ -1,81 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.DropDown.ItemClickEventArgs Tests")] - public class DropDownItemClickEventArgsTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("DropDownItemClickEventArgsTests"); - App.MainTitleChangeBackgroundColor(null); - - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test ItemClickEventArgs empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.ItemClickEventArgs.ItemClickEventArgs C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ItemClickEventArgs_CHECK_VALUE() - { - /* TEST CODE */ - var itemClickEventArgs = new DropDown.ItemClickEventArgs(); - Assert.IsNotNull(itemClickEventArgs, "Should be not null!"); - Assert.IsInstanceOf(itemClickEventArgs, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test Index. Check whether Index is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.ItemClickEventArgs.Index A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Index_SET_GET_VALUE() - { - /* TEST CODE */ - var itemClickEventArgs = new DropDown.ItemClickEventArgs(); - itemClickEventArgs.Index = 0; - Assert.AreEqual(0, itemClickEventArgs.Index, "Should be equal"); - } - - [Test] - [Category("P1")] - [Description("Test ItemClickEventArgs.Text. Check whether Text is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.ItemClickEventArgs.Text A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ItemClickEventArgs_Text_SET_GET_VALUE() - { - /* TEST CODE */ - var itemClickEventArgs = new DropDown.ItemClickEventArgs(); - itemClickEventArgs.Text = "text"; - Assert.AreEqual("text", itemClickEventArgs.Text, "Should be equal"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSDropDown.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSDropDown.cs deleted file mode 100755 index 3c4bc7a0a..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSDropDown.cs +++ /dev/null @@ -1,832 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.DropDown Tests")] - public class DropDownTests - { - private const string TAG = "Components"; - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - private static bool _updateFlag = false; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("CommonSwitchTests"); - App.MainTitleChangeBackgroundColor(null); - - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test DropDown empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDown C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void DropDown_CHECK_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - Assert.IsNotNull(dropDown, "Should be not null!"); - Assert.IsInstanceOf(dropDown, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test DropDown style constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDown C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void DropDown_Style_CHECK_VALUE() - { - /* TEST CODE */ - StyleManager.Instance.RegisterStyle("ListSpinnerDropDownStyle", null, typeof(ListSpinnerDropDownStyle)); - var dropDown = new DropDown("ListSpinnerDropDownStyle"); - Assert.IsNotNull(dropDown, "Should be not null!"); - Assert.IsInstanceOf(dropDown, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test var dropDownAttributes constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDown C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "DropDownAttributes")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void DropDown_DropDownAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var attrs = new DropDownAttributes - { - HeaderTextAttributes = new TextAttributes - { - Text = new StringSelector { All = "TitleArea" }, - PointSize = new FloatSelector { All = 28 }, - TextColor = new ColorSelector { All = new Color(0, 0, 0, 1) }, - FontFamily = "SamsungOneUI 500C", - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft, - PivotPoint = Tizen.NUI.PivotPoint.TopLeft, - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent, - HorizontalAlignment = HorizontalAlignment.Center, - VerticalAlignment = VerticalAlignment.Center, - }, - - ButtonAttributes = new ButtonAttributes - { - TextAttributes = new TextAttributes - { - Text = new StringSelector { All = "DropDown Text" }, - PointSize = new FloatSelector { All = 20 }, - TextColor = new ColorSelector { All = new Color(0, 0, 0, 1) }, - FontFamily = "SamsungOneUI 500", - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft, - PivotPoint = Tizen.NUI.PivotPoint.TopLeft, - WidthResizePolicy = ResizePolicyType.UseNaturalSize, - HeightResizePolicy = ResizePolicyType.FillToParent, - Position2D = new Position2D(0, 0), - HorizontalAlignment = HorizontalAlignment.Begin, - VerticalAlignment = VerticalAlignment.Center, - }, - IconAttributes = new ImageAttributes - { - Size2D = new Size2D(48, 48), - ResourceURL = new StringSelector { All = _image_path }, - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.CenterRight, - PivotPoint = Tizen.NUI.PivotPoint.CenterRight, - }, - }, - ListBackgroundImageAttributes = new ImageAttributes - { - ResourceURL = new StringSelector { All = _image_path }, - Border = new RectangleSelector { All = new Rectangle(51, 51, 51, 51) }, - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft, - PivotPoint = Tizen.NUI.PivotPoint.TopLeft, - WidthResizePolicy = ResizePolicyType.FitToChildren, - HeightResizePolicy = ResizePolicyType.FitToChildren, - }, - Space = new Vector4(56, 0, 0, 0), - SpaceBetweenButtonTextAndIcon = 8, - ListMargin = new Vector4(20, 0, 20, 0), - BackgroundColor = new ColorSelector { All = new Color(1, 1, 1, 1) }, - ListSize2D = new Size2D(360, 500), - ListPadding = new Extents(4, 4, 4, 4), - }; - var dropDown = new DropDown(attrs); - Assert.IsNotNull(dropDown, "Should be not null!"); - Assert.IsInstanceOf(dropDown, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test HeaderText. Check whether HeaderText is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.HeaderText A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void HeaderText_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - dropDown.HeaderText = "Test HeaderText"; - Assert.AreEqual("Test HeaderText", dropDown.HeaderText, "Should be equals to the set value of HeaderText"); - } - - [Test] - [Category("P1")] - [Description("Test HeaderTextPointSize. Check whether HeaderTextPointSize is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.HeaderTextPointSize A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void HeaderTextPointSize_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - dropDown.HeaderTextPointSize = 10.0f; - Assert.AreEqual(10.0f, dropDown.HeaderTextPointSize, "Should be equals to the set value of HeaderTextPointSize"); - } - - [Test] - [Category("P1")] - [Description("Test HeaderTextFontFamily. Check whether HeaderTextFontFamily is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.HeaderTextFontFamily A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void HeaderTextFontFamily_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - dropDown.HeaderTextFontFamily = "SamsungOne 500"; - Assert.AreEqual("SamsungOne 500", dropDown.HeaderTextFontFamily, "Should be equals to the set value of HeaderTextFontFamily"); - } - - [Test] - [Category("P1")] - [Description("Test HeaderTextColor. Check whether HeaderTextColor is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.HeaderTextColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void HeaderTextColor_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - var color = new Color(1.0f, 0.0f, 0.0f, 1.0f); - dropDown.HeaderTextColor = color; - - Assert.AreEqual(color.R, dropDown.HeaderTextColor.R, "Should be equals to the color.R set"); - Assert.AreEqual(color.G, dropDown.HeaderTextColor.G, "Should be equals to the color.G set"); - Assert.AreEqual(color.B, dropDown.HeaderTextColor.B, "Should be equals to the color.B set"); - Assert.AreEqual(color.A, dropDown.HeaderTextColor.A, "Should be equals to the color.A set"); - - } - - [Test] - [Category("P1")] - [Description("Test HeaderTextColorSelector. Check whether HeaderTextColorSelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.HeaderTextColorSelector A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void HeaderTextColorSelector_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - var colorSelector = new ColorSelector - { - Normal = new Color(0.0f, 0.0f, 1.0f, 1.0f), - Selected = new Color(0.0f, 1.0f, 0.0f, 1.0f), - }; - - dropDown.HeaderTextColorSelector = colorSelector; - Assert.AreEqual(colorSelector.Normal.R, dropDown.HeaderTextColorSelector.Normal.R, "Should be equals to the set value of HeaderTextColorSelector Normal R"); - Assert.AreEqual(colorSelector.Normal.G, dropDown.HeaderTextColorSelector.Normal.G, "Should be equals to the set value of HeaderTextColorSelector Normal G"); - Assert.AreEqual(colorSelector.Normal.B, dropDown.HeaderTextColorSelector.Normal.B, "Should be equals to the set value of HeaderTextColorSelector Normal B"); - Assert.AreEqual(colorSelector.Normal.A, dropDown.HeaderTextColorSelector.Normal.A, "Should be equals to the set value of HeaderTextColorSelector Normal A"); - - Assert.AreEqual(colorSelector.Selected.R, dropDown.HeaderTextColorSelector.Selected.R, "Should be equals to the set value of HeaderTextColorSelector Selected R"); - Assert.AreEqual(colorSelector.Selected.G, dropDown.HeaderTextColorSelector.Selected.G, "Should be equals to the set value of HeaderTextColorSelector Selected G"); - Assert.AreEqual(colorSelector.Selected.B, dropDown.HeaderTextColorSelector.Selected.B, "Should be equals to the set value of HeaderTextColorSelector Selected B"); - Assert.AreEqual(colorSelector.Selected.A, dropDown.HeaderTextColorSelector.Selected.A, "Should be equals to the set value of HeaderTextColorSelector Selected A"); - } - - [Test] - [Category("P1")] - [Description("Test ButtonText. Check whether ButtonText is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.ButtonText A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ButtonText_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - dropDown.ButtonText = "Test ButtonText"; - Assert.AreEqual("Test ButtonText", dropDown.ButtonText, "Should be equals to the set value of ButtonText"); - } - - [Test] - [Category("P1")] - [Description("Test ButtonTextPointSize. Check whether ButtonTextPointSize is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.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 dropDown = new DropDown(); - dropDown.ButtonTextPointSize = 10.0f; - Assert.AreEqual(10.0f, dropDown.ButtonTextPointSize, "Should be equals to the set value of ButtonTextPointSize"); - } - - [Test] - [Category("P1")] - [Description("Test ButtonTextFontFamily. Check whether ButtonTextFontFamily is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.ButtonTextFontFamily A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ButtonTextFontFamily_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - dropDown.ButtonTextFontFamily = "SamsungOne 500"; - Assert.AreEqual("SamsungOne 500", dropDown.ButtonTextFontFamily, "Should be equals to the set value of HeaderTextFontFamily"); - } - - [Test] - [Category("P1")] - [Description("Test ButtonTextColor. Check whether ButtonTextColor is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.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 dropDown = new DropDown(); - var color = new Color(1.0f, 0.0f, 0.0f, 1.0f); - dropDown.ButtonTextColor = color; - - Assert.AreEqual(color.R, dropDown.ButtonTextColor.R, "Should be equals to the color.R set"); - Assert.AreEqual(color.G, dropDown.ButtonTextColor.G, "Should be equals to the color.G set"); - Assert.AreEqual(color.B, dropDown.ButtonTextColor.B, "Should be equals to the color.B set"); - Assert.AreEqual(color.A, dropDown.ButtonTextColor.A, "Should be equals to the color.A set"); - } - - [Test] - [Category("P1")] - [Description("Test ButtonTextColorSelector. Check whether ButtonTextColorSelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.ButtonTextColorSelector A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ButtonTextColorSelector_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - var colorSelector = new ColorSelector - { - Normal = new Color(0.0f, 0.0f, 1.0f, 1.0f), - Selected = new Color(0.0f, 1.0f, 0.0f, 1.0f), - }; - - dropDown.ButtonTextColorSelector = colorSelector; - Assert.AreEqual(colorSelector.Normal.R, dropDown.ButtonTextColorSelector.Normal.R, "Should be equals to the set value of ButtonTextColorSelector Normal R"); - Assert.AreEqual(colorSelector.Normal.G, dropDown.ButtonTextColorSelector.Normal.G, "Should be equals to the set value of ButtonTextColorSelector Normal G"); - Assert.AreEqual(colorSelector.Normal.B, dropDown.ButtonTextColorSelector.Normal.B, "Should be equals to the set value of ButtonTextColorSelector Normal B"); - Assert.AreEqual(colorSelector.Normal.A, dropDown.ButtonTextColorSelector.Normal.A, "Should be equals to the set value of ButtonTextColorSelector Normal A"); - - Assert.AreEqual(colorSelector.Selected.R, dropDown.ButtonTextColorSelector.Selected.R, "Should be equals to the set value of ButtonTextColorSelector SelectedFocused R"); - Assert.AreEqual(colorSelector.Selected.G, dropDown.ButtonTextColorSelector.Selected.G, "Should be equals to the set value of ButtonTextColorSelector SelectedFocused G"); - Assert.AreEqual(colorSelector.Selected.B, dropDown.ButtonTextColorSelector.Selected.B, "Should be equals to the set value of ButtonTextColorSelector SelectedFocused B"); - Assert.AreEqual(colorSelector.Selected.A, dropDown.ButtonTextColorSelector.Selected.A, "Should be equals to the set value of ButtonTextColorSelector SelectedFocused A"); - } - - [Test] - [Category("P1")] - [Description("Test ButtonIconImageURL. Check whether ButtonIconImageURL is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.ButtonIconImageURL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ButtonIconImageURL_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - dropDown.ButtonIconImageURL = _image_path; - Assert.AreEqual(_image_path, dropDown.ButtonIconImageURL, "Should be equals to the set value of ButtonIconImageURL"); - } - - [Test] - [Category("P1")] - [Description("Test ButtonIconSize2D. Check whether ButtonIconSize2D is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.ButtonIconSize2D A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ButtonIconSize2D_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - dropDown.ButtonIconSize2D = new Size2D(10, 10); - Assert.AreEqual(10, dropDown.ButtonIconSize2D.Width, "Should be equals to the set value of ButtonIconSize2D.Width"); - Assert.AreEqual(10, dropDown.ButtonIconSize2D.Height, "Should be equals to the set value of ButtonIconSize2D.Height"); - } - - [Test] - [Category("P1")] - [Description("Test SpaceBetweenButtonTextAndIcon. Check whether SpaceBetweenButtonTextAndIcon is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.SpaceBetweenButtonTextAndIcon A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void SpaceBetweenButtonTextAndIcon_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - dropDown.SpaceBetweenButtonTextAndIcon = 10; - Assert.AreEqual(10, dropDown.SpaceBetweenButtonTextAndIcon, "Should be equals to the set value of SpaceBetweenButtonTextAndIcon"); - } - - [Test] - [Category("P1")] - [Description("Test LeftSpace. Check whether LeftSpace is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.LeftSpace A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void LeftSpace_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - dropDown.LeftSpace = 10; - Assert.AreEqual(10, dropDown.LeftSpace, "Should be equals to the set value of LeftSpace"); - } - - [Test] - [Category("P1")] - [Description("Test RightSpace. Check whether RightSpace is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.RightSpace A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void RightSpace_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - dropDown.RightSpace = 10; - Assert.AreEqual(10, dropDown.RightSpace, "Should be equals to the set value of RightSpace"); - } - - [Test] - [Category("P1")] - [Description("Test ListBackgroundImageURL. Check whether ListBackgroundImageURL is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.ListBackgroundImageURL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ListBackgroundImageURL_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - dropDown.ListBackgroundImageURL = _image_path; - Assert.AreEqual(_image_path, dropDown.ListBackgroundImageURL, "Should be equals to the set value of ListBackgroundImageURL"); - } - - [Test] - [Category("P1")] - [Description("Test ListBackgroundImageBorder. Check whether ListBackgroundImageBorder is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.ListBackgroundImageBorder A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ListBackgroundImageBorder_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - dropDown.ListBackgroundImageBorder = new Rectangle(0, 0, 10, 10); - Assert.AreEqual(0, dropDown.ListBackgroundImageBorder.X, "Retrieved ListBackgroundImageBorder should be equal to set value"); - Assert.AreEqual(0, dropDown.ListBackgroundImageBorder.Y, "Retrieved ListBackgroundImageBorder should be equal to set value"); - Assert.AreEqual(10, dropDown.ListBackgroundImageBorder.Width, "Retrieved ListBackgroundImageBorder should be equal to set value"); - Assert.AreEqual(10, dropDown.ListBackgroundImageBorder.Height, "Retrieved ListBackgroundImageBorder should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test ListRelativeOrientation. Check whether ListRelativeOrientation is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.ListRelativeOrientation A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ListRelativeOrientation_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - dropDown.ListRelativeOrientation = DropDown.ListOrientation.Left; - Assert.AreEqual(DropDown.ListOrientation.Left, dropDown.ListRelativeOrientation, "Should be equals to the set value of ListRelativeOrientation"); - dropDown.ListRelativeOrientation = DropDown.ListOrientation.Right; - Assert.AreEqual(DropDown.ListOrientation.Right, dropDown.ListRelativeOrientation, "Should be equals to the set value of ListRelativeOrientation"); - } - - [Test] - [Category("P1")] - [Description("Test ListLeftMargin. Check whether ListLeftMargin is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.ListLeftMargin A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ListLeftMargin_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - dropDown.ListLeftMargin = 10; - Assert.AreEqual(10, dropDown.ListLeftMargin, "Should be equals to the set value of ListLeftMargin"); - } - - [Test] - [Category("P1")] - [Description("Test ListRigthMargin. Check whether ListRigthMargin is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.ListRigthMargin A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ListRigthMargin_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - dropDown.ListRigthMargin = 10; - Assert.AreEqual(10, dropDown.ListRigthMargin, "Should be equals to the set value of ListRigthMargin"); - } - - [Test] - [Category("P1")] - [Description("Test ListTopMargin. Check whether ListTopMargin is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.ListTopMargin A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ListTopMargin_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - dropDown.ListTopMargin = 10; - Assert.AreEqual(10, dropDown.ListTopMargin, "Should be equals to the set value of ListTopMargin"); - } - - [Test] - [Category("P1")] - [Description("Test FocusedItemIndex. Check whether FocusedItemIndex is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.FocusedItemIndex A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void FocusedItemIndex_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - dropDown.FocusedItemIndex = 2; - Assert.AreEqual(2, dropDown.FocusedItemIndex, "Should be equals to the set value of FocusedItemIndex"); - } - - [Test] - [Category("P1")] - [Description("Test SelectedItemIndex. Check whether SelectedItemIndex is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.SelectedItemIndex A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void SelectedItemIndex_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - var dropDownItemData = new DropDown.DropDownItemData(); - dropDown.AddItem(dropDownItemData); - var dropDownItemData1 = new DropDown.DropDownItemData(); - dropDown.AddItem(dropDownItemData1); - dropDown.SelectedItemIndex = 1; - Assert.AreEqual(1, dropDown.SelectedItemIndex, "Should be equals to the set value of SelectedItemIndex"); - } - - [Test] - [Category("P1")] - [Description("Test ListSize2D. Check whether ListSize2D is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.ListSize2D A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ListSize2D_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - dropDown.ListSize2D = new Size2D(10, 10); - Assert.AreEqual(10, dropDown.ListSize2D.Width, "Should be equals to the set value of ListSize2D.Width"); - Assert.AreEqual(10, dropDown.ListSize2D.Height, "Should be equals to the set value of ListSize2D.Height"); - } - - [Test] - [Category("P1")] - [Description("Test ListPadding. Check whether ListPadding is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.ListPadding A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ListPadding_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - dropDown.ListPadding = new Extents(10, 10, 10, 10); - Assert.AreEqual(10, dropDown.ListPadding.Start, "Should be equals to the set value of ListPadding.Start"); - Assert.AreEqual(10, dropDown.ListPadding.End, "Should be equals to the set value of ListPadding.End"); - Assert.AreEqual(10, dropDown.ListPadding.Top, "Should be equals to the set value of ListPadding.Top"); - Assert.AreEqual(10, dropDown.ListPadding.Bottom, "Should be equals to the set value of ListPadding.Bottom"); - } - - [Test] - [Category("P1")] - [Description("Test AddItem. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.AddItem M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void AddItem_CHECK_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - var dropDownItemData = new DropDown.DropDownItemData(); - dropDown.AddItem(dropDownItemData); - dropDown.SelectedItemIndex = 0; - - Assert.AreEqual(true, dropDownItemData.IsSelected, "Should be equal"); - } - - [Test] - [Category("P1")] - [Description("Test DeleteItem. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DeleteItem M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void DeleteItem_CHECK_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - var dropDownItemData = new DropDown.DropDownItemData(); - dropDown.AddItem(dropDownItemData); - dropDown.DeleteItem(0); - dropDown.SelectedItemIndex = 0; - - Assert.AreEqual(false, dropDownItemData.IsSelected, "Should be equal"); - } - - [Test] - [Category("P1")] - [Description("Test InsertItem. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.InsertItem M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void InsertItem_CHECK_VALUE() - { - /* TEST CODE */ - var dropDown = new DropDown(); - var dropDownItemData = new DropDown.DropDownItemData(); - dropDown.AddItem(dropDownItemData); - - var dropDownItemData1 = new DropDown.DropDownItemData(); - dropDown.AddItem(dropDownItemData1); - dropDown.SelectedItemIndex = 1; - - var dropDownItemData2 = new DropDown.DropDownItemData(); - dropDown.InsertItem(dropDownItemData2, 0); - - Assert.AreEqual(2, dropDown.SelectedItemIndex, "Should be equal"); - } - - [Test] - [Category("P1")] - [Description("Test AttachScrollBar. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.AttachScrollBar M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void AttachScrollBar_CHECK_VALUE() - { - /* TEST CODE */ - try - { - var dropDown = new DropDown(); - var scrollBar = new ScrollBar(); - dropDown.AttachScrollBar(scrollBar); - } - 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 DetachScrollBar. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.DetachScrollBar M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void DetachScrollBar_CHECK_VALUE() - { - /* TEST CODE */ - try - { - var dropDown = new DropDown(); - var scrollBar = new ScrollBar(); - dropDown.AttachScrollBar(scrollBar); - dropDown.DetachScrollBar(); - } - 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()); - } - } - - public class MyDropDown : DropDown - { - protected override void OnUpdate() - { - _updateFlag = true; - base.OnUpdate(); - } - - protected override Attributes GetAttributes() - { - return base.GetAttributes(); - } - - public Attributes TestGetAttributes() - { - return GetAttributes(); - } - } - - [Test] - [Category("P1")] - [Description("Test OnUpdate. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.OnUpdate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public async Task OnUpdate_CHECK_VALUE() - { - /* TEST CODE */ - _updateFlag = false; - var myDropDown = new MyDropDown(); - myDropDown.Size2D = new Size2D(200, 200); - myDropDown.BackgroundColor = Color.Red; - Window.Instance.Add(myDropDown); - myDropDown.BackgroundColor = Color.Cyan; - await Task.Delay(500); - Assert.AreEqual(true, _updateFlag, "OnUpdate trigger Check Fail."); - Window.Instance.Remove(myDropDown); - } - - [Test] - [Category("P1")] - [Description("Test GetAttributes. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.GetAttributes M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void GetAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var myDropDown = new MyDropDown(); - var attr = myDropDown.TestGetAttributes(); - Assert.IsNotNull(attr, "Should be not null!"); - Assert.IsInstanceOf(attr, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test Dispose, try to dispose the DropDown.")] - [Property("SPEC", "Tizen.NUI.Components.DropDown.Dispose M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Dispose_TEST() - { - /* TEST CODE */ - try - { - DropDown dropDown = new DropDown(); - dropDown.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()); - } - } - - public class ListSpinnerDropDownStyle : StyleBase - { - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - protected override Attributes GetAttributes() - { - DropDownAttributes attributes = new DropDownAttributes - { - HeaderTextAttributes = new TextAttributes - { - PointSize = new FloatSelector { All = 28 }, - TextColor = new ColorSelector { All = new Color(0, 0, 0, 1) }, - FontFamily = "SamsungOneUI 500C", - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft, - PivotPoint = Tizen.NUI.PivotPoint.TopLeft, - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent, - HorizontalAlignment = HorizontalAlignment.Begin, - VerticalAlignment = VerticalAlignment.Center, - Position2D = new Position2D(56, 0), - }, - - ButtonAttributes = new ButtonAttributes - { - TextAttributes = new TextAttributes - { - PointSize = new FloatSelector { All = 20 }, - TextColor = new ColorSelector { All = new Color(0, 0, 0, 1) }, - FontFamily = "SamsungOneUI 500", - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft, - PivotPoint = Tizen.NUI.PivotPoint.TopLeft, - WidthResizePolicy = ResizePolicyType.UseNaturalSize, - HeightResizePolicy = ResizePolicyType.FillToParent, - Position2D = new Position2D(0, 0), - HorizontalAlignment = HorizontalAlignment.Begin, - VerticalAlignment = VerticalAlignment.Center, - }, - IconAttributes = new ImageAttributes - { - Size2D = new Size2D(48, 48), - ResourceURL = new StringSelector { All = _image_path }, - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.CenterRight, - PivotPoint = Tizen.NUI.PivotPoint.CenterRight, - }, - }, - ListBackgroundImageAttributes = new ImageAttributes - { - ResourceURL = new StringSelector { All = _image_path }, - Border = new RectangleSelector { All = new Rectangle(51, 51, 51, 51) }, - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft, - PivotPoint = Tizen.NUI.PivotPoint.TopLeft, - WidthResizePolicy = ResizePolicyType.FitToChildren, - HeightResizePolicy = ResizePolicyType.FitToChildren, - }, - Space = new Vector4(900, 0, 0, 0), - SpaceBetweenButtonTextAndIcon = 8, - ListMargin = new Vector4(0, 20, 20, 0), - BackgroundColor = new ColorSelector { All = new Color(1, 1, 1, 1) }, - ListPadding = new Extents(4, 4, 4, 4), - ListRelativeOrientation = DropDown.ListOrientation.Right, - }; - return attributes; - } - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSDropDownAttributes.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSDropDownAttributes.cs deleted file mode 100755 index 0d404ed3e..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSDropDownAttributes.cs +++ /dev/null @@ -1,471 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.DropDownAttributes Tests")] - public class DropDownAttributesTests - { - private const string TAG = "Components"; - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("ButtonAttributesTests"); - App.MainTitleChangeBackgroundColor(null); - - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test DropDownAttributes empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.DropDownAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void DropDownAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var dropDownAttributes = new DropDownAttributes(); - Assert.IsNotNull(dropDownAttributes, "Should be not null!"); - Assert.IsInstanceOf(dropDownAttributes, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test DropDownAttributes copy constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.DropDownAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "DropDownAttributes")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void DropDownAttributes_DropDownAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var attrs = new DropDownAttributes - { - HeaderTextAttributes = new TextAttributes - { - Text = new StringSelector { All = "TitleArea" }, - PointSize = new FloatSelector { All = 28 }, - TextColor = new ColorSelector { All = new Color(0, 0, 0, 1) }, - FontFamily = "SamsungOneUI 500C", - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft, - PivotPoint = Tizen.NUI.PivotPoint.TopLeft, - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent, - HorizontalAlignment = HorizontalAlignment.Center, - VerticalAlignment = VerticalAlignment.Center, - }, - - ButtonAttributes = new ButtonAttributes - { - TextAttributes = new TextAttributes - { - Text = new StringSelector { All = "DropDown Text" }, - PointSize = new FloatSelector { All = 20 }, - TextColor = new ColorSelector { All = new Color(0, 0, 0, 1) }, - FontFamily = "SamsungOneUI 500", - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft, - PivotPoint = Tizen.NUI.PivotPoint.TopLeft, - WidthResizePolicy = ResizePolicyType.UseNaturalSize, - HeightResizePolicy = ResizePolicyType.FillToParent, - Position2D = new Position2D(0, 0), - HorizontalAlignment = HorizontalAlignment.Begin, - VerticalAlignment = VerticalAlignment.Center, - }, - IconAttributes = new ImageAttributes - { - Size2D = new Size2D(48, 48), - ResourceURL = new StringSelector { All = _image_path }, - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.CenterRight, - PivotPoint = Tizen.NUI.PivotPoint.CenterRight, - }, - }, - ListBackgroundImageAttributes = new ImageAttributes - { - ResourceURL = new StringSelector { All = _image_path }, - Border = new RectangleSelector { All = new Rectangle(51, 51, 51, 51) }, - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft, - PivotPoint = Tizen.NUI.PivotPoint.TopLeft, - WidthResizePolicy = ResizePolicyType.FitToChildren, - HeightResizePolicy = ResizePolicyType.FitToChildren, - }, - Space = new Vector4(56, 0, 0, 0), - SpaceBetweenButtonTextAndIcon = 8, - ListMargin = new Vector4(20, 0, 20, 0), - BackgroundColor = new ColorSelector { All = new Color(1, 1, 1, 1) }, - ListSize2D = new Size2D(360, 500), - ListPadding = new Extents(4, 4, 4, 4), - }; - var dropDownAttributes = new DropDownAttributes(attrs); - Assert.IsNotNull(dropDownAttributes, "Should be not null!"); - Assert.IsInstanceOf(dropDownAttributes, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test ButtonAttributes. Check whether ButtonAttributes is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.ButtonAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ButtonAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownAttributes = new DropDownAttributes(); - dropDownAttributes.ButtonAttributes = new ButtonAttributes(); - Assert.IsNotNull(dropDownAttributes.ButtonAttributes, "Should be not null!"); - Assert.IsInstanceOf(dropDownAttributes.ButtonAttributes, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test HeaderTextAttributes. Check whether HeaderTextAttributes is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.HeaderTextAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void HeaderTextAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownAttributes = new DropDownAttributes(); - dropDownAttributes.HeaderTextAttributes = new TextAttributes(); - Assert.IsNotNull(dropDownAttributes.HeaderTextAttributes, "Should be not null!"); - Assert.IsInstanceOf(dropDownAttributes.HeaderTextAttributes, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test SpaceBetweenButtonTextAndIcon. Check whether SpaceBetweenButtonTextAndIcon is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.SpaceBetweenButtonTextAndIcon A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void SpaceBetweenButtonTextAndIcon_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownAttributes = new DropDownAttributes(); - dropDownAttributes.SpaceBetweenButtonTextAndIcon = 10; - - Assert.AreEqual(10, dropDownAttributes.SpaceBetweenButtonTextAndIcon, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test ListBackgroundImageAttributes. Check whether ListBackgroundImageAttributes is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.ListBackgroundImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ListBackgroundImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownAttributes = new DropDownAttributes(); - dropDownAttributes.ListBackgroundImageAttributes = new ImageAttributes(); - Assert.IsNotNull(dropDownAttributes.ListBackgroundImageAttributes, "Should be not null!"); - Assert.IsInstanceOf(dropDownAttributes.ListBackgroundImageAttributes, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test Space. Check whether Space is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.Space A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Space_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownAttributes = new DropDownAttributes(); - dropDownAttributes.Space = new Vector4(10, 10, 10, 10); - - Assert.AreEqual(10, dropDownAttributes.Space.X, "Should be equals!"); - Assert.AreEqual(10, dropDownAttributes.Space.Y, "Should be equals!"); - Assert.AreEqual(10, dropDownAttributes.Space.Z, "Should be equals!"); - Assert.AreEqual(10, dropDownAttributes.Space.W, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test ListRelativeOrientation. Check whether ListRelativeOrientation is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.ListRelativeOrientation A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ListRelativeOrientation_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownAttributes = new DropDownAttributes(); - dropDownAttributes.ListRelativeOrientation = DropDown.ListOrientation.Left; - Assert.AreEqual(DropDown.ListOrientation.Left, dropDownAttributes.ListRelativeOrientation, "Should be equals!"); - - dropDownAttributes.ListRelativeOrientation = DropDown.ListOrientation.Right; - Assert.AreEqual(DropDown.ListOrientation.Right, dropDownAttributes.ListRelativeOrientation, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test ListMargin. Check whether ListMargin is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.ListMargin A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ListMargin_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownAttributes = new DropDownAttributes(); - dropDownAttributes.ListMargin = new Vector4(10, 10, 10, 10); - - Assert.AreEqual(10, dropDownAttributes.ListMargin.X, "Should be equals!"); - Assert.AreEqual(10, dropDownAttributes.ListMargin.Y, "Should be equals!"); - Assert.AreEqual(10, dropDownAttributes.ListMargin.Z, "Should be equals!"); - Assert.AreEqual(10, dropDownAttributes.ListMargin.W, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test FocusedItemIndex. Check whether FocusedItemIndex is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.FocusedItemIndex A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void FocusedItemIndex_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownAttributes = new DropDownAttributes(); - dropDownAttributes.FocusedItemIndex = 1; - - Assert.AreEqual(1, dropDownAttributes.FocusedItemIndex, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test ListSize2D. Check whether ListSize2D is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.ListSize2D A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ListSize2D_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownAttributes = new DropDownAttributes(); - dropDownAttributes.ListSize2D = new Size2D(10, 10); - - Assert.AreEqual(10, dropDownAttributes.ListSize2D.Width, "Should be equals!"); - Assert.AreEqual(10, dropDownAttributes.ListSize2D.Height, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test ListPadding. Check whether ListPadding is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.ListPadding A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ListPadding_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownAttributes = new DropDownAttributes(); - dropDownAttributes.ListPadding = new Extents(10, 10, 10, 10); - - Assert.AreEqual(10, dropDownAttributes.ListPadding.Start, "Should be equals!"); - Assert.AreEqual(10, dropDownAttributes.ListPadding.End, "Should be equals!"); - Assert.AreEqual(10, dropDownAttributes.ListPadding.Top, "Should be equals!"); - Assert.AreEqual(10, dropDownAttributes.ListPadding.Bottom, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Clone_CHECK_VALUE() - { - var dropDownAttributes = new DropDownAttributes(); - dropDownAttributes.SpaceBetweenButtonTextAndIcon = 10; - var attr = dropDownAttributes.Clone() as DropDownAttributes; - Assert.IsNotNull(attr, "Should be not null!"); - Assert.IsInstanceOf(attr, "Should be equals!"); - Assert.AreEqual(10, attr.SpaceBetweenButtonTextAndIcon, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test DropDownItemAttributes empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDownItemAttributes.DropDownItemAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void DropDownItemAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var dropDownItemAttributes = new DropDownItemAttributes(); - Assert.IsNotNull(dropDownItemAttributes, "Should be not null!"); - Assert.IsInstanceOf(dropDownItemAttributes, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test DropDownItemAttributes copy constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDownItemAttributes.DropDownItemAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "DropDownItemAttributes")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void DropDownItemAttributes_DropDownItemAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var itemAttrs = new DropDownItemAttributes - { - BackgroundColor = new ColorSelector - { - Pressed = new Color(0, 0, 0, 0.4f), - Other = new Color(1, 1, 1, 0), - }, - TextAttributes = new TextAttributes - { - PointSize = new FloatSelector { All = 18 }, - FontFamily = "SamsungOne 500", - Position2D = new Position2D(28, 0), - }, - CheckImageAttributes = new ImageAttributes - { - Size2D = new Size2D(40, 40), - ResourceURL = new StringSelector { All = _image_path }, - }, - CheckImageRightSpace = 16, - }; - var dropDownItemAttributes = new DropDownItemAttributes(itemAttrs); - Assert.IsNotNull(dropDownItemAttributes, "Should be not null!"); - Assert.IsInstanceOf(dropDownItemAttributes, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test TextAttributes. Check whether TextAttributes is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDownItemAttributes.TextAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TextAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownItemAttributes = new DropDownItemAttributes(); - dropDownItemAttributes.TextAttributes = new TextAttributes(); - Assert.IsNotNull(dropDownItemAttributes.TextAttributes, "Should be not null!"); - Assert.IsInstanceOf(dropDownItemAttributes.TextAttributes, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test IconAttributes. Check whether IconAttributes is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDownItemAttributes.IconAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IconAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownItemAttributes = new DropDownItemAttributes(); - dropDownItemAttributes.IconAttributes = new ImageAttributes(); - Assert.IsNotNull(dropDownItemAttributes.IconAttributes, "Should be not null!"); - Assert.IsInstanceOf(dropDownItemAttributes.IconAttributes, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test CheckImageAttributes. Check whether CheckImageAttributes is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDownItemAttributes.CheckImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownItemAttributes = new DropDownItemAttributes(); - dropDownItemAttributes.CheckImageAttributes = new ImageAttributes(); - Assert.IsNotNull(dropDownItemAttributes.CheckImageAttributes, "Should be not null!"); - Assert.IsInstanceOf(dropDownItemAttributes.CheckImageAttributes, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test CheckImageRightSpace. Check whether CheckImageRightSpace is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDownItemAttributes.CheckImageRightSpace A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckImageRightSpace_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownItemAttributes = new DropDownItemAttributes(); - dropDownItemAttributes.CheckImageRightSpace = 10; - - Assert.AreEqual(10, dropDownItemAttributes.CheckImageRightSpace, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test IsSelected. Check whether IsSelected is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.DropDownItemAttributes.IsSelected A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IsSelected_SET_GET_VALUE() - { - /* TEST CODE */ - var dropDownItemAttributes = new DropDownItemAttributes(); - dropDownItemAttributes.IsSelected = true; - Assert.AreEqual(true, dropDownItemAttributes.IsSelected, "Should be equals!"); - dropDownItemAttributes.IsSelected = false; - Assert.AreEqual(false, dropDownItemAttributes.IsSelected, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.DropDownItemAttributes.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void DropDownItemAttributes_Clone_CHECK_VALUE() - { - - var dropDownItemAttributes = new DropDownItemAttributes(); - var attr = dropDownItemAttributes.Clone(); - Assert.IsNotNull(attr, "Should be not null!"); - Assert.IsInstanceOf(attr, "Should be equals!"); - - } - - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexiableView.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexiableView.cs deleted file mode 100755 index b93c1dd96..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexiableView.cs +++ /dev/null @@ -1,721 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Threading.Tasks; -using System.Collections.Generic; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.FlexibleView Tests")] - public class FlexibleViewTests - { - private string TAG = "NUI.Components.FlexibleView"; - private FlexibleView _flexibleView = null; - private ListBridge _adapter = null; - private FlexibleView.LayoutManager _layoutManager = null; - private string _trackImageUrl = ""; - private bool _styleChanged = false; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("FlexibleViewTests"); - App.MainTitleChangeBackgroundColor(null); - - CreateFlexiableView(); - - } - - public void CreateFlexiableView() - { - _flexibleView = new FlexibleView(); - _flexibleView.Name = "RecyclerView"; - _flexibleView.Position2D = new Position2D(500, 200); - _flexibleView.Size2D = new Size2D(400, 450); - _flexibleView.Padding = new Extents(10, 10, 10, 10); - _flexibleView.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.4f); - _flexibleView.Focusable = true; - - List dataList = new List(); - for (int i = 0; i < 132; ++i) - { - dataList.Add(new ListItemData(i)); - } - _adapter = new ListBridge(dataList); - _flexibleView.SetAdapter(_adapter); - _layoutManager = new LinearLayoutManager(LinearLayoutManager.VERTICAL); - _flexibleView.SetLayoutManager(_layoutManager); - - Window.Instance.Add(_flexibleView); - FocusManager.Instance.SetCurrentFocusView(_flexibleView); - _flexibleView.FocusedItemIndex = 0; - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - Window.Instance.Remove(_flexibleView); - _flexibleView.Dispose(); - _flexibleView = null; - } - - [Test] - [Category("P1")] - [Description("Create a FlexiableView object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.FlexibleView C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void FlexibleView_INIT() - { - /* TEST CODE */ - var flexibleView1 = new FlexibleView(); - Assert.IsNotNull(flexibleView1, "Can't create success object FlexibleView"); - Assert.IsInstanceOf(flexibleView1, "Should be an instance of FlexibleView type."); - } - - [Test] - [Category("P1")] - [Description("Test NO_POSITION.Check whether NO_POSITION is readable.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.NO_POSITION A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void NO_POSITION_GET_VALUE() - { - /* TEST CODE */ - Assert.AreEqual(-1, FlexibleView.NO_POSITION, "Should be equals to the set value of NO_POSITION."); - } - - [Test] - [Category("P1")] - [Description("Test INVALID_TYPE.Check whether INVALID_TYPE is readable.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.INVALID_TYPE A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void INVALID_TYPE_GET_VALUE() - { - /* TEST CODE */ - Assert.AreEqual(-1, FlexibleView.INVALID_TYPE, "Should be equals to the set value of INVALID_TYPE."); - } - - [Test] - [Category("P1")] - [Description("Test FocusedItemIndex.Check whether FocusedItemIndex is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.FocusedItemIndex A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void FocusedItemIndex_SET_GET_VALUE() - { - /* TEST CODE */ - _flexibleView.FocusedItemIndex = 1; - _flexibleView.Relayout += FocusedItemIndexRelayout; - _flexibleView.Relayout -= FocusedItemIndexRelayout; - } - - private void FocusedItemIndexRelayout(object sender, EventArgs args) - { - Assert.AreEqual(1, _flexibleView.FocusedItemIndex, "Should be equals to the set value of FocusedItemIndex."); - } - - [Test] - [Category("P1")] - [Description("Test Padding.Check whether Padding is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Padding A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Padding_SET_GET_VALUE() - { - /* TEST CODE */ - _flexibleView.Padding = new Extents(10, 10, 10, 10); - Assert.AreEqual(10, _flexibleView.Padding.Start, "Should be equals to the set value."); - Assert.AreEqual(10, _flexibleView.Padding.End, "Should be equals to the set value."); - Assert.AreEqual(10, _flexibleView.Padding.Top, "Should be equals to the set value."); - Assert.AreEqual(10, _flexibleView.Padding.Bottom, "Should be equals to the set value."); - } - - [Test] - [Category("P1")] - [Description("Test AttachScrollBar.Check whether AttachScrollBar works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.AttachScrollBar M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void AttachScrollBar_TEST() - { - /* TEST CODE */ - var scrollBar1 = new ScrollBar(); - scrollBar1.Direction = ScrollBar.DirectionType.Vertical; - scrollBar1.Position2D = new Position2D(394, 2); - scrollBar1.Size2D = new Size2D(4, 446); - scrollBar1.TrackColor = Color.Green; - scrollBar1.ThumbSize = new Size2D(4, 30); - scrollBar1.ThumbColor = Color.Yellow; - scrollBar1.TrackImageURL = _trackImageUrl; - try - { - _flexibleView.AttachScrollBar(scrollBar1); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test DetachScrollBar.Check whether DetachScrollBar works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.DetachScrollBar M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void DetachScrollBar_TEST() - { - /* TEST CODE */ - try - { - _flexibleView.DetachScrollBar(); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test FindViewHolderForAdapterPosition.Check whether FindViewHolderForAdapterPosition works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.FindViewHolderForAdapterPosition M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void FindViewHolderForAdapterPosition_TEST() - { - /* TEST CODE */ - try - { - for (int i = 0; i < 20; i++) - { - _flexibleView.MoveFocus(FlexibleView.LayoutManager.Direction.Down); - } - _flexibleView.Relayout += FindViewHolderForAdapterPositionRelayout; - _flexibleView.Relayout -= FindViewHolderForAdapterPositionRelayout; - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - private void FindViewHolderForAdapterPositionRelayout(object sender, EventArgs args) - { - var viewHolder = _flexibleView.FindViewHolderForAdapterPosition(0); - Assert.IsNotNull(viewHolder, "Can't get the viewHolder!"); - Assert.IsInstanceOf(viewHolder, "Should be instance of FlexibleView.ViewHolder"); - } - - [Test] - [Category("P1")] - [Description("Test FindViewHolderForLayoutPosition.Check whether FindViewHolderForLayoutPosition works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.FindViewHolderForLayoutPosition M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void FindViewHolderForLayoutPosition_TEST() - { - /* TEST CODE */ - try - { - for (int i = 0; i < 20; i++) - { - _flexibleView.MoveFocus(FlexibleView.LayoutManager.Direction.Down); - } - _flexibleView.Relayout += FindViewHolderForLayoutPositionRelayout; - _flexibleView.Relayout -= FindViewHolderForLayoutPositionRelayout; - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - private void FindViewHolderForLayoutPositionRelayout(object sender, EventArgs args) - { - var viewHolder = _flexibleView.FindViewHolderForLayoutPosition(0); - Assert.IsNotNull(viewHolder, "Can't get the viewHolder!"); - Assert.IsInstanceOf(viewHolder, "Should be instance of FlexibleView.ViewHolder"); - } - - [Test] - [Category("P1")] - [Description("Test GetAdapter.Check whether GetAdapter works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.GetAdapter M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetAdapter_TEST() - { - /* TEST CODE */ - try - { - var adapter = _flexibleView.GetAdapter(); - Assert.IsNotNull(adapter, "Can't get the adapter!"); - Assert.IsInstanceOf(adapter, "Should be instance of FlexibleView.Adapter"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test GetRecycler.Check whether GetRecycler works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.GetRecycler M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetRecycler_TEST() - { - /* TEST CODE */ - try - { - var recycler = _flexibleView.GetRecycler(); - Assert.IsNotNull(recycler, "Can't get the recycler!"); - Assert.IsInstanceOf(recycler, "Should be instance of FlexibleView.Recycler"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test GetLayoutManager.Check whether GetLayoutManager works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.GetLayoutManager M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetLayoutManager_TEST() - { - /* TEST CODE */ - try - { - var layoutManager = _flexibleView.GetLayoutManager(); - Assert.IsNotNull(layoutManager, "Can't get the layoutManager!"); - Assert.IsInstanceOf(layoutManager, "Should be instance of LayoutManager.Adapter"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test MoveFocus.Check whether MoveFocus works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.MoveFocus M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void MoveFocus_TEST() - { - /* TEST CODE */ - try - { - _flexibleView.MoveFocus(FlexibleView.LayoutManager.Direction.Down); - _flexibleView.MoveFocus(FlexibleView.LayoutManager.Direction.Up); - _flexibleView.MoveFocus(FlexibleView.LayoutManager.Direction.Left); - _flexibleView.MoveFocus(FlexibleView.LayoutManager.Direction.Right); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test ScrollToPositionWithOffset.Check whether ScrollToPositionWithOffset works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.ScrollToPositionWithOffset M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ScrollToPositionWithOffset_TEST() - { - /* TEST CODE */ - try - { - _flexibleView.ScrollToPositionWithOffset(2, 0); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test SetAdapter.Check whether SetAdapter works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.SetAdapter M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void SetAdapter_TEST() - { - /* TEST CODE */ - try - { - _flexibleView.SetAdapter(_adapter); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test SetLayoutManager.Check whether SetLayoutManager works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.SetLayoutManager M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void SetLayoutManager_TEST() - { - /* TEST CODE */ - try - { - var hLayoutManager = new LinearLayoutManager(LinearLayoutManager.HORIZONTAL); - _flexibleView.SetLayoutManager(hLayoutManager); - var vLayoutManager = new LinearLayoutManager(LinearLayoutManager.VERTICAL); - _flexibleView.SetLayoutManager(vLayoutManager); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test GetAttributes.Check whether GetAttributes works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.GetAttributes M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetAttributes_TEST() - { - /* TEST CODE */ - try - { - var myFlexibleView = new MyFlexibleView(); - var attr = myFlexibleView.TestGetAttributes(); - Assert.IsNull(attr, "Should be null, because there is no attributes for FlexibleView!"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test OnRelayout. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.OnRelayout M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public async Task OnRelayout_CHECK_VALUE() - { - /* TEST CODE */ - try - { - var view = new MyFlexibleView(); - Window window = Window.Instance; - window.Add(view); - await Task.Delay(500); - Assert.AreEqual(true, view._relayoutFlag, "OnRelayout trigger Check Fail."); - window.Remove(view); - } - catch (Exception e) - { - Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test OnStyleChange. Check whether OnStyleChange works or not!")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.OnStyleChange M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OnStyleChange_CHECK_VALUE() - { - /* TEST CODE */ - try - { - _flexibleView.OnStyleChange(NUI.StyleManager.Instance, StyleChangeType.ThemeChange); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test StyleChanged. Check whether StyleChanged works or not!")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.StyleChanged E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public async Task StyleChanged_CHECK_VALUE() - { - /* TEST CODE */ - try - { - _flexibleView.StyleChanged += StyleChange; - _flexibleView.OnStyleChange(NUI.StyleManager.Instance, StyleChangeType.DefaultFontSizeChange); - await Task.Delay(500); - Assert.IsTrue(_styleChanged, "Should be true!"); - _flexibleView.StyleChanged -= StyleChange; - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Dispose, try to dispose the FlexibleView.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Dispose M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Dispose_TEST() - { - /* TEST CODE */ - try - { - FlexibleView flexibleView = new FlexibleView(); - var hLayoutManager = new LinearLayoutManager(LinearLayoutManager.HORIZONTAL); - flexibleView.SetLayoutManager(hLayoutManager); - flexibleView.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()); - } - } - - private void StyleChange(object sender, NUI.StyleManager.StyleChangedEventArgs args) - { - _styleChanged = true; - } - } - - public class ListItemData - { - private string _str; - - public ListItemData(int i) - { - _str = "Text" + i.ToString(); - } - - public string TextString - { - get - { - return _str; - } - } - } - - public class ListItemView : View - { - private TextLabel _mText; - - public ListItemView() - { - _mText = new TextLabel(); - _mText.WidthResizePolicy = ResizePolicyType.FillToParent; - _mText.HeightResizePolicy = ResizePolicyType.FillToParent; - _mText.PointSize = 22; - _mText.HorizontalAlignment = HorizontalAlignment.Center; - _mText.VerticalAlignment = VerticalAlignment.Center; - Add(_mText); - } - - public string MainText - { - get - { - return _mText.Text; - } - set - { - _mText.Text = value; - } - } - } - - public class MyFlexibleView : FlexibleView - { - public bool _relayoutFlag = false; - - protected override Attributes GetAttributes() - { - return base.GetAttributes(); - } - - public Attributes TestGetAttributes() - { - return GetAttributes(); - } - - public override void OnRelayout(Vector2 size, RelayoutContainer container) - { - _relayoutFlag = true; - base.OnRelayout(size, container); - } - } - - public class ListBridge : FlexibleView.Adapter - { - private List _mDatas; - - public ListBridge(List datas) - { - _mDatas = datas; - } - - public void InsertData(int position) - { - _mDatas.Insert(position, new ListItemData(1000 + position)); - NotifyItemInserted(position); - } - - public void RemoveData(int position) - { - _mDatas.RemoveAt(position); - NotifyItemRemoved(position); - } - - public override int GetItemViewType(int position) - { - return 1; - } - - public override FlexibleView.ViewHolder OnCreateViewHolder(int viewType) - { - FlexibleView.ViewHolder viewHolder = new FlexibleView.ViewHolder(new ListItemView()); - //Console.WriteLine($"OnCreateViewHolder... viewType: {viewType} viewID: {viewHolder.ItemView.ID}"); - - return viewHolder; - } - - public override void OnAttachedToRecyclerView(FlexibleView flexibleView) - { - - } - public override void OnBindViewHolder(FlexibleView.ViewHolder holder, int position) - { - //Console.WriteLine($"OnBindItemView... position: {position}"); - ListItemData listItemData = _mDatas[position]; - - ListItemView listItemView = holder.ItemView as ListItemView; - listItemView.Name = "Item" + position; - //Random rd = new Random(); - listItemView.SizeWidth = 150; - listItemView.SizeHeight = 60; - if (listItemView != null) - { - listItemView.MainText = String.Format("{0:D2}", position) + " : " + listItemData.TextString; - } - listItemView.Margin = new Extents(2, 2, 2, 2); - if (position % 2 == 0) - listItemView.BackgroundColor = Color.Cyan; - else - listItemView.BackgroundColor = Color.Yellow; - } - - public override void OnDestroyViewHolder(FlexibleView.ViewHolder holder) - { - //Console.WriteLine($"OnDestroyViewHolder... viewID: {holder.ItemView?.ID}"); - if (holder.ItemView != null) - { - holder.ItemView.Dispose(); - } - } - - public override void OnDetachedFromRecyclerView(FlexibleView flexibleView) - { - - } - - public override int GetItemCount() - { - return _mDatas.Count; - } - - public override void OnFocusChange(FlexibleView flexibleView, int previousFocus, int currentFocus) - { - FlexibleView.ViewHolder previousFocusView = flexibleView.FindViewHolderForAdapterPosition(previousFocus); - if (previousFocusView != null) - { - //Console.WriteLine($"previousFocus {previousFocus.AdapterPosition}"); - if (previousFocusView.AdapterPosition % 2 == 0) - previousFocusView.ItemView.BackgroundColor = Color.Cyan; - else - previousFocusView.ItemView.BackgroundColor = Color.Yellow; - //previousFocus.SizeWidth = 150; - //previousFocus.SizeHeight = 60; - //NotifyItemChanged(previousFocus.AdapterPosition); - } - FlexibleView.ViewHolder currentFocusView = flexibleView.FindViewHolderForAdapterPosition(currentFocus); - if (currentFocusView != null) - { - //Console.WriteLine($"currentFocus {currentFocus.AdapterPosition}"); - currentFocusView.ItemView.BackgroundColor = Color.Magenta; - //currentFocus.SizeWidth = 200; - //currentFocus.SizeHeight = 100; - //NotifyItemChanged(currentFocus.AdapterPosition); - } - } - - public override void OnViewAttachedToWindow(FlexibleView.ViewHolder holder) - { - //Console.WriteLine($"+Attached: {holder.AdapterPosition}"); - } - - public override void OnViewDetachedFromWindow(FlexibleView.ViewHolder holder) - { - //Console.WriteLine($" --Detached: {holder.AdapterPosition}"); - } - - public override void OnViewRecycled(FlexibleView.ViewHolder holder) - { - - } - - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexibleView.Adapter.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexibleView.Adapter.cs deleted file mode 100755 index c3f263503..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexibleView.Adapter.cs +++ /dev/null @@ -1,451 +0,0 @@ -using NUnit.Framework; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Collections.Generic; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.FlexibleView.Adapter Tests")] - public class FlexibleViewAdapterTests - { - private const string TAG = "NUI.Components"; - private FlexibleView _flexibleView = null; - private ListBridge _adapter = null; - private const int COUNT = 132; - private FlexibleView.LayoutManager _layoutManager = null; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("ScrollBarTests"); - App.MainTitleChangeBackgroundColor(null); - CreateFlexiableView(); - } - - public void CreateFlexiableView() - { - _flexibleView = new FlexibleView(); - _flexibleView.Name = "RecyclerView"; - _flexibleView.Position2D = new Position2D(500, 200); - _flexibleView.Size2D = new Size2D(400, 450); - _flexibleView.Padding = new Extents(10, 10, 10, 10); - _flexibleView.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.4f); - _flexibleView.Focusable = true; - - List dataList = new List(); - for (int i = 0; i < COUNT; ++i) - { - dataList.Add(new ListItemData(i)); - } - _adapter = new ListBridge(dataList); - _flexibleView.SetAdapter(_adapter); - _layoutManager = new LinearLayoutManager(LinearLayoutManager.VERTICAL); - _flexibleView.SetLayoutManager(_layoutManager); - - Window.Instance.Add(_flexibleView); - FocusManager.Instance.SetCurrentFocusView(_flexibleView); - _flexibleView.FocusedItemIndex = 0; - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - Window.Instance.Remove(_flexibleView); - _flexibleView.Dispose(); - _flexibleView = null; - } - - [Test] - [Category("P1")] - [Description("Create a Adapter object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Adapter.Adapter C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Adapter_INIT() - { - /* TEST CODE */ - List dataList = new List(); - for (int i = 0; i < 131; ++i) - { - dataList.Add(new ListItemData(i)); - } - var adapter = new ListBridge(dataList); - Assert.IsNotNull(adapter, "Can't create success object Adapter"); - Assert.IsInstanceOf(adapter, "Should be an instance of Adapter"); - } - - [Test] - [Category("P1")] - [Description("Test GetItemCount. Check whether GetItemCount works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Adapter.GetItemCount M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetItemCount_TEST() - { - /* TEST CODE */ - Assert.AreEqual(COUNT, _adapter.GetItemCount(), "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test GetItemViewType. Check whether GetItemViewType works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Adapter.GetItemViewType M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetItemViewType_TEST() - { - /* TEST CODE */ - Assert.AreEqual(1, _adapter.GetItemViewType(0), "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test OnFocusChange. Check whether OnFocusChange works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Adapter.OnFocusChange M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OnFocusChange_TEST() - { - /* TEST CODE */ - try - { - _adapter.OnFocusChange(_flexibleView, 0, 1); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test NotifyDataSetChanged. Check whether NotifyDataSetChanged works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Adapter.NotifyDataSetChanged M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void NotifyDataSetChanged_TEST() - { - /* TEST CODE */ - try - { - _adapter.NotifyDataSetChanged(); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test NotifyItemChanged. Check whether NotifyItemChanged works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Adapter.NotifyItemChanged M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void NotifyItemChanged_TEST() - { - /* TEST CODE */ - try - { - _adapter.NotifyItemChanged(0); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test NotifyItemInserted. Check whether NotifyItemInserted works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Adapter.NotifyItemInserted M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void NotifyItemInserted_TEST() - { - /* TEST CODE */ - try - { - _adapter.NotifyItemInserted(0); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test NotifyItemMoved. Check whether NotifyItemMoved works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Adapter.NotifyItemMoved M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void NotifyItemMoved_TEST() - { - /* TEST CODE */ - try - { - _adapter.NotifyItemMoved(0, 1); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test NotifyItemRangeChanged. Check whether NotifyItemRangeChanged works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Adapter.NotifyItemRangeChanged M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void NotifyItemRangeChanged_TEST() - { - /* TEST CODE */ - try - { - _adapter.NotifyItemRangeChanged(0, 1); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test NotifyItemRangeInserted. Check whether NotifyItemRangeInserted works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Adapter.NotifyItemRangeInserted M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void NotifyItemRangeInserted_TEST() - { - /* TEST CODE */ - try - { - _adapter.NotifyItemRangeInserted(0, 1); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test NotifyItemRangeRemoved. Check whether NotifyItemRangeRemoved works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Adapter.NotifyItemRangeRemoved M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void NotifyItemRangeRemoved_TEST() - { - /* TEST CODE */ - try - { - _adapter.NotifyItemRangeRemoved(0, 1); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test NotifyItemRemoved. Check whether NotifyItemRemoved works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Adapter.NotifyItemRemoved M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void NotifyItemRemoved_TEST() - { - /* TEST CODE */ - try - { - _adapter.NotifyItemRemoved(0); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test OnAttachedToRecyclerView. Check whether OnAttachedToRecyclerView works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Adapter.OnAttachedToRecyclerView M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OnAttachedToRecyclerView_TEST() - { - /* TEST CODE */ - try - { - _adapter.OnAttachedToRecyclerView(_flexibleView); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test OnBindViewHolder. Check whether OnBindViewHolder works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Adapter.OnBindViewHolder M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OnBindViewHolder_TEST() - { - /* TEST CODE */ - try - { - var viewHolder = new FlexibleView.ViewHolder(new ListItemView()); - _adapter.OnBindViewHolder(viewHolder, 0); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test OnCreateViewHolder. Check whether OnCreateViewHolder works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Adapter.OnCreateViewHolder M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OnCreateViewHolder_TEST() - { - /* TEST CODE */ - var viewHolder = _adapter.OnCreateViewHolder(0); - Assert.IsNotNull(viewHolder, "should be not null!"); - Assert.IsInstanceOf(viewHolder, "Should be an instance of ViewHolder!"); - } - - [Test] - [Category("P1")] - [Description("Test OnDestroyViewHolder. Check whether OnDestroyViewHolder works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Adapter.OnDestroyViewHolder M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OnDestroyViewHolder_TEST() - { - /* TEST CODE */ - try - { - var viewHolder = _adapter.OnCreateViewHolder(20); - _adapter.OnDestroyViewHolder(viewHolder); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test OnDetachedFromRecyclerView. Check whether OnDetachedFromRecyclerView works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Adapter.OnDetachedFromRecyclerView M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OnDetachedFromRecyclerView_TEST() - { - /* TEST CODE */ - try - { - _adapter.OnDetachedFromRecyclerView(_flexibleView); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test OnViewAttachedToWindow. Check whether OnViewAttachedToWindow works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Adapter.OnViewAttachedToWindow M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OnViewAttachedToWindow_TEST() - { - /* TEST CODE */ - try - { - var viewHolder = new FlexibleView.ViewHolder(new ListItemView()); - _adapter.OnViewAttachedToWindow(viewHolder); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test OnViewDetachedFromWindow. Check whether OnViewDetachedFromWindow works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Adapter.OnViewDetachedFromWindow M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OnViewDetachedFromWindow_TEST() - { - /* TEST CODE */ - try - { - var viewHolder = new FlexibleView.ViewHolder(new ListItemView()); - _adapter.OnViewDetachedFromWindow(viewHolder); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test OnViewRecycled. Check whether OnViewRecycled works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Adapter.OnViewRecycled M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OnViewRecycled_TEST() - { - /* TEST CODE */ - try - { - var viewHolder = new FlexibleView.ViewHolder(new ListItemView()); - _adapter.OnViewRecycled(viewHolder); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexibleView.ItemClickEventArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexibleView.ItemClickEventArgs.cs deleted file mode 100755 index 60163195c..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexibleView.ItemClickEventArgs.cs +++ /dev/null @@ -1,63 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.FlexibleView.ItemClickEventArgs Tests")] - public class FlexibleViewItemClickEventArgsTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("FlexibleView.ItemClickEventArgsTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a ItemClickEventArgs object. Check whether ItemClickEventArgs is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.ItemClickEventArgs.ItemClickEventArgs C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ItemClickEventArgs_INIT() - { - /* TEST CODE */ - var itemClickEventArgs = new Components.FlexibleView.ItemClickEventArgs(); - Assert.IsNotNull(itemClickEventArgs, "Can't create success object ItemClickEventArgs"); - Assert.IsInstanceOf(itemClickEventArgs, "Should be an instance of ItemClickEventArgs type."); - } - - - [Test] - [Category("P1")] - [Description("Test ClickedView. Check whether ClickedView is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.ItemClickEventArgs.ClickedView A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ClickedView_SET_GET_VALUE() - { - /* TEST CODE */ - var itemClickEventArgs = new Components.FlexibleView.ItemClickEventArgs(); - var viewHolder = new FlexibleView.ViewHolder(new ListItemView()); - itemClickEventArgs.ClickedView = viewHolder; - Assert.IsNotNull(itemClickEventArgs.ClickedView, "Should be not null"); - Assert.IsInstanceOf(itemClickEventArgs.ClickedView, "Should be an instance of itemClickEventArgs.ClickedView"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexibleView.ItemTouchEventArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexibleView.ItemTouchEventArgs.cs deleted file mode 100755 index e1be03efd..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexibleView.ItemTouchEventArgs.cs +++ /dev/null @@ -1,63 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.FlexibleView.ItemTouchEventArgs Tests")] - public class FlexibleViewItemTouchEventArgsTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("FlexibleView.ItemTouchEventArgsTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a ItemTouchEventArgs object. Check whether ItemTouchEventArgs is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.ItemTouchEventArgs.ItemTouchEventArgs C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ItemTouchEventArgs_INIT() - { - /* TEST CODE */ - var itemTouchEventArgs = new Components.FlexibleView.ItemTouchEventArgs(); - Assert.IsNotNull(itemTouchEventArgs, "Can't create success object ItemTouchEventArgs"); - Assert.IsInstanceOf(itemTouchEventArgs, "Should be an instance of ItemTouchEventArgs type."); - } - - - [Test] - [Category("P1")] - [Description("Test TouchedView. Check whether TouchedView is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.ItemTouchEventArgs.TouchedView A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void TouchedView_SET_GET_VALUE() - { - /* TEST CODE */ - var itemTouchEventArgs = new Components.FlexibleView.ItemTouchEventArgs(); - var viewHolder = new FlexibleView.ViewHolder(new ListItemView()); - itemTouchEventArgs.TouchedView = viewHolder; - Assert.IsNotNull(itemTouchEventArgs.TouchedView, "Should be not null"); - Assert.IsInstanceOf(itemTouchEventArgs.TouchedView, "Should be an instance of ItemTouchEventArgs.ClickedView"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexibleView.LayoutManager.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexibleView.LayoutManager.cs deleted file mode 100755 index 813bf7903..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexibleView.LayoutManager.cs +++ /dev/null @@ -1,755 +0,0 @@ -using NUnit.Framework; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Collections.Generic; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.FlexibleView.LayoutManager Tests")] - public class FlexibleViewLayoutManagerTests - { - private const string TAG = "NUI.Components"; - private FlexibleView _flexibleView = null; - private ListBridge _adapter = null; - private FlexibleView.LayoutManager _layoutManager = null; - private string _trackImageUrl = ""; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("ScrollBarTests"); - App.MainTitleChangeBackgroundColor(null); - CreateFlexiableView(); - } - - public void CreateFlexiableView() - { - _flexibleView = new FlexibleView(); - _flexibleView.Name = "RecyclerView"; - _flexibleView.Position2D = new Position2D(500, 200); - _flexibleView.Size2D = new Size2D(400, 450); - _flexibleView.Padding = new Extents(10, 10, 10, 10); - _flexibleView.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.4f); - _flexibleView.Focusable = true; - - List dataList = new List(); - for (int i = 0; i < 132; ++i) - { - dataList.Add(new ListItemData(i)); - } - _adapter = new ListBridge(dataList); - _flexibleView.SetAdapter(_adapter); - _layoutManager = new LinearLayoutManager(LinearLayoutManager.VERTICAL); - _flexibleView.SetLayoutManager(_layoutManager); - - ScrollBar scrollBar = new ScrollBar(); - scrollBar.Direction = ScrollBar.DirectionType.Vertical; - scrollBar.Position2D = new Position2D(394, 2); - scrollBar.Size2D = new Size2D(4, 446); - scrollBar.TrackColor = Color.Green; - scrollBar.ThumbSize = new Size2D(4, 30); - scrollBar.ThumbColor = Color.Yellow; - scrollBar.TrackImageURL = _trackImageUrl; - _flexibleView.AttachScrollBar(scrollBar); - - Window.Instance.Add(_flexibleView); - FocusManager.Instance.SetCurrentFocusView(_flexibleView); - _flexibleView.FocusedItemIndex = 0; - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - Window.Instance.Remove(_flexibleView); - _flexibleView.Dispose(); - _flexibleView = null; - } - - [Test] - [Category("P1")] - [Description("Create a LayoutManager object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.LayoutManager C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void LayoutManager_INIT() - { - /* TEST CODE */ - var layoutManager = new LinearLayoutManager(LinearLayoutManager.VERTICAL); - Assert.IsNotNull(layoutManager, "Can't create success object FlexibleView.ViewHolder"); - Assert.IsInstanceOf(layoutManager, "Should be an instance of LinearLayoutManager"); - } - - [Test] - [Category("P1")] - [Description("Test FocusPosition.Check whether FocusPosition is readable.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.FocusPosition A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void FocusPosition_GET_VALUE() - { - /* TEST CODE */ - _layoutManager.ChangeFocus(0); - Assert.AreEqual(0, _layoutManager.FocusPosition, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test ItemCount.Check whether ItemCount is readable.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.ItemCount A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ItemCount_GET_VALUE() - { - /* TEST CODE */ - Assert.AreEqual(132, _layoutManager.ItemCount, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test CanScrollHorizontally. Check whether CanScrollHorizontally works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.CanScrollHorizontally M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void CanScrollHorizontally_TEST() - { - /* TEST CODE */ - Assert.IsFalse(_layoutManager.CanScrollHorizontally(), "Should be false!"); - var layoutManager = new LinearLayoutManager(LinearLayoutManager.HORIZONTAL); - Assert.IsTrue(layoutManager.CanScrollHorizontally(), "Should be true"); - } - - [Test] - [Category("P1")] - [Description("Test AddView. Check whether AddView works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.AddView M")] - [Property("SPEC_URL", "-")] - [Property("COVPARAM", "FlexibleView.ViewHolder")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void AddView_TEST() - { - /* TEST CODE */ - try - { - var viewHolder = new FlexibleView.ViewHolder(new ListItemView()); - _layoutManager.AddView(viewHolder); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test AddView. Check whether AddView works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.AddView M")] - [Property("SPEC_URL", "-")] - [Property("COVPARAM", "FlexibleView.ViewHolder, int")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void AddView_TEST_WITH_INT() - { - /* TEST CODE */ - try - { - var viewHolder = new FlexibleView.ViewHolder(new ListItemView()); - _layoutManager.AddView(viewHolder, -1); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test CanScrollVertically. Check whether CanScrollVertically works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.CanScrollVertically M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void CanScrollVertically_TEST() - { - /* TEST CODE */ - Assert.IsTrue(_layoutManager.CanScrollVertically(), "Should be true!"); - var layoutManager = new LinearLayoutManager(LinearLayoutManager.HORIZONTAL); - Assert.IsFalse(layoutManager.CanScrollVertically(), "Should be false!"); - } - - [Test] - [Category("P1")] - [Description("Test ComputeScrollExtent. Check whether ComputeScrollExtent works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.ComputeScrollExtent M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ComputeScrollExtent_TEST() - { - /* TEST CODE */ - for (int i = 0; i < 50; i++) - { - _flexibleView.MoveFocus(FlexibleView.LayoutManager.Direction.Down); - } - _flexibleView.Relayout += ComputeScrollExtentRelayout; - _flexibleView.Relayout -= ComputeScrollExtentRelayout; - } - - private void ComputeScrollExtentRelayout(object sender, EventArgs args) - { - Assert.Greater(0, _layoutManager.ComputeScrollExtent(), "Should be greater than 0!"); - } - - [Test] - [Category("P1")] - [Description("Test ComputeScrollOffset. Check whether ComputeScrollOffset works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.ComputeScrollOffset M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ComputeScrollOffset_TEST() - { - /* TEST CODE */ - for (int i = 0; i < 50; i++) - { - _flexibleView.MoveFocus(FlexibleView.LayoutManager.Direction.Down); - } - _flexibleView.Relayout += ComputeScrollOffsetRelayout; - _flexibleView.Relayout -= ComputeScrollOffsetRelayout; - } - - private void ComputeScrollOffsetRelayout(object sender, EventArgs args) - { - Assert.AreEqual(0, _layoutManager.ComputeScrollOffset(), "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test ComputeScrollRange. Check whether ComputeScrollRange works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.ComputeScrollRange M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ComputeScrollRange_TEST() - { - /* TEST CODE */ - for (int i = 0; i < 50; i++) - { - _flexibleView.MoveFocus(FlexibleView.LayoutManager.Direction.Down); - } - _flexibleView.Relayout += ComputeScrollRangeRelayout; - _flexibleView.Relayout -= ComputeScrollRangeRelayout; - - } - - private void ComputeScrollRangeRelayout(object sender, EventArgs args) - { - Assert.Greater(0, _layoutManager.ComputeScrollRange(), "Should be greater than 0!"); - } - - [Test] - [Category("P1")] - [Description("Test FindItemViewByPosition. Check whether FindItemViewByPosition works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.FindItemViewByPosition M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void FindItemViewByPosition_TEST() - { - /* TEST CODE */ - for (int i = 0; i < 20; i++) - { - _flexibleView.MoveFocus(FlexibleView.LayoutManager.Direction.Down); - } - _flexibleView.Relayout += FindItemViewByPositionRelayout; - _flexibleView.Relayout -= FindItemViewByPositionRelayout; - } - - private void FindItemViewByPositionRelayout(object sender, EventArgs args) - { - var viewHolder = _layoutManager.FindItemViewByPosition(0); - Assert.IsNotNull(viewHolder, "Should be not null!"); - Assert.IsInstanceOf(viewHolder, "Should be an instance of ViewHolder!"); - } - - [Test] - [Category("P1")] - [Description("Test GetChildAt. Check whether GetChildAt works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.GetChildAt M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetChildAt_TEST() - { - /* TEST CODE */ - for (int i = 0; i < 20; i++) - { - _flexibleView.MoveFocus(FlexibleView.LayoutManager.Direction.Down); - } - _flexibleView.Relayout += GetChildAtRelayout; - _flexibleView.Relayout -= GetChildAtRelayout; - - } - - private void GetChildAtRelayout(object sender, EventArgs args) - { - var viewHolder = _layoutManager.GetChildAt(0); - Assert.IsNotNull(viewHolder, "Should be not null!"); - Assert.IsInstanceOf(viewHolder, "Should be an instance of ViewHolder!"); - } - - [Test] - [Category("P1")] - [Description("Test GetChildCount. Check whether GetChildCount works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.GetChildCount M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetChildCount_TEST() - { - /* TEST CODE */ - for (int i = 0; i < 20; i++) - { - _flexibleView.MoveFocus(FlexibleView.LayoutManager.Direction.Down); - } - _flexibleView.Relayout += GetChildCountRelayout; - _flexibleView.Relayout -= GetChildCountRelayout; - } - - private void GetChildCountRelayout(object sender, EventArgs args) - { - Assert.Greater(0, _layoutManager.GetChildCount(), "Should be greater than 0!"); - } - - [Test] - [Category("P1")] - [Description("Test GetHeight. Check whether GetHeight works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.GetHeight M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetHeight_TEST() - { - /* TEST CODE */ - Assert.AreEqual(450, _layoutManager.GetHeight(), "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test GetWidth. Check whether GetWidth works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.GetWidth M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetWidth_TEST() - { - /* TEST CODE */ - Assert.AreEqual(400, _layoutManager.GetWidth(), "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test GetPaddingBottom. Check whether GetPaddingBottom works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.GetPaddingBottom M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetPaddingBottom_TEST() - { - /* TEST CODE */ - Assert.AreEqual(10, _layoutManager.GetPaddingBottom(), "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test GetPaddingLeft. Check whether GetPaddingLeft works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.GetPaddingLeft M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetPaddingLeft_TEST() - { - /* TEST CODE */ - Assert.AreEqual(10, _layoutManager.GetPaddingLeft(), "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test GetPaddingRight. Check whether GetPaddingRight works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.GetPaddingRight M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetPaddingRight_TEST() - { - /* TEST CODE */ - Assert.AreEqual(10, _layoutManager.GetPaddingRight(), "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test GetPaddingTop. Check whether GetPaddingTop works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.GetPaddingTop M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetPaddingTop_TEST() - { - /* TEST CODE */ - Assert.AreEqual(10, _layoutManager.GetPaddingTop(), "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test ChangeFocus. Check whether ChangeFocus works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.ChangeFocus M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ChangeFocus_TEST() - { - /* TEST CODE */ - _layoutManager.ChangeFocus(2); - Assert.AreEqual(2, _layoutManager.FocusPosition, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test GetNextPosition. Check whether GetNextPosition works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.GetNextPosition M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetNextPosition_TEST() - { - /* TEST CODE */ - var myLayoutManager = new MyLayoutManager(); - Assert.AreEqual(1, myLayoutManager.TestGetNextPosition(0, FlexibleView.LayoutManager.Direction.Down), "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test LayoutChild. Check whether LayoutChild works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.LayoutChild M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void LayoutChild_TEST() - { - /* TEST CODE */ - try - { - var viewHolder = new FlexibleView.ViewHolder(new ListItemView()); - _layoutManager.LayoutChild(viewHolder, 10, 10, 200, 200); - } - catch (Exception e) - { - Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test OffsetChildrenHorizontal. Check whether OffsetChildrenHorizontal works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.OffsetChildrenHorizontal M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OffsetChildrenHorizontal_TEST() - { - /* TEST CODE */ - try - { - _layoutManager.OffsetChildrenHorizontal(0, true); - } - catch (Exception e) - { - Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test OffsetChildrenVertical. Check whether OffsetChildrenVertical works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.OffsetChildrenVertical M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OffsetChildrenVertical_TEST() - { - /* TEST CODE */ - try - { - _layoutManager.OffsetChildrenVertical(0, true); - } - catch (Exception e) - { - Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test OnLayoutChildren. Check whether OnLayoutChildren works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.OnLayoutChildren M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OnLayoutChildren_TEST() - { - /* TEST CODE */ - try - { - _flexibleView.MoveFocus(FlexibleView.LayoutManager.Direction.Down); - _flexibleView.Relayout += OnLayoutChildrenRelayout; - _flexibleView.Relayout -= OnLayoutChildrenRelayout; - } - catch (Exception e) - { - Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - private void OnLayoutChildrenRelayout(object sender, EventArgs args) - { - var recycler = _flexibleView.GetRecycler(); - _layoutManager.OnLayoutChildren(recycler); - } - - [Test] - [Category("P1")] - [Description("Test OnLayoutCompleted. Check whether OnLayoutCompleted works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.OnLayoutCompleted M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OnLayoutCompleted_TEST() - { - /* TEST CODE */ - try - { - _layoutManager.OnLayoutCompleted(); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test ScrollToPosition. Check whether ScrollToPosition works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.ScrollToPosition M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ScrollToPosition_TEST() - { - /* TEST CODE */ - try - { - _layoutManager.ScrollToPosition(0); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test ScrollToPositionWithOffset. Check whether ScrollToPositionWithOffset works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.ScrollToPositionWithOffset M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ScrollToPositionWithOffset_TEST() - { - /* TEST CODE */ - try - { - _layoutManager.ScrollToPositionWithOffset(0, 0); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test RecycleChildren. Check whether RecycleChildren works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.RecycleChildren M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void RecycleChildren_TEST() - { - /* TEST CODE */ - try - { - var recycler = new FlexibleView.Recycler(_flexibleView); - _layoutManager.RecycleChildren(recycler, 0, 0, true); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test ScrapAttachedViews. Check whether ScrapAttachedViews works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.ScrapAttachedViews M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ScrapAttachedViews_TEST() - { - /* TEST CODE */ - try - { - var recycler = new FlexibleView.Recycler(_flexibleView); - _layoutManager.ScrapAttachedViews(recycler); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test RelayoutRequest. Check whether RelayoutRequest works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.RelayoutRequest M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void RelayoutRequest_TEST() - { - /* TEST CODE */ - try - { - _layoutManager.RelayoutRequest(); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test RemoveAndRecycleViewAt. Check whether RemoveAndRecycleViewAt works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.RemoveAndRecycleViewAt M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void RemoveAndRecycleViewAt_TEST() - { - /* TEST CODE */ - try - { - _flexibleView.MoveFocus(FlexibleView.LayoutManager.Direction.Down); - _flexibleView.Relayout += RemoveAndRecycleViewAtRelayout; - _flexibleView.Relayout -= RemoveAndRecycleViewAtRelayout; - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - private void RemoveAndRecycleViewAtRelayout(object sender, EventArgs args) - { - var recycler = _flexibleView.GetRecycler(); - _layoutManager.RemoveAndRecycleViewAt(0, recycler); - } - - [Test] - [Category("P1")] - [Description("Test ScrollVerticallyBy. Check whether ScrollVerticallyBy works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.ScrollVerticallyBy M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ScrollVerticallyBy_TEST() - { - /* TEST CODE */ - try - { - var recycler = new FlexibleView.Recycler(_flexibleView); - _layoutManager.ScrollVerticallyBy(0, recycler, true); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test ScrollHorizontallyBy. Check whether ScrollHorizontallyBy works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.LayoutManager.ScrollHorizontallyBy M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ScrollHorizontallyBy_TEST() - { - /* TEST CODE */ - try - { - var recycler = new FlexibleView.Recycler(_flexibleView); - _layoutManager.ScrollHorizontallyBy(0, recycler, true); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - } - - public class MyLayoutManager : FlexibleView.LayoutManager - { - public override void OnLayoutChildren(FlexibleView.Recycler recycler) - { - } - - public int TestGetNextPosition(int position, Direction direction) - { - return GetNextPosition(position, direction); - } - - protected override int GetNextPosition(int position, Direction direction) - { - switch (direction) - { - case FlexibleView.LayoutManager.Direction.Up: - if (position > 0) - { - return position - 1; - } - break; - case FlexibleView.LayoutManager.Direction.Down: - return position + 1; - } - - return FlexibleView.NO_POSITION; - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexibleView.Recycler.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexibleView.Recycler.cs deleted file mode 100755 index 9626ed68a..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexibleView.Recycler.cs +++ /dev/null @@ -1,223 +0,0 @@ -using NUnit.Framework; -using System; -using System.Collections.Generic; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.FlexibleView.Recycler Tests")] - public class FlexibleViewRecyclerTests - { - private const string TAG = "NUI.Components"; - private FlexibleView _flexibleView = null; - private ListBridge _adapter = null; - private FlexibleView.LayoutManager _layoutManager = null; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("ScrollBarTests"); - App.MainTitleChangeBackgroundColor(null); - CreateFlexiableView(); - } - - public void CreateFlexiableView() - { - _flexibleView = new FlexibleView(); - _flexibleView.Name = "RecyclerView"; - _flexibleView.Position2D = new Position2D(500, 200); - _flexibleView.Size2D = new Size2D(400, 450); - _flexibleView.Padding = new Extents(10, 10, 10, 10); - _flexibleView.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.4f); - _flexibleView.Focusable = true; - - List dataList = new List(); - for (int i = 0; i < 131; ++i) - { - dataList.Add(new ListItemData(i)); - } - _adapter = new ListBridge(dataList); - _flexibleView.SetAdapter(_adapter); - _layoutManager = new LinearLayoutManager(LinearLayoutManager.VERTICAL); - _flexibleView.SetLayoutManager(_layoutManager); - - Window.Instance.Add(_flexibleView); - FocusManager.Instance.SetCurrentFocusView(_flexibleView); - _flexibleView.FocusedItemIndex = 0; - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - Window.Instance.Remove(_flexibleView); - _flexibleView.Dispose(); - _flexibleView = null; - } - - [Test] - [Category("P1")] - [Description("Create a Recycler object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Recycler.Recycler C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Recycler_INIT() - { - /* TEST CODE */ - var recycler = new FlexibleView.Recycler(_flexibleView); - Assert.IsNotNull(recycler, "Can't create success object FlexibleView.Recycler"); - Assert.IsInstanceOf(recycler, "Should be an instance of FlexibleView.Recycler type."); - } - - [Test] - [Category("P1")] - [Description("Test SetViewCacheSize. Check SetViewCacheSize whether works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Recycler.SetViewCacheSize M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void SetViewCacheSize_TEST() - { - /* TEST CODE */ - var recycler = new FlexibleView.Recycler(_flexibleView); - try - { - recycler.SetViewCacheSize(2); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test GetViewForPosition. Check whether GetViewForPosition works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Recycler.GetViewForPosition M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetViewForPosition_TEST() - { - /* TEST CODE */ - try - { - _flexibleView.MoveFocus(FlexibleView.LayoutManager.Direction.Down); - _flexibleView.Relayout += GetViewForPositionRelayout; - _flexibleView.Relayout -= GetViewForPositionRelayout; - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - private void GetViewForPositionRelayout(object sender, EventArgs args) - { - var recycler = _flexibleView.GetRecycler(); - var viewHolder = recycler.GetViewForPosition(0); - Assert.IsNotNull(viewHolder, "should be not null"); - Assert.IsInstanceOf(viewHolder, "Should be an instance of ViewHolder!"); - } - - [Test] - [Category("P1")] - [Description("Test GetScrapCount. Check whether GetScrapCount works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Recycler.GetScrapCount M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetScrapCount_TEST() - { - /* TEST CODE */ - var recycler = new FlexibleView.Recycler(_flexibleView); - try - { - Assert.AreEqual(0, recycler.GetScrapCount(), "Should be equal"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test RecycleView. Check whether GetViewForPosition works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Recycler.RecycleView M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void RecycleView_TEST() - { - /* TEST CODE */ - try - { - _flexibleView.MoveFocus(FlexibleView.LayoutManager.Direction.Down); - _flexibleView.Relayout += RecycleViewRelayout; - _flexibleView.Relayout -= RecycleViewRelayout; - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - private void RecycleViewRelayout(object sender, EventArgs args) - { - FlexibleView.Recycler recycler = _flexibleView.GetRecycler(); - FlexibleView.ViewHolder viewHolder = recycler.GetViewForPosition(0); - recycler.RecycleView(viewHolder); - } - - [Test] - [Category("P1")] - [Description("Test GetScrapViewAt. Check whether GetScrapViewAt works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Recycler.GetScrapViewAt M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetScrapViewAt_TEST() - { - /* TEST CODE */ - var recycler = new FlexibleView.Recycler(_flexibleView); - try - { - if (recycler.GetScrapCount() != 0) - { - var viewHolder = recycler.GetScrapViewAt(0); - Assert.IsNotNull(viewHolder, "should be not null"); - Assert.IsInstanceOf(viewHolder, "should be an instance of FlexibleView.ViewHolder"); - } - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Clear. Check whether Clear works or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Recycler.Clear M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Clear_TEST() - { - /* TEST CODE */ - var recycler = new FlexibleView.Recycler(_flexibleView); - try - { - recycler.Clear(); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexibleView.ViewHolder.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexibleView.ViewHolder.cs deleted file mode 100755 index 38ccd7f2e..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFlexibleView.ViewHolder.cs +++ /dev/null @@ -1,254 +0,0 @@ -using NUnit.Framework; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Collections.Generic; -using System; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.FlexibleView.ViewHolder Tests")] - public class FlexibleViewViewHolderTests - { - private const string TAG = "NUI.Components"; - private FlexibleView _flexibleView = null; - private ListBridge _adapter = null; - private FlexibleView.LayoutManager _layoutManager = null; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("ScrollBarTests"); - App.MainTitleChangeBackgroundColor(null); - CreateFlexiableView(); - } - - public void CreateFlexiableView() - { - _flexibleView = new FlexibleView(); - _flexibleView.Name = "RecyclerView"; - _flexibleView.Position2D = new Position2D(500, 200); - _flexibleView.Size2D = new Size2D(400, 450); - _flexibleView.Padding = new Extents(10, 10, 10, 10); - _flexibleView.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.4f); - _flexibleView.Focusable = true; - - List dataList = new List(); - for (int i = 0; i < 131; ++i) - { - dataList.Add(new ListItemData(i)); - } - _adapter = new ListBridge(dataList); - _flexibleView.SetAdapter(_adapter); - _layoutManager = new LinearLayoutManager(LinearLayoutManager.VERTICAL); - _flexibleView.SetLayoutManager(_layoutManager); - - Window.Instance.Add(_flexibleView); - FocusManager.Instance.SetCurrentFocusView(_flexibleView); - _flexibleView.FocusedItemIndex = 0; - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - Window.Instance.Remove(_flexibleView); - _flexibleView.Dispose(); - _flexibleView = null; - } - - [Test] - [Category("P1")] - [Description("Create a ViewHolder object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.ViewHolder.ViewHolder C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ViewHolder_INIT() - { - /* TEST CODE */ - var view = new View(); - view.Size2D = new Size2D(200, 200); - view.BackgroundColor = Color.Green; - var viewHolder = new FlexibleView.ViewHolder(view); - Assert.IsNotNull(viewHolder, "Can't create success object FlexibleView.ViewHolder"); - Assert.IsInstanceOf(viewHolder, "Should be an instance of FlexibleView.ViewHolder type."); - } - - [Test] - [Category("P1")] - [Description("Test ItemView.Check whether ItemView is readable.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.ViewHolder.ItemView A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ItemView_GET_VALUE() - { - /* TEST CODE */ - var viewHolder = new FlexibleView.ViewHolder(new ListItemView()); - Assert.IsNotNull(viewHolder, "should be not null!"); - Assert.IsInstanceOf(viewHolder, "Should be an instance of ViewHolder"); - } - - [Test] - [Category("P1")] - [Description("Test Left.Check whether Left is readable.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.ViewHolder.Left A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Left_GET_VALUE() - { - /* TEST CODE */ - var view = new View(); - view.Size2D = new Size2D(200, 200); - view.BackgroundColor = Color.Green; - view.Position2D = new Position2D(200, 200); - view.Margin = new Extents(20, 20, 20, 20); - var viewHolder = new FlexibleView.ViewHolder(view); - - Assert.AreEqual(180, viewHolder.Left, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Right.Check whether Right is readable.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.ViewHolder.Right A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Right_GET_VALUE() - { - /* TEST CODE */ - var view = new View(); - view.Size2D = new Size2D(200, 200); - view.BackgroundColor = Color.Green; - view.Position2D = new Position2D(200, 200); - view.Margin = new Extents(20, 20, 20, 20); - var viewHolder = new FlexibleView.ViewHolder(view); - - Assert.AreEqual(420, viewHolder.Right, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Top.Check whether Top is readable.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.ViewHolder.Top A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Top_GET_VALUE() - { - /* TEST CODE */ - var view = new View(); - view.Size2D = new Size2D(200, 200); - view.BackgroundColor = Color.Green; - view.Position2D = new Position2D(200, 200); - view.Margin = new Extents(20, 20, 20, 20); - var viewHolder = new FlexibleView.ViewHolder(view); - - Assert.AreEqual(180, viewHolder.Top, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Bottom.Check whether Bottom is readable.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.ViewHolder.Bottom A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Bottom_GET_VALUE() - { - /* TEST CODE */ - var view = new View(); - view.Size2D = new Size2D(200, 200); - view.BackgroundColor = Color.Green; - view.Position2D = new Position2D(200, 200); - view.Margin = new Extents(20, 20, 20, 20); - var viewHolder = new FlexibleView.ViewHolder(view); - - Assert.AreEqual(420, viewHolder.Bottom, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test LayoutPosition.Check whether LayoutPosition is readable.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.ViewHolder.LayoutPosition A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void LayoutPosition_GET_VALUE() - { - /* TEST CODE */ - _flexibleView.Relayout += LayoutPositionRelayout; - _flexibleView.Relayout -= LayoutPositionRelayout; - } - - private void LayoutPositionRelayout(object sender, EventArgs args) - { - var viewHolder = _flexibleView.FindViewHolderForLayoutPosition(0); - Assert.AreEqual(0, viewHolder.LayoutPosition, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test AdapterPosition.Check whether AdapterPosition is readable.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.ViewHolder.AdapterPosition A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void AdapterPosition_GET_VALUE() - { - /* TEST CODE */ - _flexibleView.Relayout += AdapterPositionRelayout; - _flexibleView.Relayout -= AdapterPositionRelayout; - } - - private void AdapterPositionRelayout(object sender, EventArgs args) - { - var viewHolder = _flexibleView.FindViewHolderForAdapterPosition(0); - Assert.AreEqual(0, viewHolder.AdapterPosition, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test OldPosition.Check whether OldPosition is readable.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.ViewHolder.OldPosition A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OldPosition_GET_VALUE() - { - /* TEST CODE */ - _flexibleView.Relayout += OldPositionRelayout; - _flexibleView.Relayout -= OldPositionRelayout; - } - - private void OldPositionRelayout(object sender, EventArgs args) - { - var viewHolder = _flexibleView.FindViewHolderForAdapterPosition(0); - Assert.AreEqual(0, viewHolder.OldPosition, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test ItemViewType.Check whether ItemViewType is readable.")] - [Property("SPEC", "Tizen.NUI.Components.FlexibleView.ViewHolder.ItemViewType A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ItemViewType_SET_GET_VALUE() - { - /* TEST CODE */ - var view = new View(); - view.Size2D = new Size2D(200, 200); - view.BackgroundColor = Color.Green; - var viewHolder = new FlexibleView.ViewHolder(view); - viewHolder.ItemViewType = 1; - Assert.AreEqual(1, viewHolder.ItemViewType, "Should be equals to the set value of ItemViewType."); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFloatSelector.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFloatSelector.cs deleted file mode 100755 index 85f0468b9..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSFloatSelector.cs +++ /dev/null @@ -1,64 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Threading.Tasks; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.FloatSelector Tests")] - public class FloatSelectorTests - { - private const string TAG = "NUI.Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("FloatSelectorTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a FloatSelector object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.FloatSelector.FloatSelector C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void FloatSelector_INIT() - { - /* TEST CODE */ - var floatSelector = new FloatSelector(); - Assert.IsNotNull(floatSelector, "Can't create success object FloatSelector"); - Assert.IsInstanceOf(floatSelector, "Should be an instance of FloatSelector type."); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check Whether Clone works or not")] - [Property("SPEC", "Tizen.NUI.Components.FloatSelector.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Clone_TEST() - { - /* TEST CODE */ - var floatSelector1 = new FloatSelector(); - floatSelector1.All = 1.0f; - var floatSelector = floatSelector1.Clone(); - Assert.IsNotNull(floatSelector, "should be not null!"); - Assert.AreEqual(1.0f, floatSelector.All); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSGridLayoutManager.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSGridLayoutManager.cs deleted file mode 100755 index db2d20462..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSGridLayoutManager.cs +++ /dev/null @@ -1,106 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Threading.Tasks; -using System.Collections.Generic; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.GridLayoutManager Tests")] - public class GridLayoutManagerTests - { - private const string TAG = "NUI.Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("GridLayoutManagerTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a GridLayoutManager object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.GridLayoutManager.GridLayoutManager C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GridLayoutManager_INIT() - { - /* TEST CODE */ - var layoutManager = new GridLayoutManager(10, LinearLayoutManager.VERTICAL); - Assert.IsNotNull(layoutManager, "Can't create success object GridLayoutManager"); - Assert.IsInstanceOf(layoutManager, "Should be an instance of GridLayoutManager type."); - } - - [Test] - [Category("P1")] - [Description("Test GetNextPosition. Check whether GetNextPosition works or not.")] - [Property("SPEC", "Tizen.NUI.Components.GridLayoutManager.GetNextPosition M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetNextPosition_TEST() - { - /* TEST CODE */ - try - { - var myGrideLayoutManager = new MyGridLayoutManager(3, LinearLayoutManager.HORIZONTAL); - Assert.AreEqual(3, myGrideLayoutManager.TestGetNextPosition(0, FlexibleView.LayoutManager.Direction.Right), "Should be equal!"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - } - - public class MyGridLayoutManager : GridLayoutManager - { - private int _mSpanCount; - public MyGridLayoutManager(int spanCount, int orientation) : base(spanCount, orientation) - { - _mSpanCount = spanCount; - } - public int TestGetNextPosition(int position, Direction direction) - { - return GetNextPosition(position, direction); - } - - protected override int GetNextPosition(int position, Direction direction) - { - switch (direction) - { - case FlexibleView.LayoutManager.Direction.Left: - if (position >= _mSpanCount) - { - return position - _mSpanCount; - } - break; - case FlexibleView.LayoutManager.Direction.Right: - return position + _mSpanCount; - case FlexibleView.LayoutManager.Direction.Up: - if (position % _mSpanCount > 0) - { - return position - 1; - } - break; - case FlexibleView.LayoutManager.Direction.Down: - return position + 1; - } - - return FlexibleView.NO_POSITION; - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSImageAttributes.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSImageAttributes.cs deleted file mode 100755 index e3077acec..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSImageAttributes.cs +++ /dev/null @@ -1,124 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Threading.Tasks; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.ImageAttributes Tests")] - public class ImageAttributesTests - { - private const string TAG = "NUI.Components"; - private string _imagePath = ""; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("ImageAttributesTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a ImageAttributes object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.ImageAttributes.ImageAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ImageAttributes_INIT() - { - /* TEST CODE */ - var imageAttributes = new ImageAttributes(); - Assert.IsNotNull(imageAttributes, "Can't create success object ImageAttributes"); - Assert.IsInstanceOf(imageAttributes, "Should be an instance of ImageAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Create a ImageAttributes object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.ImageAttributes.ImageAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "ImageAttributes")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ImageAttributes_INIT_WITH_IMAGEATTRIBUTES() - { - /* TEST CODE */ - var imageAttributes1 = new ImageAttributes(); - var imageAttributes = new ImageAttributes(imageAttributes1); - Assert.IsNotNull(imageAttributes, "Can't create success object ImageAttributes"); - Assert.IsInstanceOf(imageAttributes, "Should be an instance of ImageAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Test ResourceURL.Check whether ResourceURL is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ImageAttributes.ResourceURL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ResourceURL_SET_GET_VALUE() - { - /* TEST CODE */ - var imageAttributes = new ImageAttributes(); - imageAttributes.ResourceURL = new StringSelector { All = _imagePath }; - Assert.AreEqual(_imagePath, imageAttributes.ResourceURL.All, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Border.Check whether Border is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ImageAttributes.Border A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Border_SET_GET_VALUE() - { - /* TEST CODE */ - var imageAttributes = new ImageAttributes(); - imageAttributes.Border = new RectangleSelector { All = new Rectangle(1, 2, 3, 4) }; - Assert.AreEqual(1, imageAttributes.Border.All.X, "Should be equal!"); - Assert.AreEqual(2, imageAttributes.Border.All.Y, "Should be equal!"); - Assert.AreEqual(3, imageAttributes.Border.All.Width, "Should be equal!"); - Assert.AreEqual(4, imageAttributes.Border.All.Height, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check Whether Clone works or not")] - [Property("SPEC", "Tizen.NUI.Components.ImageAttributes.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Clone_TEST() - { - /* TEST CODE */ - try - { - var imageAttributes = new ImageAttributes(); - imageAttributes.ResourceURL = new StringSelector() { All = _imagePath }; - var attributes = imageAttributes.Clone() as ImageAttributes; - Assert.IsNotNull(attributes, "Should be not null"); - Assert.IsInstanceOf(attributes, "Should be an instance of ImageAttributes type."); - Assert.AreEqual(_imagePath, attributes.ResourceURL.All, "Should be equal!"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSInputField.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSInputField.cs deleted file mode 100755 index e89ca2845..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSInputField.cs +++ /dev/null @@ -1,682 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.InputField Tests")] - public class InputFieldTests - { - private const string TAG = "Components"; - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Tizen.NUI.Components.Tests.png"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("InputFieldTests"); - App.MainTitleChangeBackgroundColor(null); - - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a InputField object. Check whether InputField is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.InputField C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void InputField_INIT() - { - /* TEST CODE */ - var inputField = new InputField(); - Assert.IsNotNull(inputField, "Can't create success object InputField"); - Assert.IsInstanceOf(inputField, "Should be an instance of InputField type."); - } - - [Test] - [Category("P1")] - [Description("Create a InputField object with attributes. Check whether object whose text is initialized is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.InputField C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "InputFieldAttributes")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void InputField_INIT_WITH_InputFieldAttributes() - { - /* TEST CODE */ - var inputField = new InputField(new InputFieldAttributes()); - Assert.IsNotNull(inputField, "Can't create success object InputField"); - Assert.IsInstanceOf(inputField, "Should be an instance of textLabel type."); - } - - [Test] - [Category("P1")] - [Description("Create a InputField object with string. Check whether object whose text is initialized is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.InputField C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void InputField_INIT_WITH_STRING() - { - /* TEST CODE */ - StyleManager.Instance.RegisterStyle("DefaultInputField", "Utility", typeof(UtilityDefaultInputFieldStyle), true); - - var inputField = new InputField("DefaultInputField"); - Assert.IsNotNull(inputField, "Can't create success object InputField"); - Assert.IsInstanceOf(inputField, "Should be an instance of InputField type."); - } - - [Test] - [Category("P1")] - [Description("Test StateEnabled. Check whether StateEnabled works or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.StateEnabled A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void StateEnabled_SET_GET_VALUE() - { - /* TEST CODE */ - var inputField = new InputField(); - Assert.IsInstanceOf(inputField, "Should be an instance of InputField type"); - inputField.StateEnabled = true; - Assert.AreEqual(true, inputField.StateEnabled, "Retrieved StateEnabled should be equal to set value"); - inputField.StateEnabled = false; - Assert.AreEqual(false, inputField.StateEnabled, "Retrieved StateEnabled should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test Text. Check whether Text works or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.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 inputField = new InputField(); - Assert.IsInstanceOf(inputField, "Should be an instance of InputField type"); - inputField.Text = "inputfield"; - Assert.AreEqual("inputfield", inputField.Text, "Retrieved Text width should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test HintText. Check whether HintText works or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.HintText A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void HintText_SET_GET_VALUE() - { - /* TEST CODE */ - var inputField = new InputField(); - Assert.IsInstanceOf(inputField, "Should be an instance of InputField type"); - inputField.HintText = "hinttext"; - Assert.AreEqual("hinttext", inputField.HintText, "Retrieved HintText should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TextColor. Check whether TextColor works or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.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 inputField = new InputField(); - Color color = Color.Red; - inputField.TextColor = color; - Assert.AreEqual(color.R, inputField.TextColor.R, "Retrieved TextColor should be equal to set value"); - Assert.AreEqual(color.G, inputField.TextColor.G, "Retrieved TextColor should be equal to set value"); - Assert.AreEqual(color.B, inputField.TextColor.B, "Retrieved TextColor should be equal to set value"); - Assert.AreEqual(color.A, inputField.TextColor.A, "Retrieved TextColor should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test HintTextColor. Check whether HintTextColor works or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.HintTextColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void HintTextColor_SET_GET_VALUE() - { - /* TEST CODE */ - var inputField = new InputField(); - Color color = Color.Red; - inputField.HintTextColor = color; - Assert.AreEqual(color.R, inputField.HintTextColor.R, "Retrieved HintTextColor should be equal to set value"); - Assert.AreEqual(color.G, inputField.HintTextColor.G, "Retrieved HintTextColor should be equal to set value"); - Assert.AreEqual(color.B, inputField.HintTextColor.B, "Retrieved HintTextColor should be equal to set value"); - Assert.AreEqual(color.A, inputField.HintTextColor.A, "Retrieved HintTextColor should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test PrimaryCursorColor. Check whether PrimaryCursorColor works or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.PrimaryCursorColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void PrimaryCursorColor_SET_GET_VALUE() - { - /* TEST CODE */ - var inputField = new InputField(); - Color color = Color.Red; - inputField.PrimaryCursorColor = color; - Assert.AreEqual(color.R, inputField.PrimaryCursorColor.R, "Retrieved PrimaryCursorColor should be equal to set value"); - Assert.AreEqual(color.G, inputField.PrimaryCursorColor.G, "Retrieved PrimaryCursorColor should be equal to set value"); - Assert.AreEqual(color.B, inputField.PrimaryCursorColor.B, "Retrieved PrimaryCursorColor should be equal to set value"); - Assert.AreEqual(color.A, inputField.PrimaryCursorColor.A, "Retrieved PrimaryCursorColor should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test SecondaryCursorColor. Check whether SecondaryCursorColor works or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.SecondaryCursorColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void SecondaryCursorColor_SET_GET_VALUE() - { - /* TEST CODE */ - var inputField = new InputField(); - Color color = Color.Red; - inputField.SecondaryCursorColor = color; - Assert.AreEqual(color.R, inputField.SecondaryCursorColor.R, "Retrieved SecondaryCursorColor should be equal to set value"); - Assert.AreEqual(color.G, inputField.SecondaryCursorColor.G, "Retrieved SecondaryCursorColor should be equal to set value"); - Assert.AreEqual(color.B, inputField.SecondaryCursorColor.B, "Retrieved SecondaryCursorColor should be equal to set value"); - Assert.AreEqual(color.A, inputField.SecondaryCursorColor.A, "Retrieved SecondaryCursorColor should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test PointSize. Check whether PointSize works or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.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 inputField = new InputField(); - inputField.PointSize = 38; - Assert.AreEqual(38, inputField.PointSize, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test FontFamily. Check whether FontFamily works or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.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 inputField = new InputField(); - inputField.FontFamily = "FontFamily"; - Assert.AreEqual("FontFamily", inputField.FontFamily, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test EnableCursorBlink. Check whether EnableCursorBlink is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.EnableCursorBlink A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void EnableCursorBlink_SET_GET_VALUE() - { - /* TEST CODE */ - var inputField = new InputField(); - inputField.EnableCursorBlink = true; - Assert.AreEqual(true, inputField.EnableCursorBlink, "Retrieved EnableCursorBlink should be equal to set value"); - inputField.EnableCursorBlink = false; - Assert.AreEqual(false, inputField.EnableCursorBlink, "Retrieved EnableCursorBlink should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test EnableSelection. Check whether EnableSelection is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.EnableSelection A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void EnableSelection_SET_GET_VALUE() - { - /* TEST CODE */ - var inputField = new InputField(); - inputField.EnableSelection = false; - Assert.IsFalse(inputField.EnableSelection, "Retrieved EnableSelection count should be equal to the set value"); - inputField.EnableSelection = true; - Assert.IsTrue(inputField.EnableSelection, "Retrieved EnableSelection count should be equal to the set value"); - } - - [Test] - [Category("P1")] - [Description("Test CursorWidth. Check whether CursorWidth is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.CursorWidth A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void CursorWidth_SET_GET_VALUE() - { - /* TEST CODE */ - var inputField = new InputField(); - inputField.CursorWidth = 5; - Assert.AreEqual(5, inputField.CursorWidth, "Retrieved CursorWidth should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test EnableEllipsis. Check whether EnableEllipsis is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.EnableEllipsis A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void EnableEllipsis_SET_GET_VALUE() - { - /* TEST CODE */ - var inputField = new InputField(); - inputField.EnableEllipsis = false; - Assert.IsFalse(inputField.EnableEllipsis, "Retrieved Ellipsis value should be equal to the set value"); - inputField.EnableEllipsis = true; - Assert.IsTrue(inputField.EnableEllipsis, "Retrieved Ellipsis value should be equal to the set value"); - } - - [Test] - [Category("P1")] - [Description("Test BackgroundImageURL. Check whether BackgroundImageURL works or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.BackgroundImageURL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void BackgroundImageURL_SET_GET_VALUE() - { - /* TEST CODE */ - var inputField = new InputField(); - inputField.BackgroundImageURL = "inputFieldurl"; - Assert.AreEqual("inputFieldurl", inputField.BackgroundImageURL, "Retrieved BackgroundImageURL should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test BackgroundImageBorder. Check whether BackgroundImageBorder works or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.BackgroundImageBorder A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void BackgroundImageBorder_SET_GET_VALUE() - { - /* TEST CODE */ - var inputField = new InputField(); - - inputField.BackgroundImageBorder = new Rectangle(0, 0, 10, 10); - Assert.AreEqual(0, inputField.BackgroundImageBorder.X, "Retrieved BackgroundImageBorder should be equal to set value"); - Assert.AreEqual(0, inputField.BackgroundImageBorder.Y, "Retrieved BackgroundImageBorder should be equal to set value"); - Assert.AreEqual(10, inputField.BackgroundImageBorder.Width, "Retrieved BackgroundImageBorder should be equal to set value"); - Assert.AreEqual(10, inputField.BackgroundImageBorder.Height, "Retrieved BackgroundImageBorder should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test Space. Check whether Space works or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.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 inputField = new InputField(); - inputField.Space = 20; - Assert.AreEqual(20, inputField.Space, "Retrieved Space should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test GetAttributes. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.InputField.GetAttributes M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void GetAttributes_CHECK_VALUE() - { - /* TEST CODE */ - try - { - var myInputField = new MyInputField(); - Assert.IsTrue(myInputField.flagGetAttributes, "GetAttributes trigger Check Fail."); - } - 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 OnUpdate. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.InputField.OnUpdate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public async Task OnUpdate_CHECK_VALUE() - { - /* TEST CODE */ - var myInputField = new MyInputField(); - Window.Instance.Add(myInputField); - try - { - await Task.Delay(200); - Assert.IsTrue(myInputField.flagOnUpdate, "OnUpdate trigger Check Fail."); - } - 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(myInputField); - } - } - - [Test] - [Category("P1")] - [Description("Test OnThemeChangedEvent. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.InputField.OnThemeChangedEvent M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public async Task OnThemeChangedEvent_CHECK_VALUE() - { - /* TEST CODE */ - StyleManager.Instance.Theme = "Utility"; - var myInputField = new MyInputField(); - Window.Instance.Add(myInputField); - try - { - StyleManager.Instance.Theme = "Food"; - await Task.Delay(200); - Assert.IsTrue(myInputField.flagOnThemeChangedEvent, "OnThemeChangedEvent trigger Check Fail."); - } - 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(myInputField); - } - } - - [Test] - [Category("P1")] - [Description("Test SetTextFieldSize2D, Check whether SetTextFieldSize2D works or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.SetTextFieldSize2D M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void SetTextFieldSize2D_CHECK() - { - /* TEST CODE */ - try - { - var myInputField = new MyInputField(); - myInputField.SetTextFieldSize2D(160, 60); - } - 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 SetTextFieldPosX, Check whether SetTextFieldPosX works or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.SetTextFieldPosX M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void SetTextFieldPosX_CHECK() - { - /* TEST CODE */ - try - { - var myInputField = new MyInputField(); - myInputField.SetTextFieldPosX(60); - } - 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 SetTextFieldTextColor, Check whether SetTextFieldTextColor works or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.SetTextFieldTextColor M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void SetTextFieldTextColor_CHECK() - { - /* TEST CODE */ - try - { - var myInputField = new MyInputField(); - myInputField.SetTextFieldTextColor(Color.Red); - } - 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 RelayoutTextField, Check whether RelayoutTextField works or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.RelayoutTextField M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void RelayoutTextField_CHECK() - { - /* TEST CODE */ - try - { - var myInputField = new MyInputField(); - myInputField.RelayoutTextField(false); - } - 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 InputField.")] - [Property("SPEC", "Tizen.NUI.Components.InputField.Dispose M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Dispose_CHECK() - { - /* TEST CODE */ - try - { - var inputField = new InputField(); - inputField.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()); - } - } - } - - public class MyInputField : InputField - { - public bool flagGetAttributes = false; - public bool flagOnUpdate = false; - public bool flagOnThemeChangedEvent = false; - public bool flagOnTextFieldFocusGained = false; - public bool flagOnTextFieldFocusLost = false; - public bool flagOnTextFieldTextChanged = false; - public bool flagOnTextFieldKeyEvent = false; - - public MyInputField() : base() - { } - - public MyInputField(string style) : base(style) - { } - - protected override Attributes GetAttributes() - { - flagGetAttributes = true; - return new InputFieldAttributes(); - } - - protected override void OnUpdate() - { - base.OnUpdate(); - flagOnUpdate = true; - } - - protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e) - { - flagOnThemeChangedEvent = true; - } - - protected override void OnTextFieldFocusGained(object source, EventArgs e) - { - flagOnTextFieldFocusGained = true; - } - - protected override void OnTextFieldFocusLost(object source, EventArgs e) - { - flagOnTextFieldFocusLost = true; - } - - protected override void OnTextFieldTextChanged(object sender, Tizen.NUI.BaseComponents.TextField.TextChangedEventArgs e) - { - flagOnTextFieldTextChanged = true; - } - - protected override bool OnTextFieldKeyEvent(object source, KeyEventArgs e) - { - flagOnTextFieldKeyEvent = true; - return false; - } - - public new void SetTextFieldSize2D(int w, int h) - { - base.SetTextFieldSize2D(w, h); - } - - public new void SetTextFieldPosX(int x) - { - base.SetTextFieldPosX(x); - } - - public new void SetTextFieldTextColor(Color color) - { - base.SetTextFieldTextColor(color); - } - - public new void RelayoutTextField(bool value) - { - base.RelayoutTextField(value); - } - } - - internal class UtilityDefaultInputFieldStyle : StyleBase - { - protected override Attributes GetAttributes() - { - if (Content != null) - { - return (Content as Attributes).Clone(); - } - var attributes = new InputFieldAttributes - { - Space = 24, - BackgroundImageAttributes = new ImageAttributes - { - ResourceURL = new StringSelector - { - All = "1. Action bar/search_bg.png", - }, - Border = new RectangleSelector - { - All = new Rectangle(45, 45, 0, 0), - }, - }, - InputBoxAttributes = new TextFieldAttributes - { - TextColor = new ColorSelector - { - Normal = new Color(0, 0, 0, 1), - Pressed = new Color(0, 0, 0, 1), - Disabled = new Color(0, 0, 0, 0.4f) - }, - PlaceholderTextColor = new ColorSelector - { - All = new Color(0, 0, 0, 0.4f), - }, - PrimaryCursorColor = new ColorSelector - { - All = Color.Red, - }, - SecondaryCursorColor = new ColorSelector - { - All = Color.Green, - }, - HorizontalAlignment = HorizontalAlignment.Begin, - VerticalAlignment = VerticalAlignment.Center, - PointSize = new FloatSelector - { - All = 38, - }, - FontFamily = "SamsungOne 500", - CursorWidth = 2, - }, - }; - - return attributes; - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSInputFieldAttributes.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSInputFieldAttributes.cs deleted file mode 100755 index 799dc8c68..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSInputFieldAttributes.cs +++ /dev/null @@ -1,124 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.InputFieldAttributes Tests")] - public class InputFieldAttributesTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("InputFieldAttributesTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a InputFieldAttributes object. Check whether InputFieldAttributes is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputFieldAttributes.InputFieldAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void InputFieldAttributes_INIT() - { - /* TEST CODE */ - var inputFieldAttributes = new InputFieldAttributes(); - Assert.IsNotNull(inputFieldAttributes, "Can't create success object PreFocusChangedArgs"); - Assert.IsInstanceOf(inputFieldAttributes, "Should be an instance of InputFieldAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Create a InputFieldAttributes object. Check whether InputFieldAttributes is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.InputFieldAttributes.InputFieldAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "InputFieldAttributes")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void InputFieldAttributes_INIT_WITH_InputFieldAttributes() - { - /* TEST CODE */ - var inputFieldAttributes = new InputFieldAttributes(); - var inputFieldAttributes2 = new InputFieldAttributes(inputFieldAttributes); - Assert.IsNotNull(inputFieldAttributes2, "Can't create success object InputFieldAttributes"); - Assert.IsInstanceOf(inputFieldAttributes2, "Should be an instance of InputFieldAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Test BackgroundImageAttributes. Check whether BackgroundImageAttributes is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.InputFieldAttributes.BackgroundImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void BackgroundImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var inputFieldAttributes = new InputFieldAttributes(); - var imageAttributes = new ImageAttributes() { ResourceURL = new StringSelector() { All = "test.png" } }; - inputFieldAttributes.BackgroundImageAttributes = imageAttributes; - Assert.AreEqual(imageAttributes.ResourceURL.All, inputFieldAttributes.BackgroundImageAttributes.ResourceURL.All, "Retrieved BackgroundImageAttributes should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test InputBoxAttributes. Check whether InputBoxAttributes is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.InputFieldAttributes.InputBoxAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void InputBoxAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var inputFieldAttributes = new InputFieldAttributes(); - var textFieldAttributes = new TextFieldAttributes() { Text = new StringSelector() { All = "test" } }; - inputFieldAttributes.InputBoxAttributes = textFieldAttributes; - Assert.AreEqual(textFieldAttributes.Text.All, inputFieldAttributes.InputBoxAttributes.Text.All, "Retrieved InputBoxAttributes should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test Space. Check whether Space is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.InputFieldAttributes.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 inputFieldAttributes = new InputFieldAttributes(); - inputFieldAttributes.Space = 30; - Assert.AreEqual(30, inputFieldAttributes.Space, "Retrieved Space should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check whether Clone works or not")] - [Property("SPEC", "Tizen.NUI.Components.InputFieldAttributes.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Clone_CHECK_RETURN_VALUE() - { - var inputFieldAttributes = new InputFieldAttributes(); - inputFieldAttributes.InputBoxAttributes = new TextFieldAttributes() { Text = new StringSelector() { All = "test" } }; - var inputFieldAttributes2 = inputFieldAttributes.Clone() as InputFieldAttributes; - Assert.AreEqual(inputFieldAttributes.InputBoxAttributes.Text.All, inputFieldAttributes2.InputBoxAttributes.Text.All, "Retrieved InputBoxAttributes should be equal to clone value"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSIntSelector.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSIntSelector.cs deleted file mode 100755 index 56df5a11e..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSIntSelector.cs +++ /dev/null @@ -1,64 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Threading.Tasks; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.IntSelector Tests")] - public class IntSelectorTests - { - private const string TAG = "NUI.Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("IntSelectorTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a IntSelector object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.IntSelector.IntSelector C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void IntSelector_INIT() - { - /* TEST CODE */ - var intSelector = new IntSelector(); - Assert.IsNotNull(intSelector, "Can't create success object IntSelector"); - Assert.IsInstanceOf(intSelector, "Should be an instance of IntSelector type."); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check Whether Clone works or not")] - [Property("SPEC", "Tizen.NUI.Components.IntSelector.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Clone_TEST() - { - /* TEST CODE */ - var intSelector1 = new IntSelector(); - intSelector1.All = 0; - var intSelector = intSelector1.Clone(); - Assert.IsNotNull(intSelector, "should be not null!"); - Assert.AreEqual(0, intSelector.All); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSLinearLayoutManager.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSLinearLayoutManager.cs deleted file mode 100755 index 4aa21f28c..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSLinearLayoutManager.cs +++ /dev/null @@ -1,455 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Threading.Tasks; -using System.Collections.Generic; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.LinearLayoutManager Tests")] - public class LinearLayoutManagerTests - { - private const string TAG = "NUI.Components"; - private FlexibleView _flexibleView = null; - private ListBridge _adapter = null; - private LinearLayoutManager _layoutManager = null; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("LinearLayoutManagerTests"); - App.MainTitleChangeBackgroundColor(null); - CreateFlexiableView(); - } - - public void CreateFlexiableView() - { - _flexibleView = new FlexibleView(); - _flexibleView.Name = "RecyclerView"; - _flexibleView.Position2D = new Position2D(500, 200); - _flexibleView.Size2D = new Size2D(400, 450); - _flexibleView.Padding = new Extents(10, 10, 10, 10); - _flexibleView.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.4f); - _flexibleView.Focusable = true; - - List dataList = new List(); - for (int i = 0; i < 131; ++i) - { - dataList.Add(new ListItemData(i)); - } - _adapter = new ListBridge(dataList); - _flexibleView.SetAdapter(_adapter); - _layoutManager = new LinearLayoutManager(LinearLayoutManager.VERTICAL); - _flexibleView.SetLayoutManager(_layoutManager); - - Window.Instance.Add(_flexibleView); - FocusManager.Instance.SetCurrentFocusView(_flexibleView); - _flexibleView.FocusedItemIndex = 0; - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a LinearLayoutManager object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.LinearLayoutManager C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void LinearLayoutManager_INIT() - { - /* TEST CODE */ - var layoutManager = new LinearLayoutManager(LinearLayoutManager.VERTICAL); - Assert.IsNotNull(layoutManager, "Can't create success object LinearLayoutManager"); - Assert.IsInstanceOf(layoutManager, "Should be an instance of LinearLayoutManager type."); - } - - [Test] - [Category("P1")] - [Description("Test HORIZONTAL.Check whether HORIZONTAL is readable.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.HORIZONTAL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void HORIZONTAL_GET_VALUE() - { - /* TEST CODE */ - Assert.AreEqual(0, LinearLayoutManager.HORIZONTAL, "Should be equals to the set value of INVALID_TYPE."); - } - - [Test] - [Category("P1")] - [Description("Test VERTICAL.Check whether VERTICAL is readable.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.VERTICAL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void VERTICAL_GET_VALUE() - { - /* TEST CODE */ - Assert.AreEqual(1, LinearLayoutManager.VERTICAL, "Should be equals to the set value of INVALID_TYPE."); - } - - [Test] - [Category("P1")] - [Description("Test NO_POSITION.Check whether NO_POSITION is readable.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.NO_POSITION A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void NO_POSITION_GET_VALUE() - { - /* TEST CODE */ - Assert.AreEqual(FlexibleView.NO_POSITION, LinearLayoutManager.NO_POSITION, "Should be equals to the set value of INVALID_TYPE."); - } - - [Test] - [Category("P1")] - [Description("Test INVALID_OFFSET.Check whether INVALID_OFFSET is readable.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.INVALID_OFFSET A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void INVALID_OFFSET_GET_VALUE() - { - /* TEST CODE */ - Assert.AreEqual(-2147483648, LinearLayoutManager.INVALID_OFFSET, "Should be equals to the set value of INVALID_TYPE."); - } - - [Test] - [Category("P1")] - [Description("Test FirstCompleteVisibleItemPosition. Check FirstCompleteVisibleItemPosition works or not.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.FirstCompleteVisibleItemPosition A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void FirstCompleteVisibleItemPosition_GET_VALUE() - { - /* TEST CODE */ - _flexibleView.Relayout += FirstCompleteVisibleItemPositionRelayout; - _flexibleView.Relayout -= FirstCompleteVisibleItemPositionRelayout; - } - - private void FirstCompleteVisibleItemPositionRelayout(object sender, EventArgs args) - { - Assert.AreEqual(0, _layoutManager.FirstCompleteVisibleItemPosition, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test FirstVisibleItemPosition. Check FirstVisibleItemPosition works or not.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.FirstVisibleItemPosition A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void FirstVisibleItemPosition_GET_VALUE() - { - /* TEST CODE */ - _flexibleView.Relayout += FirstVisibleItemPositionRelayout; - _flexibleView.Relayout -= FirstVisibleItemPositionRelayout; - } - - private void FirstVisibleItemPositionRelayout(object sender, EventArgs args) - { - Assert.AreEqual(0, _layoutManager.FirstVisibleItemPosition, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test LastVisibleItemPosition. Check LastVisibleItemPosition works or not.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.LastVisibleItemPosition A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void LastVisibleItemPosition_GET_VALUE() - { - /* TEST CODE */ - _flexibleView.Relayout += LastVisibleItemPositionRelayout; - _flexibleView.Relayout -= LastVisibleItemPositionRelayout; - } - - private void LastVisibleItemPositionRelayout(object sender, EventArgs args) - { - Assert.AreEqual(6, _layoutManager.LastVisibleItemPosition, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test LastCompleteVisibleItemPosition. Check LastCompleteVisibleItemPosition works or not.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.LastCompleteVisibleItemPosition A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void LastCompleteVisibleItemPosition_GET_VALUE() - { - /* TEST CODE */ - _flexibleView.Relayout += LastCompleteVisibleItemPositionRelayout; - _flexibleView.Relayout -= LastCompleteVisibleItemPositionRelayout; - } - - private void LastCompleteVisibleItemPositionRelayout(object sender, EventArgs args) - { - Assert.AreEqual(5, _layoutManager.LastCompleteVisibleItemPosition, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test CanScrollHorizontally. Check whether CanScrollHorizontally works or not.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.CanScrollHorizontally M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void CanScrollHorizontally_TEST() - { - /* TEST CODE */ - Assert.IsFalse(_layoutManager.CanScrollHorizontally(), "Should be false"); - var layoutManager = new LinearLayoutManager(LinearLayoutManager.HORIZONTAL); - Assert.IsTrue(layoutManager.CanScrollHorizontally(), "Should be true"); - } - - [Test] - [Category("P1")] - [Description("Test CanScrollVertically. Check whether CanScrollVertically works or not.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.CanScrollVertically M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void CanScrollVertically_TEST() - { - /* TEST CODE */ - Assert.IsTrue(_layoutManager.CanScrollVertically(), "Should be true"); - var layoutManager = new LinearLayoutManager(LinearLayoutManager.HORIZONTAL); - Assert.IsFalse(layoutManager.CanScrollVertically(), "Should be false"); - } - - [Test] - [Category("P1")] - [Description("Test ComputeScrollExtent. Check whether ComputeScrollExtent works or not.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.ComputeScrollExtent M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ComputeScrollExtent_TEST() - { - /* TEST CODE */ - Assert.AreEqual(0, _layoutManager.ComputeScrollExtent(), "Should be equal"); - } - - [Test] - [Category("P1")] - [Description("Test ComputeScrollOffset. Check whether ComputeScrollOffset works or not.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.ComputeScrollOffset M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ComputeScrollOffset_TEST() - { - /* TEST CODE */ - Assert.AreEqual(0, _layoutManager.ComputeScrollOffset(), "Should be equal"); - } - - [Test] - [Category("P1")] - [Description("Test ComputeScrollRange. Check whether ComputeScrollRange works or not.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.ComputeScrollRange M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ComputeScrollRange_TEST() - { - /* TEST CODE */ - Assert.AreEqual(0, _layoutManager.ComputeScrollRange(), "Should be false"); - } - - [Test] - [Category("P1")] - [Description("Test OnLayoutCompleted. Check whether OnLayoutCompleted works or not.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.OnLayoutCompleted M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OnLayoutCompleted_TEST() - { - /* TEST CODE */ - try - { - _layoutManager.OnLayoutCompleted(); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test GetNextPosition. Check whether GetNextPosition works or not.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.GetNextPosition M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetNextPosition_TEST() - { - /* TEST CODE */ - try - { - var myLinearLayoutManager = new MyLinearLayoutManager(LinearLayoutManager.VERTICAL); - Assert.AreEqual(1, myLinearLayoutManager.TestGetNextPosition(0, FlexibleView.LayoutManager.Direction.Down), "Should be equal!"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test ScrollToPosition. Check whether ScrollToPosition works or not.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.ScrollToPosition M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ScrollToPosition_TEST() - { - /* TEST CODE */ - try - { - _layoutManager.ScrollToPosition(0); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test ScrollToPositionWithOffset. Check whether ScrollToPositionWithOffset works or not.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.ScrollToPositionWithOffset M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ScrollToPositionWithOffset_TEST() - { - /* TEST CODE */ - try - { - _layoutManager.ScrollToPositionWithOffset(0, 0); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test OnLayoutChildren. Check whether OnLayoutChildren works or not.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.OnLayoutChildren M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OnLayoutChildren_TEST() - { - /* TEST CODE */ - try - { - _flexibleView.MoveFocus(FlexibleView.LayoutManager.Direction.Down); - _flexibleView.Relayout += OnLayoutChildrenRelayout; - _flexibleView.Relayout -= OnLayoutChildrenRelayout; - } - catch (Exception e) - { - Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - private void OnLayoutChildrenRelayout(object sender, EventArgs args) - { - var recycler = _flexibleView.GetRecycler(); - _layoutManager.OnLayoutChildren(recycler); - } - - [Test] - [Category("P1")] - [Description("Test ScrollVerticallyBy. Check whether ScrollVerticallyBy works or not.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.ScrollVerticallyBy M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ScrollVerticallyBy_TEST() - { - /* TEST CODE */ - try - { - var recycler = new FlexibleView.Recycler(_flexibleView); - _layoutManager.ScrollVerticallyBy(0, recycler, true); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test ScrollHorizontallyBy. Check whether ScrollHorizontallyBy works or not.")] - [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.ScrollHorizontallyBy M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ScrollHorizontallyBy_TEST() - { - /* TEST CODE */ - try - { - var recycler = new FlexibleView.Recycler(_flexibleView); - _layoutManager.ScrollHorizontallyBy(0, recycler, true); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - } - - public class MyLinearLayoutManager : LinearLayoutManager - { - public MyLinearLayoutManager(int orientation) : base(orientation) - { - - } - public int TestGetNextPosition(int position, Direction direction) - { - return GetNextPosition(position, direction); - } - - protected override int GetNextPosition(int position, Direction direction) - { - switch (direction) - { - case FlexibleView.LayoutManager.Direction.Up: - if (position > 0) - { - return position - 1; - } - break; - case FlexibleView.LayoutManager.Direction.Down: - return position + 1; - break; - } - - return FlexibleView.NO_POSITION; - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSLoading.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSLoading.cs index 21bd8f5ca..73e881c99 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSLoading.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSLoading.cs @@ -44,39 +44,6 @@ namespace Tizen.NUI.Components.Tests Assert.IsInstanceOf(loading, "Should be an instance of Loading type."); } - [Test] - [Category("P1")] - [Description("Create a Loading object with attributes. Check whether object whose text is initialized is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Loading.Loading C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "LoadingAttributes")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Loading_INIT_WITH_LoadingAttributes() - { - /* TEST CODE */ - var loading = new Loading(new LoadingAttributes()); - Assert.IsNotNull(loading, "Can't create success object Loading"); - Assert.IsInstanceOf(loading, "Should be an instance of textLabel type."); - } - - [Test] - [Category("P1")] - [Description("Create a Loading object with string. Check whether object whose text is initialized is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Loading.Loading C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Loading_INIT_WITH_STRING() - { - /* TEST CODE */ - StyleManager.Instance.RegisterStyle("DefaultLoading", null, typeof(DefaultLoadingStyle)); - var loading = new Loading("DefaultLoading"); - Assert.IsNotNull(loading, "Can't create success object Loading"); - Assert.IsInstanceOf(loading, "Should be an instance of Loading type."); - } - [Test] [Category("P1")] [Description("Test ImageArray. Check whether ImageArray works or not.")] @@ -90,6 +57,7 @@ namespace Tizen.NUI.Components.Tests try { var loading = new Loading(); + Assert.IsNotNull(loading, "Can't create success object Loading"); Assert.IsInstanceOf(loading, "Should be an instance of Loading type"); loading.ImageArray = new string[] {"aaa", "bbb"}; string[] imageArray = loading.ImageArray; @@ -106,87 +74,37 @@ namespace Tizen.NUI.Components.Tests [Test] [Category("P1")] - [Description("Test LoadingSize. Check whether LoadingSize works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Loading.LoadingSize A")] + [Description("Test Size. Check whether Size works or not.")] + [Property("SPEC", "Tizen.NUI.Components.Loading.Size A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void LoadingSize_SET_GET_VALUE() + public void Size_SET_GET_VALUE() { /* TEST CODE */ var loading = new Loading(); + Assert.IsNotNull(loading, "Can't create success object Loading"); Assert.IsInstanceOf(loading, "Should be an instance of Loading type"); - loading.LoadingSize = new Size2D(100, 100); - Assert.AreEqual(100, loading.LoadingSize.Width, "Retrieved LoadingSize width should be equal to set value"); - Assert.AreEqual(100, loading.LoadingSize.Height, "Retrieved LoadingSize height should be equal to set value"); + loading.Size = new Size(100, 100); + Assert.AreEqual(100, loading.Size.Width, "Retrieved LoadingSize width should be equal to set value"); + Assert.AreEqual(100, loading.Size.Height, "Retrieved LoadingSize height should be equal to set value"); } [Test] [Category("P1")] - [Description("Test FPS. Check whether FPS works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Loading.FPS A")] + [Description("Test FrameRate. Check whether FrameRate works or not.")] + [Property("SPEC", "Tizen.NUI.Components.Loading.FrameRate A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void FPS_SET_GET_VALUE() + public void FrameRate_SET_GET_VALUE() { /* TEST CODE */ var loading = new Loading(); + Assert.IsNotNull(loading, "Can't create success object Loading"); Assert.IsInstanceOf(loading, "Should be an instance of Loading type"); - loading.FPS = 33; - Assert.AreEqual(33, loading.FPS, "Retrieved FPS should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test GetAttributes. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Loading.GetAttributes M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void GetAttributes_CHECK_VALUE() - { - /* TEST CODE */ - try - { - var myLoading = new MyLoading(); - Assert.IsTrue(myLoading.flagGetAttributes, "GetAttributes trigger Check Fail."); - } - 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 OnUpdate. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Loading.OnUpdate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public async Task OnUpdate_CHECK_VALUE() - { - /* TEST CODE */ - var myLoading = new MyLoading(); - Window.Instance.Add(myLoading); - try - { - await Task.Delay(200); - Assert.IsTrue(myLoading.flagOnUpdate, "OnUpdate trigger Check Fail."); - } - 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(myLoading); - } + loading.FrameRate = 33; + Assert.AreEqual(33, loading.FrameRate, "Retrieved FrameRate should be equal to set value"); } [Test] @@ -202,6 +120,8 @@ namespace Tizen.NUI.Components.Tests try { Loading loading = new Loading(); + Assert.IsNotNull(loading, "Can't create success object Loading"); + Assert.IsInstanceOf(loading, "Should be an instance of Loading type"); loading.Dispose(); } catch (Exception e) @@ -213,53 +133,4 @@ namespace Tizen.NUI.Components.Tests } } - public class MyLoading : Loading - { - public bool flagGetAttributes = false; - public bool flagOnUpdate = false; - - public MyLoading() : base() - { } - - public MyLoading(string style) : base(style) - { } - - protected override Attributes GetAttributes() - { - flagGetAttributes = true; - return new LoadingAttributes(); - } - - protected override void OnUpdate() - { - base.OnUpdate(); - flagOnUpdate = true; - } - } - - internal class DefaultLoadingStyle : StyleBase - { - protected override Attributes GetAttributes() - { - if (Content != null) - { - return (Content as Attributes).Clone(); - } - string[] imageArray = new string[36]; - for (int i = 0; i < 36; i++) - { - if (i < 10) - { - imageArray[i] = "9. Controller/Loading Sequence_Native/loading_0" + i + ".png"; - } - else - { - imageArray[i] = "9. Controller/Loading Sequence_Native/loading_" + i + ".png"; - } - } - - LoadingAttributes attributes = new LoadingAttributes { ImageArray = imageArray }; - return attributes; - } - } } diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSLoadingAttributes.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSLoadingAttributes.cs deleted file mode 100755 index 7e98ff684..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSLoadingAttributes.cs +++ /dev/null @@ -1,124 +0,0 @@ -using NUnit.Framework; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.LoadingAttributes Tests")] - public class LoadingAttributesTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("LoadingAttributesTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a LoadingAttributes object. Check whether LoadingAttributes is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.LoadingAttributes.LoadingAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void LoadingAttributes_INIT() - { - /* TEST CODE */ - var loadingAttributes = new LoadingAttributes(); - Assert.IsNotNull(loadingAttributes, "Can't create success object LoadingAttributes"); - Assert.IsInstanceOf(loadingAttributes, "Should be an instance of LoadingAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Create a LoadingAttributes object. Check whether LoadingAttributes is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.LoadingAttributes.LoadingAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "LoadingAttributes")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void LoadingAttributes_INIT_WITH_LoadingAttributes() - { - /* TEST CODE */ - var loadingAttributes = new LoadingAttributes(); - var loadingAttributes2 = new LoadingAttributes(loadingAttributes); - Assert.IsNotNull(loadingAttributes2, "Can't create success object LoadingAttributes"); - Assert.IsInstanceOf(loadingAttributes2, "Should be an instance of LoadingAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Test ImageArray. Check whether ImageArray is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.LoadingAttributes.ImageArray A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void ImageArray_SET_GET_VALUE() - { - /* TEST CODE */ - var loadingAttributes = new LoadingAttributes(); - string[] imageArray = new string[3]{"aaa", "bbb", "ccc"}; - loadingAttributes.ImageArray = imageArray; - Assert.AreEqual(imageArray[0], loadingAttributes.ImageArray[0], "Retrieved ImageArray should be equal to set value"); - Assert.AreEqual(imageArray[1], loadingAttributes.ImageArray[1], "Retrieved ImageArray should be equal to set value"); - Assert.AreEqual(imageArray[2], loadingAttributes.ImageArray[2], "Retrieved ImageArray should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test LoadingSize. Check whether LoadingSize is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.LoadingAttributes.LoadingSize A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void LoadingSize_SET_GET_VALUE() - { - /* TEST CODE */ - var loadingAttributes = new LoadingAttributes(); - loadingAttributes.LoadingSize = new Size2D(30, 40); - Assert.AreEqual(30, loadingAttributes.LoadingSize.Width, "Retrieved LoadingSize should be equal to set value"); - Assert.AreEqual(40, loadingAttributes.LoadingSize.Height, "Retrieved LoadingSize should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test FPS. Check whether FPS is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.LoadingAttributes.FPS A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void FPS_SET_GET_VALUE() - { - /* TEST CODE */ - var loadingAttributes = new LoadingAttributes(); - IntSelector intSelector = new IntSelector() { All = 60 }; - loadingAttributes.FPS = intSelector; - Assert.AreEqual(intSelector.All, loadingAttributes.FPS.All, "Retrieved FPS should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check whether Clone works or not")] - [Property("SPEC", "Tizen.NUI.Components.LoadingAttributes.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Clone_CHECK_RETURN_VALUE() - { - var loadingAttributes = new LoadingAttributes(); - loadingAttributes.FPS = new IntSelector() { All = 60 }; - var loadingAttributes2 = loadingAttributes.Clone() as LoadingAttributes; - Assert.AreEqual(loadingAttributes.FPS.All, loadingAttributes2.FPS.All, "Retrieved FPS should be equal to clone value"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPagination.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPagination.cs deleted file mode 100755 index 16dd4c5ff..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPagination.cs +++ /dev/null @@ -1,440 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Threading.Tasks; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.Pagination Tests")] - public class PaginationTests - { - private string TAG = "NUI.Components.Pagination"; - private string _style = ""; - private string _indicatorBackgroundURL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "pagination_ic_nor.png"; - private string _indicatorSelectURL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "pagination_ic_sel.png"; - private bool _styleRegiesterFlag = false; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("PaginationTests"); - App.MainTitleChangeBackgroundColor(null); - if (!_styleRegiesterFlag) - { - StyleManager.Instance.RegisterStyle("DefaultPagination", null, typeof(Tizen.NUI.Components.Tests.DefaultPaginationStyle)); - _styleRegiesterFlag = true; - } - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a Pagination object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Pagination.Pagination C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Pagination_INIT() - { - /* TEST CODE */ - var pagination = new Pagination(); - Assert.IsNotNull(pagination, "Can't create success object Pagination"); - Assert.IsInstanceOf(pagination, "Should be an instance of Pagination type."); - } - - [Test] - [Category("P1")] - [Description("Create a Pagination object. Check whether Pagination object which set style is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Pagination.Pagination C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Pagination_INIT_WITH_STYLE() - { - /* TEST CODE */ - var pagination = new Pagination("DefaultPagination"); - Assert.IsNotNull(pagination, "Can't create success object Pagination"); - Assert.IsInstanceOf(pagination, "Should be an instance of Pagination type."); - } - - [Test] - [Category("P1")] - [Description("Create a Pagination object. Check whether Pagination object which set attributes is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Pagination.Pagination C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "PaginationAttributes")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Pagination_INIT_WITH_ATTRIBUTES() - { - /* TEST CODE */ - var attrs = new PaginationAttributes(); - attrs.IndicatorSize = new Size2D(15, 15); - attrs.IndicatorBackgroundURL = _indicatorBackgroundURL; - attrs.IndicatorSelectURL = _indicatorSelectURL; - attrs.IndicatorSpacing = 14; - var pagination = new Pagination(attrs); - Assert.IsNotNull(pagination, "Can't create success object Pagination"); - Assert.IsInstanceOf(pagination, "Should be an instance of Pagination type."); - } - - [Test] - [Category("P1")] - [Description("Test IndicatorSpacing.Check whether IndicatorSpacing is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.Pagination.IndicatorSpacing A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void IndicatorSpacing_SET_GET_VALUE() - { - /* TEST CODE */ - var pagination = new Pagination(); - pagination.IndicatorSpacing = 10; - Assert.AreEqual(10, pagination.IndicatorSpacing, "Should be equals to the set value of IndicatorSpacing."); - } - - [Test] - [Category("P1")] - [Description("Test IndicatorSize.Check whether IndicatorSize is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.Pagination.IndicatorSize A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public async Task IndicatorSize_SET_GET_VALUE() - { - /* TEST CODE */ - var pagination = new Pagination(); - pagination.Position2D = new Position2D(500, 450); - pagination.Size2D = new Size2D(400, 30); - pagination.BackgroundColor = new Color(1.0f, 1.0f, 1.0f, 0.6f); - pagination.IndicatorSize = new Size2D(26, 26); - pagination.IndicatorBackgroundURL = _indicatorBackgroundURL; - pagination.IndicatorSelectURL = _indicatorSelectURL; - pagination.IndicatorSpacing = 8; - pagination.IndicatorCount = 5; - pagination.SelectedIndex = 0; - Window.Instance.Add(pagination); - await Task.Delay(500); - Assert.AreEqual(26, pagination.IndicatorSize.Width, "Should be equals to the set value."); - Assert.AreEqual(26, pagination.IndicatorSize.Height, "Should be equals to the set value."); - } - - [Test] - [Category("P1")] - [Description("Test IndicatorCount.Check whether IndicatorCount is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.Pagination.IndicatorCount A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void IndicatorCount_SET_GET_VALUE() - { - /* TEST CODE */ - var pagination = new Pagination(); - pagination.Position2D = new Position2D(500, 450); - pagination.Size2D = new Size2D(400, 30); - pagination.BackgroundColor = new Color(1.0f, 1.0f, 1.0f, 0.6f); - pagination.IndicatorSize = new Size2D(26, 26); - pagination.IndicatorBackgroundURL = _indicatorBackgroundURL; - pagination.IndicatorSelectURL = _indicatorSelectURL; - pagination.IndicatorSpacing = 8; - pagination.IndicatorCount = 5; - pagination.SelectedIndex = 0; - Window.Instance.Add(pagination); - Assert.AreEqual(5, pagination.IndicatorCount, "Should be equals to the set value of IndicatorCount."); - } - - [Test] - [Category("P1")] - [Description("Test SelectedIndex.Check whether SelectedIndex is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.Pagination.SelectedIndex A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void SelectedIndex_SET_GET_VALUE() - { - /* TEST CODE */ - var pagination = new Pagination(); - pagination.SelectedIndex = 5; - Assert.AreEqual(5, pagination.SelectedIndex, "Should be equals to the set value of SelectedIndex."); - } - - [Test] - [Category("P1")] - [Description("Test IndicatorBackgroundURL.Check whether IndicatorBackgroundURL is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.Pagination.IndicatorBackgroundURL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void IndicatorBackgroundURL_SET_GET_VALUE() - { - /* TEST CODE */ - var pagination = new Pagination(); - pagination.IndicatorBackgroundURL = _indicatorBackgroundURL; - Assert.AreEqual(_indicatorBackgroundURL, pagination.IndicatorBackgroundURL, "Should be equals to the set value of IndicatorBackgroundURL."); - } - - [Test] - [Category("P1")] - [Description("Test IndicatorSelectURL.Check whether IndicatorSelectURL is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.Pagination.IndicatorSelectURL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void IndicatorSelectURL_SET_GET_VALUE() - { - /* TEST CODE */ - var pagination = new Pagination(); - pagination.IndicatorSelectURL = _indicatorSelectURL; - Assert.AreEqual(_indicatorSelectURL, pagination.IndicatorSelectURL, "Should be equals to the set value of IndicatorSelectURL."); - } - - [Test] - [Category("P1")] - [Description("Test GetIndicatorPosition.Check whether GetIndicatorPosition works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Pagination.GetIndicatorPosition M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetIndicatorPosition_TEST() - { - /* TEST CODE */ - var pagination = new Pagination(); - pagination.Position2D = new Position2D(500, 450); - pagination.Size2D = new Size2D(400, 30); - pagination.BackgroundColor = new Color(1.0f, 1.0f, 1.0f, 0.6f); - pagination.IndicatorSize = new Size2D(26, 26); - pagination.IndicatorBackgroundURL = _indicatorBackgroundURL; - pagination.IndicatorSelectURL = _indicatorSelectURL; - pagination.IndicatorSpacing = 8; - pagination.IndicatorCount = 5; - pagination.SelectedIndex = 0; - Window.Instance.Add(pagination); - Position2D position = pagination.GetIndicatorPosition(0); - Assert.AreEqual(119, position.X, "Should be equals to the set value."); - Assert.AreEqual(0, position.Y, "Should be equals to the set value."); - } - - [Test] - [Category("P1")] - [Description("Test OnUpdate. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Pagination.OnUpdate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public async Task OnUpdate_CHECK_VALUE() - { - /* TEST CODE */ - try - { - var view = CreatePagination(); - Window window = Window.Instance; - window.Add(view); - await Task.Delay(500); - Assert.AreEqual(true, view.updateFlag, "OnUpdate trigger Check Fail."); - window.Remove(view); - } - catch (Exception e) - { - Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test GetAttributes. Check Whether GetAttributes works or not")] - [Property("SPEC", "Tizen.NUI.Components.Pagination.GetAttributes M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetAttributes_TEST() - { - /* TEST CODE */ - var myPagination = new MyPagination(); - Assert.IsNotNull(myPagination.TestGetAttributes(), "Should be not null"); - Assert.IsInstanceOf(myPagination.TestGetAttributes(), "Should be an instance of PaginationAttributes"); - } - - [Test] - [Category("P1")] - [Description("Test SelectIn. Check Whether SelectIn works or not")] - [Property("SPEC", "Tizen.NUI.Components.Pagination.SelectIn M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void SelectIn_TEST() - { - /* TEST CODE */ - try - { - var myPagination = new MyPagination(); - ImageVisual indicator = new ImageVisual - { - URL = _indicatorBackgroundURL, - Size = new Size2D(36, 36) - }; - indicator.Position = new Position2D(0, 0); - myPagination.TestSelectIn(indicator); - } - catch (Exception e) - { - Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test SelectOut. Check Whether SelectOut works or not")] - [Property("SPEC", "Tizen.NUI.Components.Pagination.SelectOut M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void SelectOut_TEST() - { - /* TEST CODE */ - try - { - var myPagination = new MyPagination(); - ImageVisual indicator = new ImageVisual - { - URL = _indicatorBackgroundURL, - Size = new Size2D(36, 36) - }; - indicator.Position = new Position2D(0, 0); - myPagination.TestSelectOut(indicator); - } - catch (Exception e) - { - Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test Dispose, try to dispose the Pagination.")] - [Property("SPEC", "Tizen.NUI.Components.Pagination.Dispose M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Dispose_TEST() - { - /* TEST CODE */ - try - { - Pagination pagination = new Pagination(); - pagination.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()); - } - } - - private MyPagination CreatePagination() - { - PaginationAttributes attrs = new PaginationAttributes(); - attrs.IndicatorSize = new Size2D(15, 15); - attrs.IndicatorBackgroundURL = _indicatorBackgroundURL; - attrs.IndicatorSelectURL = _indicatorSelectURL; - attrs.IndicatorSpacing = 14; - - MyPagination pagination = new MyPagination(attrs); - pagination.Name = "Pagination2"; - pagination.Position2D = new Position2D(500, 500); - pagination.Size2D = new Size2D(400, 30); - pagination.BackgroundColor = new Color(1.0f, 1.0f, 1.0f, 0.6f); - pagination.IndicatorCount = 6; - pagination.SelectedIndex = 0; - Window.Instance.Add(pagination); - return pagination; - } - } - - public class MyPagination:Pagination - { - public bool updateFlag = false; - - public MyPagination():base() - { - - } - public MyPagination(PaginationAttributes attributes):base(attributes) - { - - } - - public Attributes TestGetAttributes() - { - return GetAttributes(); - } - protected override Attributes GetAttributes() - { - return base.GetAttributes(); - } - - protected override void OnUpdate() - { - updateFlag = true; - base.OnUpdate(); - } - - protected override void SelectIn(VisualMap selectInIndicator) - { - base.SelectIn(selectInIndicator); - } - - protected override void SelectOut(VisualMap selectOutIndicator) - { - base.SelectIn(selectOutIndicator); - } - - public void TestSelectIn(VisualMap selectInIndicator) - { - SelectIn(selectInIndicator); - } - - public void TestSelectOut(VisualMap selectOutIndicator) - { - SelectOut(selectOutIndicator); - } - } - - public class DefaultPaginationStyle : StyleBase - { - private string _indicatorBackgroundURL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "pagination_ic_nor.png"; - private string _indicatorSelectURL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "pagination_ic_sel.png"; - protected override Attributes GetAttributes() - { - if (Content != null) - { - return (Content as Attributes).Clone(); - } - - PaginationAttributes attributes = new PaginationAttributes - { - IndicatorSize = new Size2D(26, 26), - IndicatorBackgroundURL = _indicatorBackgroundURL, - IndicatorSelectURL = _indicatorSelectURL, - IndicatorSpacing = 8, - }; - return attributes; - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPaginationAttributes.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPaginationAttributes.cs deleted file mode 100755 index ecef8c6e9..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPaginationAttributes.cs +++ /dev/null @@ -1,152 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Threading.Tasks; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.PaginationAttributes Tests")] - public class PaginationAttributesTests - { - private const string TAG = "NUI.Components"; - private string _imagePath = ""; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("PaginationAttributesTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a PaginationAttributes object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.PaginationAttributes.PaginationAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void PaginationAttributes_INIT() - { - /* TEST CODE */ - var paginationAttributes = new PaginationAttributes(); - Assert.IsNotNull(paginationAttributes, "Can't create success object PaginationAttributes"); - Assert.IsInstanceOf(paginationAttributes, "Should be an instance of PaginationAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Create a PaginationAttributes object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.PaginationAttributes.PaginationAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "PaginationAttributes")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void PaginationAttributes_INIT_WITH_PAGINATIONATTRIBUTES() - { - /* TEST CODE */ - var paginationAttributes1 = new PaginationAttributes(); - var paginationAttributes = new PaginationAttributes(paginationAttributes1); - Assert.IsNotNull(paginationAttributes, "Can't create success object PaginationAttributes"); - Assert.IsInstanceOf(paginationAttributes, "Should be an instance of PaginationAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Test IndicatorBackgroundURL.Check whether IndicatorBackgroundURL is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.PaginationAttributes.IndicatorBackgroundURL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void IndicatorBackgroundURL_SET_GET_VALUE() - { - /* TEST CODE */ - var paginationAttributes = new PaginationAttributes(); - paginationAttributes.IndicatorBackgroundURL = _imagePath; - Assert.AreEqual(_imagePath, paginationAttributes.IndicatorBackgroundURL, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test IndicatorSelectURL.Check whether IndicatorSelectURL is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.PaginationAttributes.IndicatorSelectURL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void IndicatorSelectURL_SET_GET_VALUE() - { - /* TEST CODE */ - var paginationAttributes = new PaginationAttributes(); - paginationAttributes.IndicatorSelectURL = _imagePath; - Assert.AreEqual(_imagePath, paginationAttributes.IndicatorSelectURL, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test IndicatorSpacing.Check whether IndicatorSpacing is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.PaginationAttributes.IndicatorSpacing A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void IndicatorSpacing_SET_GET_VALUE() - { - /* TEST CODE */ - var paginationAttributes = new PaginationAttributes(); - paginationAttributes.IndicatorSpacing = 10; - Assert.AreEqual(10, paginationAttributes.IndicatorSpacing, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test IndicatorSize.Check whether IndicatorSize is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.PaginationAttributes.IndicatorSize A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void IndicatorSize_SET_GET_VALUE() - { - /* TEST CODE */ - var paginationAttributes = new PaginationAttributes(); - paginationAttributes.IndicatorSize = new Size2D(32, 32); - Assert.AreEqual(32, paginationAttributes.IndicatorSize.Width, "Should be equal!"); - Assert.AreEqual(32, paginationAttributes.IndicatorSize.Height, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check Whether Clone works or not")] - [Property("SPEC", "Tizen.NUI.Components.PaginationAttributes.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Clone_TEST() - { - /* TEST CODE */ - try - { - var paginationAttributes = new PaginationAttributes(); - paginationAttributes.IndicatorSpacing = 10; - var attributes = paginationAttributes.Clone() as PaginationAttributes; - Assert.IsNotNull(attributes, "Should be not null"); - Assert.IsInstanceOf(attributes, "Should be an instance of PaginationAttributes type."); - Assert.AreEqual(10, attributes.IndicatorSpacing, "Should be equal!"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - } -} 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 index bd03c4b5a..cef062fa5 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopup.ButtonClickEventArgs.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopup.ButtonClickEventArgs.cs @@ -59,6 +59,9 @@ namespace Tizen.NUI.Components.Tests { /* 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 index 72d033315..f9a8ece77 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopup.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopup.cs @@ -57,107 +57,6 @@ namespace Tizen.NUI.Components.Tests [Test] [Category("P1")] - [Description("Test Popup style constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Popup.Popup C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Popup_Style_CHECK_VALUE() - { - /* TEST CODE */ - StyleManager.Instance.RegisterStyle("PopupStyle", null, typeof(PopupStyle)); - var popup = new Components.Popup("PopupStyle"); - Assert.IsNotNull(popup, "Should be not Null!"); - Assert.IsInstanceOf(popup, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Popup PopupAttributes constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Popup.Popup C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "PopupAttributes")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Popup_PopupAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var attrs = new PopupAttributes - { - MinimumSize = new Size2D(1032, 184), - ShadowOffset = new Vector4(24, 24, 24, 24), - TitleTextAttributes = new TextAttributes - { - PointSize = new FloatSelector { All = 25 }, - TextColor = new ColorSelector { All = Color.Black }, - Size2D = new Size2D(0, 68), - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft, - PivotPoint = Tizen.NUI.PivotPoint.TopLeft, - HorizontalAlignment = HorizontalAlignment.Begin, - VerticalAlignment = VerticalAlignment.Bottom, - Position2D = new Position2D(64, 52), - Text = new StringSelector { All = "Popup Title" }, - }, - BackgroundImageAttributes = new ImageAttributes - { - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.Center, - PivotPoint = Tizen.NUI.PivotPoint.Center, - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent, - ResourceURL = new StringSelector { All = _image_path }, - Border = new RectangleSelector { All = new Rectangle(0, 0, 81, 81) }, - }, - ButtonAttributes = new ButtonAttributes - { - Size2D = new Size2D(0, 132), - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft, - PivotPoint = Tizen.NUI.PivotPoint.BottomLeft, - BackgroundImageAttributes = new ImageAttributes - { - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.Center, - PivotPoint = Tizen.NUI.PivotPoint.Center, - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent, - ResourceURL = new StringSelector { All = _image_path }, - Border = new RectangleSelector { All = new Rectangle(5, 5, 5, 5) }, - }, - OverlayImageAttributes = new ImageAttributes - { - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.Center, - PivotPoint = Tizen.NUI.PivotPoint.Center, - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent, - BackgroundColor = new ColorSelector - { - 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), - }, - }, - TextAttributes = new TextAttributes - { - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.Center, - PivotPoint = Tizen.NUI.PivotPoint.Center, - HorizontalAlignment = HorizontalAlignment.Center, - VerticalAlignment = VerticalAlignment.Center, - TextColor = new ColorSelector { All = Color.Cyan }, - }, - }, - }; - var popup = new Components.Popup(attrs); - Assert.IsNotNull(popup, "Should be not Null!"); - Assert.IsInstanceOf(popup, "Should be equal!"); - } - - [Test] - [Category("P1")] [Description("Test TitleText. Check whether TitleText is readable and writable.")] [Property("SPEC", "Tizen.NUI.Components.Popup.TitleText A")] [Property("SPEC_URL", "-")] @@ -167,6 +66,9 @@ namespace Tizen.NUI.Components.Tests { /* 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"); } @@ -182,6 +84,9 @@ namespace Tizen.NUI.Components.Tests { /* 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"); } @@ -201,72 +106,6 @@ namespace Tizen.NUI.Components.Tests Assert.IsInstanceOf(popup.ContentView, "Should be an instance of view!"); } - [Test] - [Category("P1")] - [Description("Test ShadowImageURL. Check whether ShadowImageURL is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.ShadowImageURL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ShadowImageURL_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - popup.ShadowImageURL = _image_path; - Assert.AreEqual(_image_path, popup.ShadowImageURL, "Should be equals to the set value of ShadowImageURL"); - } - - [Test] - [Category("P1")] - [Description("Test ShadowImageBorder. Check whether ShadowImageBorder is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.ShadowImageBorder A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ShadowImageBorder_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - popup.ShadowImageBorder = new Rectangle(0, 0, 10, 10); - Assert.AreEqual(0, popup.ShadowImageBorder.X, "Retrieved ShadowImageBorder should be equal to set value"); - Assert.AreEqual(0, popup.ShadowImageBorder.Y, "Retrieved ShadowImageBorder should be equal to set value"); - Assert.AreEqual(10, popup.ShadowImageBorder.Width, "Retrieved ShadowImageBorder should be equal to set value"); - Assert.AreEqual(10, popup.ShadowImageBorder.Height, "Retrieved ShadowImageBorder should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test BackgroundImageURL. Check whether BackgroundImageURL is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.BackgroundImageURL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void BackgroundImageURL_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - popup.BackgroundImageURL = _image_path; - Assert.AreEqual(_image_path, popup.BackgroundImageURL, "Should be equals to the set value of BackgroundImageURL"); - } - - [Test] - [Category("P1")] - [Description("Test BackgroundImageBorder. Check whether BackgroundImageBorder is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.BackgroundImageBorder A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void BackgroundImageBorder_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - popup.BackgroundImageBorder = new Rectangle(0, 0, 10, 10); - Assert.AreEqual(0, popup.BackgroundImageBorder.X, "Retrieved BackgroundImageBorder should be equal to set value"); - Assert.AreEqual(0, popup.BackgroundImageBorder.Y, "Retrieved BackgroundImageBorder should be equal to set value"); - Assert.AreEqual(10, popup.BackgroundImageBorder.Width, "Retrieved BackgroundImageBorder should be equal to set value"); - Assert.AreEqual(10, popup.BackgroundImageBorder.Height, "Retrieved BackgroundImageBorder should be equal to set value"); - } - [Test] [Category("P1")] [Description("Test TitlePointSize. Check whether TitlePointSize is readable and writable.")] @@ -278,25 +117,13 @@ namespace Tizen.NUI.Components.Tests { /* 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 TitleFontFamily. Check whether TitleFontFamily is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.TitleFontFamily A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TitleFontFamily_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - popup.TitleFontFamily = "SamsungOne 500"; - Assert.AreEqual("SamsungOne 500", popup.TitleFontFamily, "Should be equals to the set value of TitleFontFamily"); - } - [Test] [Category("P1")] [Description("Test TitleTextColor. Check whether TitleTextColor is readable and writable.")] @@ -308,7 +135,12 @@ namespace Tizen.NUI.Components.Tests { /* 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"); @@ -329,25 +161,31 @@ namespace Tizen.NUI.Components.Tests { /* 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 TitleTextPosition2D. Check whether TitleTextPosition2D is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.TitleTextPosition2D A")] + [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 TitleTextPosition2D_SET_GET_VALUE() + public void TitleTextPosition_SET_GET_VALUE() { /* TEST CODE */ var popup = new Components.Popup(); - popup.TitleTextPosition2D = new Position2D(10, 10); + Assert.IsNotNull(popup, "Should be not Null!"); + Assert.IsInstanceOf(popup, "Should be equal!"); + + popup.TitleTextPosition = new Position(10, 10); - Assert.AreEqual(10, popup.TitleTextPosition2D.X, "Should be equal"); - Assert.AreEqual(10, popup.TitleTextPosition2D.Y, "Should be equal"); + Assert.AreEqual(10, popup.TitleTextPosition.X, "Should be equal"); + Assert.AreEqual(10, popup.TitleTextPosition.Y, "Should be equal"); } [Test] @@ -361,29 +199,13 @@ namespace Tizen.NUI.Components.Tests { /* 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 ShadowOffset. Check whether ShadowOffset is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.ShadowOffset A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ShadowOffset_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - popup.ShadowOffset = new Vector4(10, 10, 10, 10); - - Assert.AreEqual(10, popup.ShadowOffset.X, "Should be equals!"); - Assert.AreEqual(10, popup.ShadowOffset.Y, "Should be equals!"); - Assert.AreEqual(10, popup.ShadowOffset.Z, "Should be equals!"); - Assert.AreEqual(10, popup.ShadowOffset.W, "Should be equals!"); - } - [Test] [Category("P1")] [Description("Test ButtonHeight. Check whether ButtonHeight is readable and writable.")] @@ -395,23 +217,29 @@ namespace Tizen.NUI.Components.Tests { /* 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 ButtonPointSize. Check whether ButtonPointSize is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.ButtonPointSize A")] + [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 ButtonPointSize_SET_GET_VALUE() + public void ButtonTextPointSize_SET_GET_VALUE() { /* TEST CODE */ var popup = new Components.Popup(); - popup.ButtonPointSize = 10.0f; - Assert.AreEqual(10.0f, popup.ButtonPointSize, "Should be equals to the set value of ButtonPointSize"); + 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] @@ -425,39 +253,13 @@ namespace Tizen.NUI.Components.Tests { /* 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 ButtonOverLayBackgroundColorSelector. Check whether ButtonOverLayBackgroundColorSelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.ButtonOverLayBackgroundColorSelector A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ButtonOverLayBackgroundColorSelector_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - var colorSelector = new ColorSelector - { - Normal = new Color(0.0f, 0.0f, 1.0f, 1.0f), - Selected = new Color(0.0f, 1.0f, 0.0f, 1.0f), - }; - - popup.ButtonOverLayBackgroundColorSelector = colorSelector; - Assert.AreEqual(colorSelector.Normal.R, popup.ButtonOverLayBackgroundColorSelector.Normal.R, "Should be equals to the set value of ButtonOverLayBackgroundColorSelector Normal R"); - Assert.AreEqual(colorSelector.Normal.G, popup.ButtonOverLayBackgroundColorSelector.Normal.G, "Should be equals to the set value of ButtonOverLayBackgroundColorSelector Normal G"); - Assert.AreEqual(colorSelector.Normal.B, popup.ButtonOverLayBackgroundColorSelector.Normal.B, "Should be equals to the set value of ButtonOverLayBackgroundColorSelector Normal B"); - Assert.AreEqual(colorSelector.Normal.A, popup.ButtonOverLayBackgroundColorSelector.Normal.A, "Should be equals to the set value of ButtonOverLayBackgroundColorSelector Normal A"); - - Assert.AreEqual(colorSelector.Selected.R, popup.ButtonOverLayBackgroundColorSelector.Selected.R, "Should be equals to the set value of ButtonOverLayBackgroundColorSelector Selected R"); - Assert.AreEqual(colorSelector.Selected.G, popup.ButtonOverLayBackgroundColorSelector.Selected.G, "Should be equals to the set value of ButtonOverLayBackgroundColorSelector Selected G"); - Assert.AreEqual(colorSelector.Selected.B, popup.ButtonOverLayBackgroundColorSelector.Selected.B, "Should be equals to the set value of ButtonOverLayBackgroundColorSelector Selected B"); - Assert.AreEqual(colorSelector.Selected.A, popup.ButtonOverLayBackgroundColorSelector.Selected.A, "Should be equals to the set value of ButtonOverLayBackgroundColorSelector Selected A"); - } - [Test] [Category("P1")] [Description("Test ButtonTextAlignment. Check whether ButtonTextAlignment is readable and writable.")] @@ -469,6 +271,9 @@ namespace Tizen.NUI.Components.Tests { /* 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"); } @@ -484,7 +289,12 @@ namespace Tizen.NUI.Components.Tests { /* 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"); @@ -495,158 +305,6 @@ namespace Tizen.NUI.Components.Tests [Test] [Category("P1")] - [Description("Test ButtonBackgroundImageURL. Check whether ButtonBackgroundImageURL is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.ButtonBackgroundImageURL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ButtonBackgroundImageURL_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - popup.ButtonBackgroundImageURL = _image_path; - Assert.AreEqual(_image_path, popup.ButtonBackgroundImageURL, "Should be equals to the set value of ButtonBackgroundImageURL"); - } - - [Test] - [Category("P1")] - [Description("Test ButtonBackgroundImageBorder. Check whether ButtonBackgroundImageBorder is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Popup.ButtonBackgroundImageBorder A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ButtonBackgroundImageBorder_SET_GET_VALUE() - { - /* TEST CODE */ - var popup = new Components.Popup(); - popup.ButtonBackgroundImageBorder = new Rectangle(0, 0, 10, 10); - Assert.AreEqual(0, popup.ButtonBackgroundImageBorder.X, "Retrieved ButtonBackgroundImageBorder should be equal to set value"); - Assert.AreEqual(0, popup.ButtonBackgroundImageBorder.Y, "Retrieved ButtonBackgroundImageBorder should be equal to set value"); - Assert.AreEqual(10, popup.ButtonBackgroundImageBorder.Width, "Retrieved ButtonBackgroundImageBorder should be equal to set value"); - Assert.AreEqual(10, popup.ButtonBackgroundImageBorder.Height, "Retrieved ButtonBackgroundImageBorder should be equal to set value"); - } - - public class MyPopup : Components.Popup - { - public override void OnFocusGained() - { - _focusGainedFlag = true; - base.OnFocusGained(); - } - - public override void OnFocusLost() - { - _focusLostFlag = true; - base.OnFocusLost(); - } - - protected override Attributes GetAttributes() - { - return base.GetAttributes(); - } - - public Attributes TestGetAttributes() - { - return GetAttributes(); - } - - protected override void OnUpdate() - { - _updateFlag = true; - base.OnUpdate(); - } - - protected override void LayoutChild() - { - _layoutChildFlag = true; - base.LayoutChild(); - } - - protected override void OnThemeChangedEvent(object sender, Components.StyleManager.ThemeChangeEventArgs e) - { - _themeFlag = true; - base.OnThemeChangedEvent(sender, e); - } - } - - [Test] - [Category("P1")] - [Description("Test OnFocusGained. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Popup.OnFocusGained M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void OnFocusGained_CHECK_VALUE() - { - /* TEST CODE */ - _focusGainedFlag = false; - var myPopup = new MyPopup(); - myPopup.Focusable = true; - Window.Instance.Add(myPopup); - FocusManager.Instance.SetCurrentFocusView(myPopup); - Assert.AreEqual(true, _focusGainedFlag, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test OnFocusLost. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Popup.OnFocusLost M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void OnFocusLost_CHECK_VALUE() - { - /* TEST CODE */ - _focusLostFlag = false; - var myPopup = new MyPopup(); - var view = new BaseComponents.View(); - view.Focusable = true; - myPopup.Focusable = true; - Window.Instance.Add(myPopup); - Window.Instance.Add(view); - FocusManager.Instance.SetCurrentFocusView(myPopup); - FocusManager.Instance.SetCurrentFocusView(view); - Assert.AreEqual(true, _focusLostFlag, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test GetAttributes. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Popup.GetAttributes M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void GetAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var myPopup = new MyPopup(); - var attr = myPopup.TestGetAttributes(); - Assert.IsNotNull(attr, "Should be not null!"); - Assert.IsInstanceOf(attr, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test OnUpdate. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Popup.OnUpdate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public async Task OnUpdate_CHECK_VALUE() - { - /* TEST CODE */ - _updateFlag = false; - var myPopup = CreatePopup(); - await Task.Delay(500); - Assert.AreEqual(true, _updateFlag, "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", "-")] @@ -658,6 +316,8 @@ namespace Tizen.NUI.Components.Tests 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) @@ -669,43 +329,6 @@ namespace Tizen.NUI.Components.Tests } - [Test] - [Category("P1")] - [Description("Test LayoutChild. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Popup.LayoutChild M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public async Task LayoutChild_CHECK_VALUE() - { - /* TEST CODE */ - _layoutChildFlag = false; - var myPopup = CreatePopup(); - await Task.Delay(500); - Assert.AreEqual(true, _layoutChildFlag, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test OnThemeChangedEvent. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Popup.OnThemeChangedEvent M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public async Task OnThemeChangedEvent_CHECK_VALUE() - { - _themeFlag = false; - Tizen.NUI.Components.StyleManager.Instance.Theme = "Utility"; - var myPopup = new MyPopup(); - Window window = Window.Instance; - window.Add(myPopup); - Tizen.NUI.Components.StyleManager.Instance.Theme = "Food"; - await Task.Delay(500); - Assert.AreEqual(true, _themeFlag, "OnThemeChangedEvent trigger Check Fail."); - window.Remove(myPopup); - } - [Test] [Category("P1")] [Description("Test Dispose, try to dispose the Popup.")] @@ -719,6 +342,8 @@ namespace Tizen.NUI.Components.Tests try { Popup popup = new Popup(); + Assert.IsNotNull(popup, "Should be not Null!"); + Assert.IsInstanceOf(popup, "Should be equal!"); popup.Dispose(); } catch (Exception e) @@ -728,120 +353,5 @@ namespace Tizen.NUI.Components.Tests Assert.Fail("Caught Exception" + e.ToString()); } } - - private MyPopup CreatePopup() - { - MyPopup popup = new MyPopup(); - popup.MinimumSize = new Size2D(1032, 184); - popup.Size2D = new Size2D(1032, 400); - popup.Position2D = new Position2D(200, 100); - - popup.TitlePointSize = 25; - popup.TitleTextColor = Color.Black; - popup.TitleHeight = 68; - popup.TitleTextHorizontalAlignment = HorizontalAlignment.Begin; - popup.TitleTextPosition2D = new Position2D(64, 52); - popup.TitleText = "Popup Title"; - - popup.ShadowImageURL = _path + "11. Popup/popup_background_shadow.png"; - popup.ShadowImageBorder = new Rectangle(0, 0, 105, 105); - popup.ShadowOffset = new Vector4(24, 24, 24, 24); - popup.BackgroundImageURL = _path + "11. Popup/popup_background.png"; - popup.BackgroundImageBorder = new Rectangle(0, 0, 81, 81); - - popup.ButtonBackgroundImageURL = _path + "3. Button/rectangle_btn_normal.png"; - popup.ButtonBackgroundImageBorder = new Rectangle(5, 5, 5, 5); - popup.ButtonOverLayBackgroundColorSelector = new ColorSelector - { - 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.ButtonTextColor = Color.Red; - popup.ButtonHeight = 132; - popup.ButtonCount = 2; - popup.SetButtonText(0, "Yes"); - popup.SetButtonText(1, "Exit"); - - Window.Instance.Add(popup); - - TextLabel contentText = new TextLabel(); - contentText.Size2D = new Size2D(904, 100); - contentText.PointSize = 20; - contentText.HorizontalAlignment = HorizontalAlignment.Begin; - contentText.VerticalAlignment = VerticalAlignment.Center; - contentText.Text = "Popup ButtonStyle is "; - popup.ContentView.Add(contentText); - - return popup; - } - - } - - public class PopupStyle : StyleBase - { - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - protected override Attributes GetAttributes() - { - PopupAttributes attributes = new PopupAttributes - { - MinimumSize = new Size2D(1032, 184), - ShadowOffset = new Vector4(24, 24, 24, 24), - TitleTextAttributes = new TextAttributes - { - PointSize = new FloatSelector { All = 25 }, - TextColor = new ColorSelector { All = Color.Black }, - Size2D = new Size2D(0, 68), - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft, - PivotPoint = Tizen.NUI.PivotPoint.TopLeft, - HorizontalAlignment = HorizontalAlignment.Begin, - VerticalAlignment = VerticalAlignment.Bottom, - Position2D = new Position2D(64, 52), - }, - BackgroundImageAttributes = new ImageAttributes - { - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.Center, - PivotPoint = Tizen.NUI.PivotPoint.Center, - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent, - ResourceURL = new StringSelector { All = _image_path}, - Border = new RectangleSelector { All = new Rectangle(0, 0, 81, 81) }, - }, - ButtonAttributes = new ButtonAttributes - { - Size2D = new Size2D(0, 132), - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft, - PivotPoint = Tizen.NUI.PivotPoint.BottomLeft, - BackgroundImageAttributes = new ImageAttributes - { - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.Center, - PivotPoint = Tizen.NUI.PivotPoint.Center, - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent, - ResourceURL = new StringSelector { All = _image_path }, - Border = new RectangleSelector { All = new Rectangle(5, 5, 5, 5) }, - }, - OverlayImageAttributes = new ImageAttributes - { - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.Center, - PivotPoint = Tizen.NUI.PivotPoint.Center, - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent, - BackgroundColor = new ColorSelector - { - 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), - }, - } - }, - }; - return attributes; - } } } diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopupAttributes.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopupAttributes.cs deleted file mode 100755 index 319d7322d..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPopupAttributes.cs +++ /dev/null @@ -1,239 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.PopupAttributes Tests")] - public class PopupAttributesTests - { - private const string TAG = "Components"; - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("PopupAttributesTests"); - App.MainTitleChangeBackgroundColor(null); - - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test PopupAttributes empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.PopupAttributes.PopupAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void PopupAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var popupAttributes = new PopupAttributes(); - Assert.IsNotNull(popupAttributes, "Should be not null!"); - Assert.IsInstanceOf(popupAttributes, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test PopupAttributes copy constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.PopupAttributes.PopupAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "PopupAttributes")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void PopupAttributes_PopupAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var attrs = new PopupAttributes - { - MinimumSize = new Size2D(1032, 184), - ShadowOffset = new Vector4(24, 24, 24, 24), - TitleTextAttributes = new TextAttributes - { - PointSize = new FloatSelector { All = 25 }, - TextColor = new ColorSelector { All = Color.Black }, - Size2D = new Size2D(0, 68), - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft, - PivotPoint = Tizen.NUI.PivotPoint.TopLeft, - HorizontalAlignment = HorizontalAlignment.Begin, - VerticalAlignment = VerticalAlignment.Bottom, - Position2D = new Position2D(64, 52), - Text = new StringSelector { All = "Popup Title" }, - }, - BackgroundImageAttributes = new ImageAttributes - { - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.Center, - PivotPoint = Tizen.NUI.PivotPoint.Center, - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent, - ResourceURL = new StringSelector { All = _image_path }, - Border = new RectangleSelector { All = new Rectangle(0, 0, 81, 81) }, - }, - ButtonAttributes = new ButtonAttributes - { - Size2D = new Size2D(0, 132), - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft, - PivotPoint = Tizen.NUI.PivotPoint.BottomLeft, - BackgroundImageAttributes = new ImageAttributes - { - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.Center, - PivotPoint = Tizen.NUI.PivotPoint.Center, - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent, - ResourceURL = new StringSelector { All = _image_path }, - Border = new RectangleSelector { All = new Rectangle(5, 5, 5, 5) }, - }, - OverlayImageAttributes = new ImageAttributes - { - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.Center, - PivotPoint = Tizen.NUI.PivotPoint.Center, - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent, - BackgroundColor = new ColorSelector - { - 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), - }, - }, - TextAttributes = new TextAttributes - { - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.Center, - PivotPoint = Tizen.NUI.PivotPoint.Center, - HorizontalAlignment = HorizontalAlignment.Center, - VerticalAlignment = VerticalAlignment.Center, - TextColor = new ColorSelector { All = Color.Cyan }, - }, - }, - }; - var popupAttributes = new PopupAttributes(attrs); - Assert.IsNotNull(popupAttributes, "Should be not null!"); - Assert.IsInstanceOf(popupAttributes, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test ShadowImageAttributes. Check whether ShadowImageAttributes is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.PopupAttributes.ShadowImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ShadowImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var popupAttributes = new PopupAttributes(); - popupAttributes.ShadowImageAttributes = new ImageAttributes(); - Assert.IsNotNull(popupAttributes.ShadowImageAttributes, "Should be not null!"); - Assert.IsInstanceOf(popupAttributes.ShadowImageAttributes, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test BackgroundImageAttributes. Check whether BackgroundImageAttributes is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.PopupAttributes.BackgroundImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void BackgroundImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var popupAttributes = new PopupAttributes(); - popupAttributes.BackgroundImageAttributes = new ImageAttributes(); - Assert.IsNotNull(popupAttributes.BackgroundImageAttributes, "Should be not null!"); - Assert.IsInstanceOf(popupAttributes.BackgroundImageAttributes, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test TitleTextAttributes. Check whether TitleTextAttributes is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.PopupAttributes.TitleTextAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void TitleTextAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var popupAttributes = new PopupAttributes(); - popupAttributes.TitleTextAttributes = new TextAttributes(); - Assert.IsNotNull(popupAttributes.TitleTextAttributes, "Should be not null!"); - Assert.IsInstanceOf(popupAttributes.TitleTextAttributes, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test ShadowOffset. Check whether ShadowOffset is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.PopupAttributes.ShadowOffset A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ShadowOffset_SET_GET_VALUE() - { - /* TEST CODE */ - var popupAttributes = new PopupAttributes(); - popupAttributes.ShadowOffset = new Vector4(10, 10, 10, 10); - - Assert.AreEqual(10, popupAttributes.ShadowOffset.X, "Should be equals!"); - Assert.AreEqual(10, popupAttributes.ShadowOffset.Y, "Should be equals!"); - Assert.AreEqual(10, popupAttributes.ShadowOffset.Z, "Should be equals!"); - Assert.AreEqual(10, popupAttributes.ShadowOffset.W, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test ButtonAttributes. Check whether ButtonAttributes is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.PopupAttributes.ButtonAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ButtonAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var popupAttributes = new PopupAttributes(); - popupAttributes.ButtonAttributes = new ButtonAttributes(); - Assert.IsNotNull(popupAttributes.ButtonAttributes, "Should be not null!"); - Assert.IsInstanceOf(popupAttributes.ButtonAttributes, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.PopupAttributes.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Clone_CHECK_VALUE() - { - var popupAttributes = new PopupAttributes(); - popupAttributes.ShadowOffset = new Vector4(1, 1, 1, 1); - popupAttributes.ButtonAttributes = new ButtonAttributes(); - var attr = popupAttributes.Clone() as PopupAttributes; - Assert.IsNotNull(attr, "Should be not null!"); - Assert.IsInstanceOf(attr, "Should be an instance of PopupAttributes!"); - Assert.AreEqual(1, attr.ShadowOffset.X, "Should be equal!"); - } - - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSProgress.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSProgress.cs index aa73d325c..20aaf0ea9 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSProgress.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSProgress.cs @@ -44,39 +44,6 @@ namespace Tizen.NUI.Components.Tests Assert.IsInstanceOf(progress, "Progress Contruct Fail"); } - [Test] - [Category("P1")] - [Description("Create a Progress object with attributes. Check whether object whose text is initialized is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Progress.Progress C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "ProgressAttributes")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Progress_INIT_WITH_ProgressAttributes() - { - /* TEST CODE */ - var tab = new Progress(new ProgressAttributes()); - Assert.IsNotNull(tab, "Can't create success object Progress"); - Assert.IsInstanceOf(tab, "Should be an instance of textLabel type."); - } - - [Test] - [Category("P1")] - [Description("Create a Progress object with string. Check whether object whose text is initialized is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Progress.Progress C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Progress_INIT_WITH_STRING() - { - /* TEST CODE */ - StyleManager.Instance.RegisterStyle("DefaultProgress", "Utility", typeof(UtilityProgressStyle), true); - var tab = new Progress("DefaultProgress"); - Assert.IsNotNull(tab, "Can't create success object Progress"); - Assert.IsInstanceOf(tab, "Should be an instance of Progress type."); - } - [Test] [Category("P1")] [Description("Test TrackImageURL. Check whether TrackImageURL works or not.")] @@ -88,6 +55,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var progress = new Progress(); + Assert.IsNotNull(progress, "Should be not null!"); + Assert.IsInstanceOf(progress, "Progress Contruct Fail"); + progress.TrackImageURL = "progressurl"; Assert.AreEqual("progressurl", progress.TrackImageURL, "Retrieved TrackImageURL should be equal to set value"); } @@ -103,6 +73,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var progress = new Progress(); + Assert.IsNotNull(progress, "Should be not null!"); + Assert.IsInstanceOf(progress, "Progress Contruct Fail"); + progress.ProgressImageURL = "progressurl"; Assert.AreEqual("progressurl", progress.ProgressImageURL, "Retrieved ProgressImageURL should be equal to set value"); } @@ -118,6 +91,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var progress = new Progress(); + Assert.IsNotNull(progress, "Should be not null!"); + Assert.IsInstanceOf(progress, "Progress Contruct Fail"); + progress.BufferImageURL = "progressurl"; Assert.AreEqual("progressurl", progress.BufferImageURL, "Retrieved BufferImageURL should be equal to set value"); } @@ -133,7 +109,13 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var progress = new Progress(); - Color color = Color.Red; + Assert.IsNotNull(progress, "Should be not null!"); + Assert.IsInstanceOf(progress, "Progress Contruct Fail"); + + var color = Color.Red; + Assert.IsNotNull(color, "Should be not null!"); + Assert.IsInstanceOf(color, "Should be equal"); + progress.TrackColor = color; Assert.AreEqual(color.R, progress.TrackColor.R, "Retrieved TrackColor should be equal to set value"); Assert.AreEqual(color.G, progress.TrackColor.G, "Retrieved TrackColor should be equal to set value"); @@ -152,7 +134,13 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var progress = new Progress(); - Color color = Color.Red; + Assert.IsNotNull(progress, "Should be not null!"); + Assert.IsInstanceOf(progress, "Progress Contruct Fail"); + + var color = Color.Red; + Assert.IsNotNull(color, "Should be not null!"); + Assert.IsInstanceOf(color, "Should be equal"); + progress.ProgressColor = color; Assert.AreEqual(color.R, progress.ProgressColor.R, "Retrieved ProgressColor should be equal to set value"); Assert.AreEqual(color.G, progress.ProgressColor.G, "Retrieved ProgressColor should be equal to set value"); @@ -171,7 +159,13 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var progress = new Progress(); - Color color = Color.Red; + Assert.IsNotNull(progress, "Should be not null!"); + Assert.IsInstanceOf(progress, "Progress Contruct Fail"); + + var color = Color.Red; + Assert.IsNotNull(color, "Should be not null!"); + Assert.IsInstanceOf(color, "Should be equal"); + progress.BufferColor = color; Assert.AreEqual(color.R, progress.BufferColor.R, "Retrieved BufferColor should be equal to set value"); Assert.AreEqual(color.G, progress.BufferColor.G, "Retrieved BufferColor should be equal to set value"); @@ -189,6 +183,9 @@ namespace Tizen.NUI.Components.Tests public void MaxValue_SET_GET_VALUE() { var progress = new Progress(); + Assert.IsNotNull(progress, "Should be not null!"); + Assert.IsInstanceOf(progress, "Progress Contruct Fail"); + progress.MaxValue = 30; Assert.AreEqual(30f, progress.MaxValue, "Retrieved MaxValue should be equal to set value"); } @@ -203,6 +200,9 @@ namespace Tizen.NUI.Components.Tests public void MinValue_SET_GET_VALUE() { var progress = new Progress(); + Assert.IsNotNull(progress, "Should be not null!"); + Assert.IsInstanceOf(progress, "Progress Contruct Fail"); + progress.MinValue = 5; Assert.AreEqual(5, progress.MinValue, "Retrieved MinValue should be equal to set value"); } @@ -218,6 +218,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var progress = new Progress(); + Assert.IsNotNull(progress, "Should be not null!"); + Assert.IsInstanceOf(progress, "Progress Contruct Fail"); + progress.CurrentValue = 20; Assert.AreEqual(20, progress.CurrentValue, "Retrieved CurrentValue should be equal to set value"); } @@ -233,6 +236,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var progress = new Progress(); + Assert.IsNotNull(progress, "Should be not null!"); + Assert.IsInstanceOf(progress, "Progress Contruct Fail"); + progress.BufferValue = 20; Assert.AreEqual(20, progress.BufferValue, "Retrieved BufferValue should be equal to set value"); } @@ -247,6 +253,9 @@ namespace Tizen.NUI.Components.Tests public void ProgressState_SET_GET_VALUE() { var progress = new Progress(); + Assert.IsNotNull(progress, "Should be not null!"); + Assert.IsInstanceOf(progress, "Progress Contruct Fail"); + progress.ProgressState = Progress.ProgressStatusType.Determinate; Assert.AreEqual(Progress.ProgressStatusType.Determinate, progress.ProgressState, "Retrieved ProgressState should be equal to set value"); progress.ProgressState = Progress.ProgressStatusType.Buffering; @@ -255,137 +264,6 @@ namespace Tizen.NUI.Components.Tests Assert.AreEqual(Progress.ProgressStatusType.Indeterminate, progress.ProgressState, "Retrieved ProgressState should be equal to set value"); } - [Test] - [Category("P1")] - [Description("Test GetAttributes. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Progress.GetAttributes M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void GetAttributes_CHECK_VALUE() - { - /* TEST CODE */ - try - { - var myProgress = new MyProgress(); - Assert.IsTrue(myProgress.flagGetAttributes, "GetAttributes trigger Check Fail."); - } - 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 OnUpdate. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Progress.OnUpdate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public async Task OnUpdate_CHECK_VALUE() - { - /* TEST CODE */ - var myProgress = new MyProgress(); - Window.Instance.Add(myProgress); - try - { - await Task.Delay(200); - Assert.IsTrue(myProgress.flagOnUpdate, "OnUpdate trigger Check Fail."); - } - 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(myProgress); - } - } - - [Test] - [Category("P1")] - [Description("Test OnThemeChangedEvent. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Progress.OnThemeChangedEvent M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public async Task OnThemeChangedEvent_CHECK_VALUE() - { - /* TEST CODE */ - StyleManager.Instance.Theme = "Utility"; - var myProgress = new MyProgress(); - Window.Instance.Add(myProgress); - try - { - StyleManager.Instance.Theme = "Food"; - await Task.Delay(200); - Assert.IsTrue(myProgress.flagOnThemeChangedEvent, "OnThemeChangedEvent trigger Check Fail."); - } - 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(myProgress); - } - } - - [Test] - [Category("P1")] - [Description("Test UpdateStates. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Progress.UpdateStates M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void UpdateStates_CHECK_VALUE() - { - /* TEST CODE */ - try - { - var myProgress = new MyProgress(); - myProgress.ProgressState = Progress.ProgressStatusType.Determinate; - Assert.IsTrue(myProgress.flagUpdateStates, "UpdateStates trigger Check Fail."); - } - 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 UpdateValue. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Progress.UpdateValue M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void UpdateValue_CHECK_VALUE() - { - /* TEST CODE */ - try - { - var myProgress = new MyProgress(); - myProgress.MinValue = 1; - Assert.IsTrue(myProgress.flagUpdateValue, "UpdateValue trigger Check Fail."); - } - 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 ChangeImageState, Check whether ChangeImageState works or not.")] @@ -399,6 +277,9 @@ namespace Tizen.NUI.Components.Tests try { var myProgress = new MyProgress(); + Assert.IsNotNull(myProgress, "Should be not null!"); + Assert.IsInstanceOf(myProgress, "MyProgress Contruct Fail"); + myProgress._ChangeImageState(Progress.ProgressStatusType.Buffering); } catch (Exception e) @@ -422,6 +303,9 @@ namespace Tizen.NUI.Components.Tests try { Progress progressBar = new Progress(); + Assert.IsNotNull(progressBar, "Should be not null!"); + Assert.IsInstanceOf(progressBar, "Progress Contruct Fail"); + progressBar.Dispose(); } catch (Exception e) @@ -435,73 +319,12 @@ namespace Tizen.NUI.Components.Tests public class MyProgress : Progress { - public bool flagGetAttributes = false; - public bool flagOnUpdate = false; - public bool flagOnThemeChangedEvent = false; - public bool flagUpdateStates = false; - public bool flagUpdateValue = false; - public MyProgress() : base() { } - public MyProgress(string style) : base(style) - { } - - protected override Attributes GetAttributes() - { - flagGetAttributes = true; - return new ProgressAttributes(); - } - - protected override void OnUpdate() - { - base.OnUpdate(); - flagOnUpdate = true; - } - - protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e) - { - flagOnThemeChangedEvent = true; - } - - protected override void UpdateStates() - { - flagUpdateStates = true; - } - - protected override void UpdateValue() - { - flagUpdateValue = true; - } - public void _ChangeImageState(ProgressStatusType statusType) { base.ChangeImageState(statusType); } } - - internal class UtilityProgressStyle : StyleBase - { - protected override Attributes GetAttributes() - { - ProgressAttributes attributes = new ProgressAttributes - { - TrackImageAttributes = new ImageAttributes - { - BackgroundColor = new ColorSelector - { - All = new Color(0.0f, 0.0f, 0.0f, 0.1f), - } - }, - ProgressImageAttributes = new ImageAttributes - { - BackgroundColor = new ColorSelector - { - All = Color.Green - } - }, - }; - return attributes; - } - } } diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSProgressAttributes.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSProgressAttributes.cs deleted file mode 100755 index 12ffec14a..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSProgressAttributes.cs +++ /dev/null @@ -1,138 +0,0 @@ -using NUnit.Framework; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.ProgressAttributes Tests")] - public class ProgressAttributesTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("ProgressAttributesTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a ProgressAttributes object. Check whether ProgressAttributes is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.ProgressAttributes.ProgressAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void ProgressAttributes_INIT() - { - /* TEST CODE */ - var progressAttributes = new ProgressAttributes(); - Assert.IsNotNull(progressAttributes, "Can't create success object ProgressAttributes"); - Assert.IsInstanceOf(progressAttributes, "Should be an instance of ProgressAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Create a ProgressAttributes object. Check whether ProgressAttributes is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.ProgressAttributes.ProgressAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "ProgressAttributes")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void ProgressAttributes_INIT_WITH_ProgressAttributes() - { - /* TEST CODE */ - var progressAttributes = new ProgressAttributes(); - var progressAttributes2 = new ProgressAttributes(progressAttributes); - Assert.IsNotNull(progressAttributes2, "Can't create success object ProgressAttributes"); - Assert.IsInstanceOf(progressAttributes2, "Should be an instance of ProgressAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Test TrackImageAttributes. Check whether TrackImageAttributes is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.ProgressAttributes.TrackImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void TrackImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var progressAttributes = new ProgressAttributes(); - var imageAttributes = new ImageAttributes() { ResourceURL = new StringSelector() { All = "test.png" } }; - progressAttributes.TrackImageAttributes = imageAttributes; - Assert.AreEqual(imageAttributes.ResourceURL.All, progressAttributes.TrackImageAttributes.ResourceURL.All, "Retrieved TrackImageAttributes should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test ProgressImageAttributes. Check whether ProgressImageAttributes is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.ProgressAttributes.ProgressImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void ProgressImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var progressAttributes = new ProgressAttributes(); - var imageAttributes = new ImageAttributes() { ResourceURL = new StringSelector() { All = "test.png" } }; - progressAttributes.ProgressImageAttributes = imageAttributes; - Assert.AreEqual(imageAttributes.ResourceURL.All, progressAttributes.ProgressImageAttributes.ResourceURL.All, "Retrieved ProgressImageAttributes should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test BufferImageAttributes. Check whether BufferImageAttributes is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.ProgressAttributes.BufferImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void BufferImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var progressAttributes = new ProgressAttributes(); - var imageAttributes = new ImageAttributes() { ResourceURL = new StringSelector() { All = "test.png" } }; - progressAttributes.BufferImageAttributes = imageAttributes; - Assert.AreEqual(imageAttributes.ResourceURL.All, progressAttributes.BufferImageAttributes.ResourceURL.All, "Retrieved BufferImageAttributes should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test LoadingImageAttributes. Check whether LoadingImageAttributes is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.ProgressAttributes.LoadingImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void LoadingImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var progressAttributes = new ProgressAttributes(); - var imageAttributes = new ImageAttributes() { ResourceURL = new StringSelector() { All = "test.png" } }; - progressAttributes.LoadingImageAttributes = imageAttributes; - Assert.AreEqual(imageAttributes, progressAttributes.LoadingImageAttributes, "Retrieved LoadingImageAttributes should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check whether Clone works or not")] - [Property("SPEC", "Tizen.NUI.Components.ProgressAttributes.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Clone_CHECK_RETURN_VALUE() - { - var progressAttributes = new ProgressAttributes(); - progressAttributes.TrackImageAttributes = new ImageAttributes() { ResourceURL = new StringSelector() { All = "test.png" } }; - var progressAttributes2 = progressAttributes.Clone() as ProgressAttributes; - Assert.AreEqual(progressAttributes.TrackImageAttributes.ResourceURL.All, progressAttributes2.TrackImageAttributes.ResourceURL.All, "Retrieved InputBoxAttributes should be equal to clone value"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSRadioButton.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSRadioButton.cs deleted file mode 100755 index 61975111d..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSRadioButton.cs +++ /dev/null @@ -1,154 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.RadioButton Tests")] - public class RadioButtonTests - { - private const string TAG = "Components"; - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("CommonRadioButtonTests"); - App.MainTitleChangeBackgroundColor(null); - - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test RadioButton empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.RadioButton.RadioButton C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void RadioButton_CHECK_VALUE() - { - /* TEST CODE */ - var radioButton = new Components.RadioButton(); - Assert.IsNotNull(radioButton, "Should be not null!"); - Assert.IsInstanceOf(radioButton, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test RadioButton style constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.RadioButton.RadioButton C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void RadioButton_Style_CHECK_VALUE() - { - /* TEST CODE */ - StyleManager.Instance.RegisterStyle("RadioButtonStyle", null, typeof(RadioButtonStyle)); - var radioButton = new Components.RadioButton("RadioButtonStyle"); - Assert.IsNotNull(radioButton, "Should be not null!"); - Assert.IsInstanceOf(radioButton, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test RadioButton SelectButtonAttributes constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.RadioButton.RadioButton C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "SelectButtonAttributes")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void RadioButton_SelectButtonAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var selectButtonAttributes = new SelectButtonAttributes - { - CheckImageAttributes = new ImageAttributes - { - Size2D = new Size2D(48, 48), - ResourceURL = new StringSelector - { - All = _image_path, - }, - Opacity = new FloatSelector - { - Normal = 1.0f, - Selected = 1.0f, - Disabled = 0.4f, - DisabledSelected = 0.4f - }, - }, - }; - var radioButton = new Components.RadioButton(selectButtonAttributes); - Assert.IsNotNull(radioButton, "Should be not null!"); - Assert.IsInstanceOf(radioButton, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test ItemGroup. Check whether ItemGroup is readable.")] - [Property("SPEC", "Tizen.NUI.Components.RadioButton.ItemGroup A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void ItemGroup_SET_GET_VALUE() - { - /* TEST CODE */ - var radioButtonGroup = new RadioButtonGroup(); - var radioButton = new Components.RadioButton(); - var radioButton2 = new Components.RadioButton(); - radioButtonGroup.Add(radioButton); - radioButtonGroup.Add(radioButton2); - Assert.IsNotNull(radioButton.ItemGroup, "Should be equal!"); - Assert.AreEqual(2, radioButton.ItemGroup.Count, "Should be equal!"); - } - } - - public class RadioButtonStyle : StyleBase - { - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - protected override Attributes GetAttributes() - { - SelectButtonAttributes attributes = new SelectButtonAttributes - { - CheckImageAttributes = new ImageAttributes - { - Size2D = new Size2D(48, 48), - Position2D = new Position2D(0, 0), - ResourceURL = new StringSelector - { - Normal = _image_path, - Selected = _image_path, - Disabled = _image_path, - DisabledSelected = _image_path, - }, - Opacity = new FloatSelector - { - Normal = 1.0f, - Selected = 1.0f, - Disabled = 0.4f, - DisabledSelected = 0.4f - }, - }, - }; - - return attributes; - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSRadioButtonGroup.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSRadioButtonGroup.cs deleted file mode 100755 index a63292dc1..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSRadioButtonGroup.cs +++ /dev/null @@ -1,119 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.RadioButtonGroup Tests")] - public class RadioButtonGroupTests - { - private const string TAG = "Components"; - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("RadioButtonGroupTests"); - App.MainTitleChangeBackgroundColor(null); - - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test RadioButtonGroup. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.RadioButtonGroup.RadioButtonGroup C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void RadioButtonGroup_CHECK_VALUE() - { - var radioButtonGroup = new RadioButtonGroup(); - Assert.IsNotNull(radioButtonGroup, "Should be not null!"); - Assert.IsInstanceOf(radioButtonGroup, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Add. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.RadioButtonGroup.Add M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Add_CHECK_VALUE() - { - var radioButton1 = new Components.RadioButton(); - radioButton1.Name = "radioButton1"; - - var radioButtonGroup = new RadioButtonGroup(); - radioButtonGroup.Add(radioButton1); - - string radiobuttonName1 = radioButtonGroup.GetItemByIndex(0).Name; - - Assert.AreEqual("radioButton1", radiobuttonName1, "Should be equals to the name of RadioButton"); - } - - [Test] - [Category("P1")] - [Description("Test Remove. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.RadioButtonGroup.Remove M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Remove_CHECK_VALUE() - { - var radioButton1 = new Components.RadioButton(); - radioButton1.Name = "radioButton1"; - var radioButton2 = new Components.RadioButton(); - radioButton2.Name = "radioButton2"; - - var radioButtonGroup = new RadioButtonGroup(); - radioButtonGroup.Add(radioButton1); - radioButtonGroup.Add(radioButton2); - - radioButtonGroup.Remove(radioButton1); - - string radiobuttonName1 = radioButtonGroup.GetItemByIndex(0).Name; - - Assert.AreEqual("radioButton2", radiobuttonName1, "Should be equals to the name of RadioButton"); - } - - [Test] - [Category("P1")] - [Description("Test GetItemByIndex. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.RadioButtonGroup.GetItemByIndex M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void GetItemByIndex_CHECK_VALUE() - { - var radioButton1 = new Components.RadioButton(); - radioButton1.Name = "radioButton1"; - var radioButton2 = new Components.RadioButton(); - radioButton2.Name = "radioButton2"; - - var radioButtonGroup = new RadioButtonGroup(); - radioButtonGroup.Add(radioButton1); - radioButtonGroup.Add(radioButton2); - - string radiobuttonName1 = radioButtonGroup.GetItemByIndex(0).Name; - string radiobuttonName2 = radioButtonGroup.GetItemByIndex(1).Name; - - Assert.AreEqual("radioButton1", radiobuttonName1, "Should be equals to the name of RadioButton"); - Assert.AreEqual("radioButton2", radiobuttonName2, "Should be equals to the name of RadioButton"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSRectangleSelector.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSRectangleSelector.cs deleted file mode 100755 index 5e5a8e3bc..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSRectangleSelector.cs +++ /dev/null @@ -1,67 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Threading.Tasks; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.RectangleSelector Tests")] - public class RectangleSelectorTests - { - private const string TAG = "NUI.Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("RectangleSelectorTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a RectangleSelector object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.RectangleSelector.RectangleSelector C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void RectangleSelector_INIT() - { - /* TEST CODE */ - var rectangleSelector = new RectangleSelector(); - Assert.IsNotNull(rectangleSelector, "Can't create success object RectangleSelector"); - Assert.IsInstanceOf(rectangleSelector, "Should be an instance of RectangleSelector type."); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check Whether Clone works or not")] - [Property("SPEC", "Tizen.NUI.Components.RectangleSelector.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Clone_TEST() - { - /* TEST CODE */ - var rectangleSelector1 = new RectangleSelector(); - rectangleSelector1.All = new Rectangle(10, 10, 20, 20); - var rectangleSelector = rectangleSelector1.Clone(); - Assert.IsNotNull(rectangleSelector, "should be not null!"); - Assert.AreEqual(10, rectangleSelector.All.X, "Should be equal!"); - Assert.AreEqual(10, rectangleSelector.All.Y, "Should be equal!"); - Assert.AreEqual(20, rectangleSelector.All.Width, "Should be equal!"); - Assert.AreEqual(20, rectangleSelector.All.Height, "Should be equal!"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSScrollBar.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSScrollBar.cs index 9363845ba..2024b7e43 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSScrollBar.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSScrollBar.cs @@ -16,7 +16,6 @@ namespace Tizen.NUI.Components.Tests private const string TAG = "NUI.Components"; private string _style = ""; private string _trackImageUrl = ""; - private bool _styleRegiesterFlag = false; [SetUp] public void Init() @@ -24,11 +23,6 @@ namespace Tizen.NUI.Components.Tests Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("ScrollBarTests"); App.MainTitleChangeBackgroundColor(null); - if (!_styleRegiesterFlag) - { - StyleManager.Instance.RegisterStyle("DAScrollbar", null, typeof(Tizen.NUI.Components.Tests.DAScrollBarStyle)); - _styleRegiesterFlag = true; - } } [TearDown] @@ -53,56 +47,6 @@ namespace Tizen.NUI.Components.Tests Assert.IsInstanceOf(scrollBar, "Should be an instance of ScrollBar type."); } - [Test] - [Category("P1")] - [Description("Create a ScrollBar object. Check whether ScrollBar object which set style is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.ScrollBar.ScrollBar C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ScrollBar_INIT_WITH_STYLE() - { - /* TEST CODE */ - var scrollBar = new ScrollBar("DAScrollbar"); - Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar"); - Assert.IsInstanceOf(scrollBar, "Should be an instance of ScrollBar type."); - } - - [Test] - [Category("P1")] - [Description("Create a ScrollBar object. Check whether ScrollBar object which set attributes is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.ScrollBar.ScrollBar C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "ScrollBarAttributes")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ScrollBar_INIT_WITH_ATTRIBUTES() - { - /* TEST CODE */ - ScrollBarAttributes attr = new ScrollBarAttributes - { - TrackImageAttributes = new ImageAttributes - { - BackgroundColor = new ColorSelector - { - All = new Color(0.43f, 0.43f, 0.43f, 0.1f), - } - }, - ThumbImageAttributes = new ImageAttributes - { - BackgroundColor = new ColorSelector - { - All = new Color(0.0f, 0.0f, 0.0f, 0.2f), - } - }, - - }; - var scrollBar = new ScrollBar(attr); - Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar"); - Assert.IsInstanceOf(scrollBar, "Should be an instance of ScrollBar type."); - } - [Test] [Category("P1")] [Description("Test MinValue.Check whether MinValue is readable ahd writeable.")] @@ -114,6 +58,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var scrollBar = new ScrollBar(); + Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar"); + Assert.IsInstanceOf(scrollBar, "Should be an instance of ScrollBar type."); + scrollBar.MinValue = 0; Assert.AreEqual(0, scrollBar.MinValue, "Should be equals to the set value of MinValue."); } @@ -129,6 +76,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var scrollBar = new ScrollBar(); + Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar"); + Assert.IsInstanceOf(scrollBar, "Should be an instance of ScrollBar type."); + scrollBar.MaxValue = 100; Assert.AreEqual(100, scrollBar.MaxValue, "Should be equals to the set value of MaxValue."); } @@ -144,6 +94,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var scrollBar = new ScrollBar(); + Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar"); + Assert.IsInstanceOf(scrollBar, "Should be an instance of ScrollBar type."); + scrollBar.CurrentValue = 50; Assert.AreEqual(50, scrollBar.CurrentValue, "Should be equals to the set value of CurrentValue."); } @@ -159,6 +112,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var scrollBar = new ScrollBar(); + Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar"); + Assert.IsInstanceOf(scrollBar, "Should be an instance of ScrollBar type."); + scrollBar.ThumbColor = Color.Red; Assert.AreEqual(Color.Red.R, scrollBar.ThumbColor.R, "Should be equals to the set value."); Assert.AreEqual(Color.Red.G, scrollBar.ThumbColor.G, "Should be equals to the set value."); @@ -177,6 +133,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var scrollBar = new ScrollBar(); + Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar"); + Assert.IsInstanceOf(scrollBar, "Should be an instance of ScrollBar type."); + scrollBar.TrackColor = Color.Green; Assert.AreEqual(Color.Green.R, scrollBar.TrackColor.R, "Should be equals to the set value."); Assert.AreEqual(Color.Green.G, scrollBar.TrackColor.G, "Should be equals to the set value."); @@ -195,6 +154,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var scrollBar = new ScrollBar(); + Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar"); + Assert.IsInstanceOf(scrollBar, "Should be an instance of ScrollBar type."); + scrollBar.TrackImageURL = _trackImageUrl; Assert.AreEqual(_trackImageUrl, scrollBar.TrackImageURL, "Should be equals to the set value of TrackImageURL."); } @@ -210,6 +172,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var scrollBar = new ScrollBar(); + Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar"); + Assert.IsInstanceOf(scrollBar, "Should be an instance of ScrollBar type."); + scrollBar.Direction = ScrollBar.DirectionType.Vertical; Assert.AreEqual(ScrollBar.DirectionType.Vertical, scrollBar.Direction, "Should be equals to the set value of Direction."); scrollBar.Direction = ScrollBar.DirectionType.Horizontal; @@ -227,6 +192,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var scrollBar = new ScrollBar(); + Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar"); + Assert.IsInstanceOf(scrollBar, "Should be an instance of ScrollBar type."); + scrollBar.Duration = 100; Assert.AreEqual(100, scrollBar.Duration, "Should be equals to the set value of Duration."); } @@ -242,7 +210,10 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var scrollBar = new ScrollBar(); - scrollBar.ThumbSize = new Size2D(50, 50); + Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar"); + Assert.IsInstanceOf(scrollBar, "Should be an instance of ScrollBar type."); + + scrollBar.ThumbSize = new Size(50, 50); Assert.AreEqual(50, scrollBar.ThumbSize.Width, "Should be equals to the set value."); Assert.AreEqual(50, scrollBar.ThumbSize.Height, "Should be equals to the set value."); } @@ -258,82 +229,15 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var scrollBar = new ScrollBar(); + Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar"); + Assert.IsInstanceOf(scrollBar, "Should be an instance of ScrollBar type."); + scrollBar.MinValue = 0; scrollBar.MaxValue = 100; scrollBar.SetCurrentValue(50); Assert.AreEqual(50, scrollBar.CurrentValue, "Should be equals to the set value of CurrentValue."); } - [Test] - [Category("P1")] - [Description("Test OnUpdate. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.ScrollBar.OnUpdate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public async Task OnUpdate_CHECK_VALUE() - { - /* TEST CODE */ - try - { - var view = new MyScrollBar(); - Window window = Window.Instance; - window.Add(view); - await Task.Delay(500); - Assert.AreEqual(true, view.updateFlag, "OnUpdate trigger Check Fail."); - window.Remove(view); - } - catch (Exception e) - { - Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test GetAttributes. Check Whether GetAttributes works or not")] - [Property("SPEC", "Tizen.NUI.Components.ScrollBar.GetAttributes M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetAttributes_TEST() - { - /* TEST CODE */ - var myScrollBar = new MyScrollBar(); - Assert.IsNotNull(myScrollBar.TestGetAttributes(), "Should be not null"); - Assert.IsInstanceOf(myScrollBar.TestGetAttributes(), "Should be an instance of PaginationAttributes"); - } - - - [Test] - [Category("P1")] - [Description("Test OnThemeChangedEvent. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.ScrollBar.OnThemeChangedEvent M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public async Task OnThemeChangedEvent_CHECK_VALUE() - { - /* TEST CODE */ - try - { - Tizen.NUI.Components.StyleManager.Instance.Theme = "Utility"; - var view = new MyScrollBar(); - Window window = Window.Instance; - window.Add(view); - Tizen.NUI.Components.StyleManager.Instance.Theme = "Food"; - await Task.Delay(500); - Assert.AreEqual(true, view.themeChanged, "OnThemeChangedEvent trigger Check Fail."); - window.Remove(view); - } - catch (Exception e) - { - Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); - Assert.Fail("Caught Exception" + e.ToString()); - } - } - [Test] [Category("P1")] [Description("Test Dispose, try to dispose the ScrollBar.")] @@ -346,7 +250,10 @@ namespace Tizen.NUI.Components.Tests /* TEST CODE */ try { - ScrollBar scrollBar = new ScrollBar(); + var scrollBar = new ScrollBar(); + Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar"); + Assert.IsInstanceOf(scrollBar, "Should be an instance of ScrollBar type."); + scrollBar.Dispose(); } catch (Exception e) @@ -357,56 +264,4 @@ namespace Tizen.NUI.Components.Tests } } } - - public class MyScrollBar : ScrollBar - { - public bool updateFlag = false; - public bool themeChanged = false; - - public Attributes TestGetAttributes() - { - return GetAttributes(); - } - protected override Attributes GetAttributes() - { - return base.GetAttributes(); - } - - protected override void OnUpdate() - { - updateFlag = true; - base.OnUpdate(); - } - - protected override void OnThemeChangedEvent(object sender, Tizen.NUI.Components.StyleManager.ThemeChangeEventArgs e) - { - themeChanged = true; - base.OnThemeChangedEvent(sender, e); - } - } - - internal class DAScrollBarStyle : StyleBase - { - protected override Attributes GetAttributes() - { - ScrollBarAttributes attributes = new ScrollBarAttributes - { - TrackImageAttributes = new ImageAttributes - { - BackgroundColor = new ColorSelector - { - All = new Color(0.43f, 0.43f, 0.43f, 0.6f), - } - }, - ThumbImageAttributes = new ImageAttributes - { - BackgroundColor = new ColorSelector - { - All = new Color(0.0f, 0.0f, 0.0f, 0.2f) - } - }, - }; - return attributes; - } - } } diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSScrollBarAttributes.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSScrollBarAttributes.cs deleted file mode 100755 index ade0f4c3b..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSScrollBarAttributes.cs +++ /dev/null @@ -1,170 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Threading.Tasks; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.ScrollBarAttributes Tests")] - public class ScrollBarAttributesTests - { - private const string TAG = "NUI.Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("ScrollBarAttributesTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a ScrollBarAttributes object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.ScrollBarAttributes.ScrollBarAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ScrollBarAttributes_INIT() - { - /* TEST CODE */ - var attributes = new ScrollBarAttributes(); - Assert.IsNotNull(attributes, "Can't create success object ScrollBarAttributes"); - Assert.IsInstanceOf(attributes, "Should be an instance of ScrollBarAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Create a ScrollBarAttributes object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.ScrollBarAttributes.ScrollBarAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "ScrollBarAttributes")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ScrollBarAttributes_INIT_WITH_SCROLLBARATTRIBUTES() - { - /* TEST CODE */ - var scrollBarAttributes1 = new ScrollBarAttributes(); - var scrollBarAttributes = new ScrollBarAttributes(scrollBarAttributes1); - Assert.IsNotNull(scrollBarAttributes, "Can't create success object ScrollBarAttributes"); - Assert.IsInstanceOf(scrollBarAttributes, "Should be an instance of ScrollBarAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Test Direction.Check whether Direction is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ScrollBarAttributes.Direction A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Direction_SET_GET_VALUE() - { - /* TEST CODE */ - var scrollBarAttributes = new ScrollBarAttributes(); - scrollBarAttributes.Direction = ScrollBar.DirectionType.Vertical; - Assert.AreEqual(ScrollBar.DirectionType.Vertical, scrollBarAttributes.Direction, "Should be equal!"); - scrollBarAttributes.Direction = ScrollBar.DirectionType.Horizontal; - Assert.AreEqual(ScrollBar.DirectionType.Horizontal, scrollBarAttributes.Direction, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Duration.Check whether Duration is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ScrollBarAttributes.Duration A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Duration_SET_GET_VALUE() - { - /* TEST CODE */ - var scrollBarAttributes = new ScrollBarAttributes(); - scrollBarAttributes.Duration = 100; - Assert.AreEqual(100, scrollBarAttributes.Duration, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test TrackImageAttributes.Check whether TrackImageAttributes is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ScrollBarAttributes.TrackImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void TrackImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - ImageAttributes trackImageAttributes = new ImageAttributes - { - BackgroundColor = new ColorSelector - { - All = new Color(0.43f, 0.43f, 0.43f, 0.1f), - } - }; - - var scrollBarAttributes = new ScrollBarAttributes(); - scrollBarAttributes.TrackImageAttributes = trackImageAttributes; - Assert.IsNotNull(scrollBarAttributes.TrackImageAttributes, "Should be not null"); - Assert.IsInstanceOf(scrollBarAttributes.TrackImageAttributes, "Should be an instance of ImageAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Test ThumbImageAttributes.Check whether ThumbImageAttributes is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ScrollBarAttributes.ThumbImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ThumbImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - ImageAttributes thumbImageAttributes = new ImageAttributes - { - BackgroundColor = new ColorSelector - { - All = new Color(0.43f, 0.43f, 0.43f, 0.1f), - } - }; - - var scrollBarAttributes = new ScrollBarAttributes(); - scrollBarAttributes.ThumbImageAttributes = thumbImageAttributes; - Assert.IsNotNull(scrollBarAttributes.ThumbImageAttributes, "Should be not null"); - Assert.IsInstanceOf(scrollBarAttributes.ThumbImageAttributes, "Should be an instance of ImageAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check Whether Clone works or not")] - [Property("SPEC", "Tizen.NUI.Components.ScrollBarAttributes.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Clone_TEST() - { - /* TEST CODE */ - try - { - var scrollBarAttributes = new ScrollBarAttributes(); - scrollBarAttributes.Duration = 10; - var attributes = scrollBarAttributes.Clone() as ScrollBarAttributes; - Assert.IsNotNull(attributes, "Should be not null"); - Assert.IsInstanceOf(attributes, "Should be an instance of ScrollBarAttributes type."); - Assert.AreEqual(10, attributes.Duration, "Should be equal!"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSelectButton.SelectEventArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSelectButton.SelectEventArgs.cs deleted file mode 100755 index a1feff3f5..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSelectButton.SelectEventArgs.cs +++ /dev/null @@ -1,68 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.SelectButton.SelectEventArgs Tests")] - public class SelectButtonSelectEventArgsTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("SelectButtonSelectEventArgsTests"); - App.MainTitleChangeBackgroundColor(null); - - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test SelectEventArgs empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.SelectEventArgs.SelectEventArgs C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void SelectEventArgs_CHECK_VALUE() - { - /* TEST CODE */ - var selectEventArgs = new SelectButton.SelectEventArgs(); - Assert.IsNotNull(selectEventArgs, "Should be not null!"); - Assert.IsInstanceOf(selectEventArgs, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test IsSelected. Check whether IsSelected is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.SelectEventArgs.IsSelected A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void IsSelected_SET_GET_VALUE() - { - /* TEST CODE */ - var selectEventArgs = new SelectButton.SelectEventArgs(); - selectEventArgs.IsSelected = true; - Assert.AreEqual(true, selectEventArgs.IsSelected, "Should be equal"); - selectEventArgs.IsSelected = false; - Assert.AreEqual(false, selectEventArgs.IsSelected, "Should be equal"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSelectButton.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSelectButton.cs deleted file mode 100755 index 34b2ab3b7..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSelectButton.cs +++ /dev/null @@ -1,571 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.SelectButton Tests")] - public class SelectButtonTests - { - private const string TAG = "Components"; - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("CommonSelectButtonTests"); - App.MainTitleChangeBackgroundColor(null); - - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test SelectButton empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.SelectButton C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void SelectButton_CHECK_VALUE() - { - /* TEST CODE */ - var selectButton = new SelectButton(); - Assert.IsNotNull(selectButton, "Should be not null!"); - Assert.IsInstanceOf(selectButton, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test SelectButton style constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.SelectButton C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void SelectButton_Style_CHECK_VALUE() - { - /* TEST CODE */ - StyleManager.Instance.RegisterStyle("SelectButtonStyle", null, typeof(SelectButtonStyle)); - var selectButton = new SelectButton("SelectButtonStyle"); - Assert.IsNotNull(selectButton, "Should be not null!"); - Assert.IsInstanceOf(selectButton, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test SelectButton SelectButtonAttributes constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.SelectButton C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "SelectButtonAttributes")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void SelectButton_SelectButtonAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var selectButtonAttributes = new SelectButtonAttributes - { - CheckImageAttributes = new ImageAttributes - { - Size2D = new Size2D(48, 48), - ResourceURL = new StringSelector - { - All = _image_path, - }, - Opacity = new FloatSelector - { - Normal = 1.0f, - Selected = 1.0f, - Disabled = 0.4f, - DisabledSelected = 0.4f - }, - }, - }; - var selectButton = new SelectButton(selectButtonAttributes); - Assert.IsNotNull(selectButton, "Should be not null!"); - Assert.IsInstanceOf(selectButton, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Index. Check whether Index is readable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.Index A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Index_CHECK_VALUE() - { - /* TEST CODE */ - var selectButton = new SelectButton(); - Assert.AreEqual(-1, selectButton.Index, "Should be equals to default value"); - } - - [Test] - [Category("P1")] - [Description("Test CheckImageURL. Check whether CheckImageURL is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckImageURL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckImageURL_SET_GET_VALUE() - { - /* TEST CODE */ - var selectButton = new SelectButton(); - selectButton.CheckImageURL = _image_path; - Assert.AreEqual(_image_path, selectButton.CheckImageURL, "Should be equals to the set value of CheckImageURL"); - } - - [Test] - [Category("P1")] - [Description("Test CheckImageURLSelector. Check whether CheckImageURLSelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckImageURLSelector A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckImageURLSelector_SET_GET_VALUE() - { - /* TEST CODE */ - var selectButton = new SelectButton(); - var stringSelector = new StringSelector - { - Normal = _image_path, - Selected = _image_path, - }; - selectButton.CheckImageURLSelector = stringSelector; - Assert.AreEqual(stringSelector.Normal, selectButton.CheckImageURLSelector.Normal, "Should be equals to the set value of CheckImageURLSelector Normal"); - Assert.AreEqual(stringSelector.Selected, selectButton.CheckImageURLSelector.Selected, "Should be equals to the set value of CheckImageURLSelector Selected"); - } - - [Test] - [Category("P1")] - [Description("Test CheckImageOpacity. Check whether CheckImageOpacity is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckImageOpacity A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckImageOpacity_SET_GET_VALUE() - { - /* TEST CODE */ - var selectButton = new SelectButton(); - selectButton.CheckImageOpacity = 1.0f; - Assert.AreEqual(1.0f, selectButton.CheckImageOpacity, "Should be equals to the set value of CheckImageOpacity"); - } - - [Test] - [Category("P1")] - [Description("Test CheckImageOpacitySelector. Check whether CheckImageOpacitySelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckImageOpacitySelector A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckImageOpacitySelector_SET_GET_VALUE() - { - /* TEST CODE */ - var selectButton = new SelectButton(); - var floatSelector = new FloatSelector - { - Normal = 0.5f, - Selected = 1.0f, - }; - selectButton.CheckImageOpacitySelector = floatSelector; - Assert.AreEqual(floatSelector.Normal, selectButton.CheckImageOpacitySelector.Normal, "Should be equals to the set value of CheckImageOpacitySelector Normal"); - Assert.AreEqual(floatSelector.Selected, selectButton.CheckImageOpacitySelector.Selected, "Should be equals to the set value of CheckImageOpacitySelector Selected"); - } - - [Test] - [Category("P1")] - [Description("Test CheckImageSize2D. Check whether CheckImageSize2D is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckImageSize2D A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckImageSize2D_SET_GET_VALUE() - { - /* TEST CODE */ - var selectButton = new SelectButton(); - selectButton.CheckImageSize2D = new Size2D(10, 10); - Assert.AreEqual(10, selectButton.CheckImageSize2D.Width, "Should be equals to the set value of CheckImageSize2D.Width"); - Assert.AreEqual(10, selectButton.CheckImageSize2D.Height, "Should be equals to the set value of CheckImageSize2D.Height"); - } - - [Test] - [Category("P1")] - [Description("Test CheckBackgroundImageURL. Check whether CheckBackgroundImageURL is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckBackgroundImageURL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckBackgroundImageURL_SET_GET_VALUE() - { - /* TEST CODE */ - var selectButton = new SelectButton(); - selectButton.CheckBackgroundImageURL = _image_path; - Assert.AreEqual(_image_path, selectButton.CheckBackgroundImageURL, "Should be equals to the set value of CheckBackgroundImageURL"); - } - - [Test] - [Category("P1")] - [Description("Test CheckBackgroundImageURLSelector. Check whether CheckBackgroundImageURLSelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckBackgroundImageURLSelector A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckBackgroundImageURLSelector_SET_GET_VALUE() - { - /* TEST CODE */ - var selectButton = new SelectButton(); - var stringSelector = new StringSelector - { - Normal = _image_path, - Selected = _image_path, - }; - selectButton.CheckBackgroundImageURLSelector = stringSelector; - Assert.AreEqual(stringSelector.Normal, selectButton.CheckBackgroundImageURLSelector.Normal, "Should be equals to the set value of CheckBackgroundImageURLSelector Normal"); - Assert.AreEqual(stringSelector.Selected, selectButton.CheckBackgroundImageURLSelector.Selected, "Should be equals to the set value of CheckBackgroundImageURLSelector Selected"); - } - - [Test] - [Category("P1")] - [Description("Test CheckBackgroundImageOpacity. Check whether CheckBackgroundImageOpacity is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckBackgroundImageOpacity A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckBackgroundImageOpacity_SET_GET_VALUE() - { - /* TEST CODE */ - var selectButton = new SelectButton(); - selectButton.CheckBackgroundImageOpacity = 1.0f; - Assert.AreEqual(1.0f, selectButton.CheckBackgroundImageOpacity, "Should be equals to the set value of CheckBackgroundImageOpacity"); - } - - [Test] - [Category("P1")] - [Description("Test CheckBackgroundImageOpacitySelector. Check whether CheckBackgroundImageOpacitySelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckBackgroundImageOpacitySelector A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckBackgroundImageOpacitySelector_SET_GET_VALUE() - { - /* TEST CODE */ - var selectButton = new SelectButton(); - var floatSelector = new FloatSelector - { - Normal = 0.5f, - Selected = 1.0f, - }; - selectButton.CheckBackgroundImageOpacitySelector = floatSelector; - Assert.AreEqual(floatSelector.Normal, selectButton.CheckBackgroundImageOpacitySelector.Normal, "Should be equals to the set value of CheckBackgroundImageOpacitySelector Normal"); - Assert.AreEqual(floatSelector.Selected, selectButton.CheckBackgroundImageOpacitySelector.Selected, "Should be equals to the set value of CheckBackgroundImageOpacitySelector Selected"); - } - - [Test] - [Category("P1")] - [Description("Test CheckShadowImageURL. Check whether CheckShadowImageURL is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckShadowImageURL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckShadowImageURL_SET_GET_VALUE() - { - /* TEST CODE */ - var selectButton = new SelectButton(); - selectButton.CheckShadowImageURL = _image_path; - Assert.AreEqual(_image_path, selectButton.CheckShadowImageURL, "Should be equals to the set value of CheckShadowImageURL"); - } - - [Test] - [Category("P1")] - [Description("Test CheckShadowImageURLSelector. Check whether CheckShadowImageURLSelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckShadowImageURLSelector A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckShadowImageURLSelector_SET_GET_VALUE() - { - /* TEST CODE */ - var selectButton = new SelectButton(); - var stringSelector = new StringSelector - { - Normal = _image_path, - Selected = _image_path, - }; - selectButton.CheckShadowImageURLSelector = stringSelector; - Assert.AreEqual(stringSelector.Normal, selectButton.CheckShadowImageURLSelector.Normal, "Should be equals to the set value of CheckShadowImageURLSelector Normal"); - Assert.AreEqual(stringSelector.Selected, selectButton.CheckShadowImageURLSelector.Selected, "Should be equals to the set value of CheckShadowImageURLSelector Selected"); - } - - [Test] - [Category("P1")] - [Description("Test CheckShadowImageOpacity. Check whether CheckShadowImageOpacity is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckShadowImageOpacity A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckShadowImageOpacity_SET_GET_VALUE() - { - /* TEST CODE */ - var selectButton = new SelectButton(); - selectButton.CheckShadowImageOpacity = 1.0f; - Assert.AreEqual(1.0f, selectButton.CheckShadowImageOpacity, "Should be equals to the set value of CheckShadowImageOpacity"); - } - - [Test] - [Category("P1")] - [Description("Test CheckShadowImageOpacitySelector. Check whether CheckShadowImageOpacitySelector is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckShadowImageOpacitySelector A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckShadowImageOpacitySelector_SET_GET_VALUE() - { - /* TEST CODE */ - var selectButton = new SelectButton(); - var floatSelector = new FloatSelector - { - Normal = 0.5f, - Selected = 1.0f, - }; - selectButton.CheckShadowImageOpacitySelector = floatSelector; - Assert.AreEqual(floatSelector.Normal, selectButton.CheckShadowImageOpacitySelector.Normal, "Should be equals to the set value of CheckShadowImageOpacitySelector Normal"); - Assert.AreEqual(floatSelector.Selected, selectButton.CheckShadowImageOpacitySelector.Selected, "Should be equals to the set value of CheckShadowImageOpacitySelector Selected"); - } - - [Test] - [Category("P1")] - [Description("Test CheckImagePaddingLeft. Check whether CheckImagePaddingLeft is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckImagePaddingLeft A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckImagePaddingLeft_SET_GET_VALUE() - { - /* TEST CODE */ - var selectButton = new SelectButton(); - selectButton.CheckImagePaddingLeft = 10; - Assert.AreEqual(10, selectButton.CheckImagePaddingLeft, "Should be equals to the set value of CheckImagePaddingLeft"); - } - - [Test] - [Category("P1")] - [Description("Test CheckImagePaddingRight. Check whether CheckImagePaddingRight is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckImagePaddingRight A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckImagePaddingRight_SET_GET_VALUE() - { - /* TEST CODE */ - var selectButton = new SelectButton(); - selectButton.CheckImagePaddingRight = 10; - Assert.AreEqual(10, selectButton.CheckImagePaddingRight, "Should be equals to the set value of CheckImagePaddingRight"); - } - - [Test] - [Category("P1")] - [Description("Test CheckImagePaddingTop. Check whether CheckImagePaddingTop is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckImagePaddingTop A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckImagePaddingTop_SET_GET_VALUE() - { - /* TEST CODE */ - var selectButton = new SelectButton(); - selectButton.CheckImagePaddingTop = 10; - Assert.AreEqual(10, selectButton.CheckImagePaddingTop, "Should be equals to the set value of CheckImagePaddingTop"); - } - - [Test] - [Category("P1")] - [Description("Test CheckImagePaddingBottom. Check whether CheckImagePaddingBottom is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckImagePaddingBottom A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckImagePaddingBottom_SET_GET_VALUE() - { - /* TEST CODE */ - var selectButton = new SelectButton(); - selectButton.CheckImagePaddingBottom = 10; - Assert.AreEqual(10, selectButton.CheckImagePaddingBottom, "Should be equals to the set value of CheckImagePaddingBottom"); - } - - [Test] - [Category("P1")] - [Description("Test OnKey. Check return the right value or not")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.OnKey M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void OnKey_CHECK_RETURN_VALUE() - { - /* TEST CODE */ - try - { - var selectButton = new SelectButton(); - bool flag = true; - flag = selectButton.OnKey(new Key()); - Assert.AreEqual(false, flag, "OnKey return check fail."); - } - 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()); - } - } - - public class MySelectButton : SelectButton - { - public bool updateFlag = false; - public bool themeFlag = false; - - protected override void OnUpdate() - { - updateFlag = true; - base.OnUpdate(); - } - - protected override Attributes GetAttributes() - { - return base.GetAttributes(); - } - - public Attributes TestGetAttributes() - { - return GetAttributes(); - } - - protected override void OnThemeChangedEvent(object sender, Components.StyleManager.ThemeChangeEventArgs e) - { - themeFlag = true; - base.OnThemeChangedEvent(sender, e); - } - - } - - [Test] - [Category("P1")] - [Description("Test OnUpdate. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.OnUpdate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public async Task OnUpdate_CHECK_VALUE() - { - var mySelectButton = new MySelectButton(); - mySelectButton.BackgroundColor = Color.Red; - mySelectButton.Size2D = new Size2D(200, 200); - Window.Instance.Add(mySelectButton); - await Task.Delay(500); - Assert.AreEqual(true, mySelectButton.updateFlag, "Should be equal"); - } - - [Test] - [Category("P1")] - [Description("Test GetAttributes. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.GetAttributes M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void GetAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var mySelectButton = new MySelectButton(); - var attr = mySelectButton.TestGetAttributes(); - Assert.IsNotNull(attr, "Should be not null!"); - Assert.IsInstanceOf(attr, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test OnThemeChangedEvent. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.OnThemeChangedEvent M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public async Task OnThemeChangedEvent_CHECK_VALUE() - { - Tizen.NUI.Components.StyleManager.Instance.Theme = "Utility"; - var mySelectButton = new MySelectButton(); - Window window = Window.Instance; - window.Add(mySelectButton); - Tizen.NUI.Components.StyleManager.Instance.Theme = "Food"; - await Task.Delay(500); - Assert.AreEqual(true, mySelectButton.themeFlag, "OnThemeChangedEvent trigger Check Fail."); - window.Remove(mySelectButton); - } - - [Test] - [Category("P1")] - [Description("Test Dispose, try to dispose the SelectButton.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButton.Dispose M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Dispose_TEST() - { - /* TEST CODE */ - try - { - SelectButton selectButton = new SelectButton(); - selectButton.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()); - } - } - } - - public class SelectButtonStyle : StyleBase - { - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - protected override Attributes GetAttributes() - { - SelectButtonAttributes attributes = new SelectButtonAttributes - { - CheckImageAttributes = new ImageAttributes - { - Size2D = new Size2D(48, 48), - Position2D = new Position2D(0, 0), - ResourceURL = new StringSelector - { - Normal = _image_path, - Selected = _image_path, - Disabled = _image_path, - DisabledSelected = _image_path, - }, - Opacity = new FloatSelector - { - Normal = 1.0f, - Selected = 1.0f, - Disabled = 0.4f, - DisabledSelected = 0.4f - }, - }, - }; - - return attributes; - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSelectButtonAttributes.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSelectButtonAttributes.cs deleted file mode 100755 index 8027ae502..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSelectButtonAttributes.cs +++ /dev/null @@ -1,153 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.SelectButtonAttributes Tests")] - public class SelectButtonAttributesTests - { - private const string TAG = "Components"; - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("SelectButtonAttributesTests"); - App.MainTitleChangeBackgroundColor(null); - - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test SelectButtonAttributes empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.SelectButtonAttributes.SelectButtonAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void SelectButtonAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var selectButtonAttributes = new SelectButtonAttributes(); - Assert.IsNotNull(selectButtonAttributes, "Should be not null"); - Assert.IsInstanceOf(selectButtonAttributes, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test SelectButtonAttributes copy constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.SelectButtonAttributes.SelectButtonAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "SelectButtonAttributes")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void SelectButtonAttributes_SelectButtonAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var attrs = new SelectButtonAttributes - { - CheckImageAttributes = new ImageAttributes - { - Size2D = new Size2D(48, 48), - ResourceURL = new StringSelector - { - All = _image_path, - }, - Opacity = new FloatSelector - { - Normal = 1.0f, - Selected = 1.0f, - Disabled = 0.4f, - DisabledSelected = 0.4f - }, - }, - }; - var selectButtonAttributes = new SelectButtonAttributes(attrs); - Assert.IsNotNull(selectButtonAttributes, "Should be not null!"); - Assert.IsInstanceOf(selectButtonAttributes, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test CheckImageAttributes. Check whether CheckImageAttributes is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButtonAttributes.CheckImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var selectButtonAttributes = new SelectButtonAttributes(); - selectButtonAttributes.CheckImageAttributes = new ImageAttributes(); - Assert.IsNotNull(selectButtonAttributes.CheckImageAttributes, "Should be not null!"); - Assert.IsInstanceOf(selectButtonAttributes.CheckImageAttributes, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test CheckBackgroundImageAttributes. Check whether CheckBackgroundImageAttributes is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButtonAttributes.CheckBackgroundImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckBackgroundImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var selectButtonAttributes = new SelectButtonAttributes(); - selectButtonAttributes.CheckBackgroundImageAttributes = new ImageAttributes(); - Assert.IsNotNull(selectButtonAttributes.CheckBackgroundImageAttributes, "Should be not null!"); - Assert.IsInstanceOf(selectButtonAttributes.CheckBackgroundImageAttributes, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test CheckShadowImageAttributes. Check whether CheckShadowImageAttributes is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectButtonAttributes.CheckShadowImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void CheckShadowImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var selectButtonAttributes = new SelectButtonAttributes(); - selectButtonAttributes.CheckShadowImageAttributes = new ImageAttributes(); - Assert.IsNotNull(selectButtonAttributes.CheckShadowImageAttributes, "Should be not null!"); - Assert.IsInstanceOf(selectButtonAttributes.CheckShadowImageAttributes, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.SelectButtonAttributes.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Clone_CHECK_VALUE() - { - var selectButtonAttributes = new SelectButtonAttributes(); - selectButtonAttributes.IsSelectable = true; - var attr = selectButtonAttributes.Clone() as SelectButtonAttributes; - Assert.IsNotNull(attr, "Should be not null!"); - Assert.IsInstanceOf(attr, "Should be an instance of SelectButtonAttributes!"); - Assert.AreEqual(true, attr.IsSelectable, "Should be equal!"); - } - - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSelectGroup.SelectGroupEventArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSelectGroup.SelectGroupEventArgs.cs deleted file mode 100755 index 7f4122158..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSelectGroup.SelectGroupEventArgs.cs +++ /dev/null @@ -1,66 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.SelectGroup.SelectGroupEventArgs Tests")] - public class SelectGroupEventArgsTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("SelectGroupEventArgsTests"); - App.MainTitleChangeBackgroundColor(null); - - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test SelectGroupEventArgs empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.SelectGroup.SelectGroupEventArgs.SelectGroupEventArgs C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void SelectGroupEventArgs_CHECK_VALUE() - { - /* TEST CODE */ - var selectGroupEventArgs = new SelectGroup.SelectGroupEventArgs(); - Assert.IsNotNull(selectGroupEventArgs, "Should be not null!"); - Assert.IsInstanceOf(selectGroupEventArgs, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test SelectedIndex. Check whether SelectedIndex is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectGroup.SelectGroupEventArgs.SelectedIndex A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void SelectedIndex_SET_GET_VALUE() - { - /* TEST CODE */ - var selectGroupEventArgs = new Components.SelectGroup.SelectGroupEventArgs(); - selectGroupEventArgs.SelectedIndex = 1; - Assert.AreEqual(1, selectGroupEventArgs.SelectedIndex, "Should be equal"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSelectGroup.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSelectGroup.cs deleted file mode 100755 index 597a922f9..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSelectGroup.cs +++ /dev/null @@ -1,186 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.SelectGroup Tests")] - public class SelectGroupTests - { - private const string TAG = "Components"; - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("CommonSelectGroupTests"); - App.MainTitleChangeBackgroundColor(null); - - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - public class MySelectGroup : SelectGroup - { - public MySelectGroup() : base() { } - - public void TestAddSelection(SelectButton selectButton) - { - base.AddSelection(selectButton); - } - - public void TestRemoveSelection(SelectButton selectButton) - { - base.RemoveSelection(selectButton); - - } - } - - [Test] - [Category("P1")] - [Description("Test SelectGroup. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.SelectGroup.SelectGroup C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void SelectGroup_CHECK_VALUE() - { - var checkBoxGroup = new CheckBoxGroup(); - Assert.IsNotNull(checkBoxGroup, "Should be not null!"); - Assert.IsInstanceOf(checkBoxGroup, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Count. Check whether Count is readable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectGroup.Count A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Count_GET_VALUE() - { - /* TEST CODE */ - var checkBox1 = new CheckBox(); - checkBox1.Name = "checkbox1"; - - var checkBoxGroup = new CheckBoxGroup(); - checkBoxGroup.Add(checkBox1); - - Assert.AreEqual(1, checkBoxGroup.Count, "Should be equals to checkBoxGroup.Count"); - } - - [Test] - [Category("P1")] - [Description("Test SelectedIndex. Check whether SelectedIndex is readable.")] - [Property("SPEC", "Tizen.NUI.Components.SelectGroup.SelectedIndex A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void SelectedIndex_GET_VALUE() - { - /* TEST CODE */ - var checkBox1 = new CheckBox(); - checkBox1.Name = "checkbox1"; - - var checkBoxGroup = new CheckBoxGroup(); - checkBoxGroup.Add(checkBox1); - - Assert.AreEqual(0, checkBoxGroup.SelectedIndex, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Contains. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.SelectGroup.Contains M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Contains_CHECK_VALUE() - { - var checkBox1 = new CheckBox(); - checkBox1.Name = "checkbox1"; - - var checkBoxGroup = new CheckBoxGroup(); - checkBoxGroup.Add(checkBox1); - - bool flag = checkBoxGroup.Contains(checkBox1); - - Assert.AreEqual(true, flag, "Should be true"); - - var checkBox2 = new CheckBox(); - checkBox2.Name = "checkbox2"; - flag = checkBoxGroup.Contains(checkBox2); - - Assert.AreEqual(false, flag, "Should be false!"); - } - - [Test] - [Category("P1")] - [Description("Test GetIndex. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.SelectGroup.GetIndex M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void GetIndex_CHECK_VALUE() - { - var checkBox1 = new CheckBox(); - checkBox1.Name = "checkbox1"; - - var checkBoxGroup = new CheckBoxGroup(); - checkBoxGroup.Add(checkBox1); - - int index = checkBoxGroup.GetIndex(checkBox1); - - Assert.AreEqual(0, index, "Should be same with index"); - } - - [Test] - [Category("P1")] - [Description("Test AddSelection. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.SelectGroup.AddSelection M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void AddSelection_CHECK_VALUE() - { - var mySelectGroup = new MySelectGroup(); - var selectButton = new SelectButton(); - mySelectGroup.TestAddSelection(selectButton); - - bool flag = mySelectGroup.Contains(selectButton); - - Assert.AreEqual(true, flag, "Should be equal"); - } - - [Test] - [Category("P1")] - [Description("Test RemoveSelection. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.SelectGroup.RemoveSelection M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void RemoveSelection_CHECK_VALUE() - { - var mySelectGroup = new MySelectGroup(); - var selectButton = new SelectButton(); - mySelectGroup.TestAddSelection(selectButton); - mySelectGroup.TestRemoveSelection(selectButton); - - bool flag = mySelectGroup.Contains(selectButton); - - Assert.AreEqual(false, flag, "Should be equal"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSelector.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSelector.cs deleted file mode 100755 index c9069b4cf..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSelector.cs +++ /dev/null @@ -1,231 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Threading.Tasks; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.Selector Tests")] - public class SelectorTests - { - private const string TAG = "NUI.Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("SelectorTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a Selector object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Selector.Selector C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Selector_INIT() - { - /* TEST CODE */ - var selector = new Selector(); - Assert.IsNotNull(selector, "Can't create success object Selector"); - Assert.IsInstanceOf>(selector, "Should be an instance of Selector type."); - } - - [Test] - [Category("P1")] - [Description("Test All. Check Whether All works or not")] - [Property("SPEC", "Tizen.NUI.Components.Selector.All A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void All_GET_SET_VALUE() - { - /* TEST CODE */ - var selector = new Selector(); - selector.All = 1; - Assert.AreEqual(1, selector.All, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Normal. Check Whether Normal works or not")] - [Property("SPEC", "Tizen.NUI.Components.Selector.Normal A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Normal_GET_SET_VALUE() - { - /* TEST CODE */ - var selector = new Selector(); - selector.Normal = 1; - Assert.AreEqual(1, selector.Normal, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Pressed. Check Whether Pressed works or not")] - [Property("SPEC", "Tizen.NUI.Components.Selector.Pressed A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Pressed_GET_SET_VALUE() - { - /* TEST CODE */ - var selector = new Selector(); - selector.Pressed = 1; - Assert.AreEqual(1, selector.Pressed, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Focused. Check Whether Focused works or not")] - [Property("SPEC", "Tizen.NUI.Components.Selector.Focused A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Focused_GET_SET_VALUE() - { - /* TEST CODE */ - var selector = new Selector(); - selector.Focused = 1; - Assert.AreEqual(1, selector.Focused, "Should be equal!"); - } - - - [Test] - [Category("P1")] - [Description("Test Selected. Check Whether Selected works or not")] - [Property("SPEC", "Tizen.NUI.Components.Selector.Selected A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Selected_GET_SET_VALUE() - { - /* TEST CODE */ - var selector = new Selector(); - selector.Selected = 1; - Assert.AreEqual(1, selector.Selected, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Disabled. Check Whether Disabled works or not")] - [Property("SPEC", "Tizen.NUI.Components.Selector.Disabled A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Disabled_GET_SET_VALUE() - { - /* TEST CODE */ - var selector = new Selector(); - selector.Disabled = 1; - Assert.AreEqual(1, selector.Disabled, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test DisabledFocused. Check Whether DisabledFocused works or not")] - [Property("SPEC", "Tizen.NUI.Components.Selector.DisabledFocused A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void DisabledFocused_GET_SET_VALUE() - { - /* TEST CODE */ - var selector = new Selector(); - selector.DisabledFocused = 1; - Assert.AreEqual(1, selector.DisabledFocused, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test SelectedFocused. Check Whether SelectedFocused works or not")] - [Property("SPEC", "Tizen.NUI.Components.Selector.SelectedFocused A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void SelectedFocused_GET_SET_VALUE() - { - /* TEST CODE */ - var selector = new Selector(); - selector.SelectedFocused = 1; - Assert.AreEqual(1, selector.SelectedFocused, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test DisabledSelected. Check Whether DisabledSelected works or not")] - [Property("SPEC", "Tizen.NUI.Components.Selector.DisabledSelected A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void DisabledSelected_GET_SET_VALUE() - { - /* TEST CODE */ - var selector = new Selector(); - selector.DisabledSelected = 1; - Assert.AreEqual(1, selector.DisabledSelected, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Other. Check Whether Other works or not")] - [Property("SPEC", "Tizen.NUI.Components.Selector.Other A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Other_GET_SET_VALUE() - { - /* TEST CODE */ - var selector = new Selector(); - selector.Other = 1; - Assert.AreEqual(1, selector.Other, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test GetValue. Check Whether GetValue works or not")] - [Property("SPEC", "Tizen.NUI.Components.Selector.GetValue M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetValue_GET_SET_VALUE() - { - /* TEST CODE */ - var selector = new Selector(); - selector.Focused = 1; - Assert.AreEqual(1, selector.GetValue(ControlStates.Focused), "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check Whether Clone works or not")] - [Property("SPEC", "Tizen.NUI.Components.Selector.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Clone_GET_SET_VALUE() - { - /* TEST CODE */ - var selector = new Selector(); - selector.Focused = 1; - var selector2 = new Selector(); - selector2.Clone(selector); - Assert.AreEqual(1, selector2.Focused, "Should be equal!"); - } - - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSlider.SlidingFinishedArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSlider.SlidingFinishedArgs.cs index f1ea0a8b2..6ffa2763b 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSlider.SlidingFinishedArgs.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSlider.SlidingFinishedArgs.cs @@ -48,6 +48,9 @@ namespace Tizen.NUI.Components.Tests public void CurrentValue_SET_GET_VALUE() { var eventArgs = new Slider.SlidingFinishedArgs(); + Assert.IsNotNull(eventArgs, "Should be not null!"); + Assert.IsInstanceOf(eventArgs, "Should return SlidingFinishedArgs instance."); + eventArgs.CurrentValue = 100.0f; Assert.AreEqual(100.0f, eventArgs.CurrentValue, "Retrieved CurrentValue should be equal to set value."); } 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 index 870d7bca2..b32a50b4e 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSlider.StateChangedArgs.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSlider.StateChangedArgs.cs @@ -48,6 +48,9 @@ namespace Tizen.NUI.Components.Tests 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; diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSlider.ValueChangedArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSlider.ValueChangedArgs.cs index bfc46e4f7..f584b8abc 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSlider.ValueChangedArgs.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSlider.ValueChangedArgs.cs @@ -48,6 +48,9 @@ namespace Tizen.NUI.Components.Tests public void CurrentValue_SET_GET_VALUE() { var eventArgs = new Slider.ValueChangedArgs(); + Assert.IsNotNull(eventArgs, "Should be not null!"); + Assert.IsInstanceOf(eventArgs, "Should return ValueChangedArgs instance."); + eventArgs.CurrentValue = 100.0f; Assert.AreEqual(100.0f, eventArgs.CurrentValue, "Retrieved CurrentValue should be equal to set value."); } diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSlider.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSlider.cs index 7c08044cd..77f5b2d9f 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSlider.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSlider.cs @@ -62,40 +62,7 @@ namespace Tizen.NUI.Components.Tests { var slider = new Slider(); Assert.IsNotNull(slider, "Can't create success object Slider"); - Assert.IsInstanceOf(slider, "Costruct Test Fail"); - } - - [Test] - [Category("P1")] - [Description("Create a Slider object with attributes. Check whether object whose text is initialized is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Slider.Slider C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "SliderAttributes")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Slider_INIT_WITH_SliderAttributes() - { - /* TEST CODE */ - var slider = new Slider(new SliderAttributes()); - Assert.IsNotNull(slider, "Can't create success object Slider"); - Assert.IsInstanceOf(slider, "Should be an instance of textLabel type."); - } - - [Test] - [Category("P1")] - [Description("Create a Slider object with string. Check whether object whose text is initialized is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Slider.Slider C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Slider_INIT_WITH_STRING() - { - /* TEST CODE */ - StyleManager.Instance.RegisterStyle("DefaultSlider", "Utility", typeof(UtilityDefaultSliderStyle), true); - var slider = new Slider("DefaultSlider"); - Assert.IsNotNull(slider, "Can't create success object Slider"); - Assert.IsInstanceOf(slider, "Should be an instance of Slider type."); + Assert.IsInstanceOf(slider, "Costruct Slider Fail"); } [Test] @@ -108,6 +75,9 @@ namespace Tizen.NUI.Components.Tests public void Direction_SET_GET_VALUE() { var slider = new Slider(); + Assert.IsNotNull(slider, "Can't create success object Slider"); + Assert.IsInstanceOf(slider, "Costruct Slider Fail"); + slider.Direction = Slider.DirectionType.Horizontal; Assert.AreEqual(Slider.DirectionType.Horizontal, slider.Direction, "Retrieved Direction should be equal to set value."); slider.Direction = Slider.DirectionType.Vertical; @@ -124,6 +94,9 @@ namespace Tizen.NUI.Components.Tests public void Indicator_SET_GET_VALUE() { var slider = new Slider(); + Assert.IsNotNull(slider, "Can't create success object Slider"); + Assert.IsInstanceOf(slider, "Costruct Slider Fail"); + slider.Indicator = Slider.IndicatorType.Image; Assert.AreEqual(Slider.IndicatorType.Image, slider.Indicator, "Retrieved Indicator should be equal to set value."); slider.Indicator = Slider.IndicatorType.Text; @@ -142,6 +115,9 @@ namespace Tizen.NUI.Components.Tests public void MinValue_SET_GET_VALUE() { var slider = new Slider(); + Assert.IsNotNull(slider, "Can't create success object Slider"); + Assert.IsInstanceOf(slider, "Costruct Slider Fail"); + slider.MinValue = 1; Assert.AreEqual(1, slider.MinValue, "Retrieved MinValue should be equal to set value."); } @@ -156,6 +132,9 @@ namespace Tizen.NUI.Components.Tests public void MaxValue_SET_GET_VALUE() { var slider = new Slider(); + Assert.IsNotNull(slider, "Can't create success object Slider"); + Assert.IsInstanceOf(slider, "Costruct Slider Fail"); + slider.MaxValue = 100; Assert.AreEqual(100, slider.MaxValue, "Retrieved MaxValue should be equal to set value."); } @@ -170,6 +149,9 @@ namespace Tizen.NUI.Components.Tests public void CurrentValue_SET_GET_VALUE() { var slider = new Slider(); + Assert.IsNotNull(slider, "Can't create success object Slider"); + Assert.IsInstanceOf(slider, "Costruct Slider Fail"); + slider.CurrentValue = 50; Assert.AreEqual(50, slider.CurrentValue, "Retrieved CurrentValue should be equal to set value."); } @@ -184,25 +166,14 @@ namespace Tizen.NUI.Components.Tests public void ThumbSize_SET_GET_VALUE() { var slider = new Slider(); - slider.ThumbSize = new Size2D(100,100); + Assert.IsNotNull(slider, "Can't create success object Slider"); + + Assert.IsInstanceOf(slider, "Costruct Slider Fail"); + slider.ThumbSize = new Size(100,100); Assert.AreEqual(100, slider.ThumbSize.Width, "Retrieved ThumbSize width should be equal to set value."); Assert.AreEqual(100, slider.ThumbSize.Height, "Retrieved ThumbSize height should be equal to set value."); } - [Test] - [Category("P1")] - [Description("Test ThumbImageBackgroundURLSelector. Check ThumbImageBackgroundURLSelector works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Slider.ThumbImageBackgroundURLSelector A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void ThumbImageBackgroundURLSelector_SET_GET_VALUE() - { - var slider = new Slider(); - slider.ThumbImageBackgroundURLSelector = new StringSelector(){All="background"}; - Assert.AreEqual("background", slider.ThumbImageBackgroundURLSelector.All, "Retrieved ThumbImageBackgroundURLSelector should be equal to set value."); - } - [Test] [Category("P1")] [Description("Test ThumbImageURL. Check whether ThumbImageURL works or not.")] @@ -214,6 +185,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var slider = new Slider(); + Assert.IsNotNull(slider, "Can't create success object Slider"); + Assert.IsInstanceOf(slider, "Costruct Slider Fail"); + slider.ThumbImageURL = "sliderurl"; Assert.AreEqual("sliderurl", slider.ThumbImageURL, "Retrieved ThumbImageURL should be equal to set value"); } @@ -228,6 +202,9 @@ namespace Tizen.NUI.Components.Tests public void ThumbImageURLSelector_SET_GET_VALUE() { var slider = new Slider(); + Assert.IsNotNull(slider, "Can't create success object Slider"); + Assert.IsInstanceOf(slider, "Costruct Slider Fail"); + slider.ThumbImageURLSelector = new StringSelector(){All="background"}; Assert.AreEqual("background", slider.ThumbImageURLSelector.All, "Retrieved ThumbImageURLSelector should be equal to set value."); } @@ -243,7 +220,13 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var slider = new Slider(); - Color color = Color.Red; + Assert.IsNotNull(slider, "Can't create success object Slider"); + Assert.IsInstanceOf(slider, "Costruct Slider Fail"); + + var color = Color.Red; + Assert.IsNotNull(color, "Should be not null!"); + Assert.IsInstanceOf(color, "Should be equal"); + slider.BgTrackColor = color; Assert.AreEqual(color.R, slider.BgTrackColor.R, "Retrieved BgTrackColor should be equal to set value"); Assert.AreEqual(color.G, slider.BgTrackColor.G, "Retrieved BgTrackColor should be equal to set value"); @@ -262,7 +245,13 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var slider = new Slider(); - Color color = Color.Red; + Assert.IsNotNull(slider, "Can't create success object Slider"); + Assert.IsInstanceOf(slider, "Costruct Slider Fail"); + + var color = Color.Red; + Assert.IsNotNull(color, "Should be not null!"); + Assert.IsInstanceOf(color, "Should be equal"); + slider.SlidedTrackColor = color; Assert.AreEqual(color.R, slider.SlidedTrackColor.R, "Retrieved SlidedTrackColor should be equal to set value"); Assert.AreEqual(color.G, slider.SlidedTrackColor.G, "Retrieved SlidedTrackColor should be equal to set value"); @@ -281,6 +270,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var slider = new Slider(); + Assert.IsNotNull(slider, "Can't create success object Slider"); + Assert.IsInstanceOf(slider, "Costruct Slider Fail"); + slider.TrackThickness = 20; Assert.AreEqual(20, slider.TrackThickness, "Retrieved TrackThickness should be equal to set value"); } @@ -296,6 +288,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var slider = new Slider(); + Assert.IsNotNull(slider, "Can't create success object Slider"); + Assert.IsInstanceOf(slider, "Costruct Slider Fail"); + slider.LowIndicatorImageURL = "sliderurl"; Assert.AreEqual("sliderurl", slider.LowIndicatorImageURL, "Retrieved LowIndicatorImageURL should be equal to set value"); } @@ -311,6 +306,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var slider = new Slider(); + Assert.IsNotNull(slider, "Can't create success object Slider"); + Assert.IsInstanceOf(slider, "Costruct Slider Fail"); + slider.HighIndicatorImageURL = "sliderurl"; Assert.AreEqual("sliderurl", slider.HighIndicatorImageURL, "Retrieved HighIndicatorImageURL should be equal to set value"); } @@ -326,6 +324,7 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var slider = new Slider(); + Assert.IsNotNull(slider, "Can't create success object Slider"); Assert.IsInstanceOf(slider, "Should be an instance of Slider type"); slider.LowIndicatorTextContent = "slider"; Assert.AreEqual("slider", slider.LowIndicatorTextContent, "Retrieved LowIndicatorTextContent width should be equal to set value"); @@ -342,6 +341,7 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var slider = new Slider(); + Assert.IsNotNull(slider, "Can't create success object Slider"); Assert.IsInstanceOf(slider, "Should be an instance of Slider type"); slider.HighIndicatorTextContent = "hinttext"; Assert.AreEqual("hinttext", slider.HighIndicatorTextContent, "Retrieved HighIndicatorTextContent should be equal to set value"); @@ -358,8 +358,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var slider = new Slider(); + Assert.IsNotNull(slider, "Can't create success object Slider"); Assert.IsInstanceOf(slider, "Should be an instance of Slider type"); - slider.LowIndicatorSize = new Size2D(100, 100); + slider.LowIndicatorSize = new Size(100, 100); Assert.AreEqual(100, slider.LowIndicatorSize.Width, "Retrieved LowIndicatorSize width should be equal to set value"); Assert.AreEqual(100, slider.LowIndicatorSize.Height, "Retrieved LowIndicatorSize height should be equal to set value"); } @@ -375,8 +376,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var slider = new Slider(); + Assert.IsNotNull(slider, "Can't create success object Slider"); Assert.IsInstanceOf(slider, "Should be an instance of Slider type"); - slider.HighIndicatorSize = new Size2D(100, 100); + slider.HighIndicatorSize = new Size(100, 100); Assert.AreEqual(100, slider.HighIndicatorSize.Width, "Retrieved HighIndicatorSize width should be equal to set value"); Assert.AreEqual(100, slider.HighIndicatorSize.Height, "Retrieved HighIndicatorSize height should be equal to set value"); } @@ -392,136 +394,13 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var slider = new Slider(); + Assert.IsNotNull(slider, "Can't create success object Slider"); + Assert.IsInstanceOf(slider, "Should be an instance of Slider type"); + slider.SpaceBetweenTrackAndIndicator = 20; Assert.AreEqual(20, slider.SpaceBetweenTrackAndIndicator, "Retrieved SpaceBetweenTrackAndIndicator should be equal to set value"); } - [Test] - [Category("P1")] - [Description("Test GetAttributes. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Slider.GetAttributes M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void GetAttributes_CHECK_VALUE() - { - /* TEST CODE */ - try - { - var mySlider = new MySlider(); - Assert.IsTrue(mySlider.flagGetAttributes, "GetAttributes trigger Check Fail."); - } - 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 OnUpdate. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Slider.OnUpdate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public async Task OnUpdate_CHECK_VALUE() - { - /* TEST CODE */ - var mySlider = new MySlider(); - Window.Instance.Add(mySlider); - try - { - await Task.Delay(200); - Assert.IsTrue(mySlider.flagOnUpdate, "OnUpdate trigger Check Fail."); - } - 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(mySlider); - } - } - - [Test] - [Category("P1")] - [Description("Test OnThemeChangedEvent. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Slider.OnThemeChangedEvent M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public async Task OnThemeChangedEvent_CHECK_VALUE() - { - /* TEST CODE */ - StyleManager.Instance.Theme = "Utility"; - var mySlider = new MySlider(); - Window.Instance.Add(mySlider); - try - { - StyleManager.Instance.Theme = "Food"; - await Task.Delay(200); - Assert.IsTrue(mySlider.flagOnThemeChangedEvent, "OnThemeChangedEvent trigger Check Fail."); - } - 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(mySlider); - } - } - - [Test] - [Category("P1")] - [Description("Test OnFocusGained. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Slider.OnFocusGained M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void OnFocusGained_CHECK_VALUE() - { - /* TEST CODE */ - Window window = Window.Instance; - var mySlider = new MySlider(); - mySlider.Focusable = true; - window.Add(mySlider); - FocusManager.Instance.SetCurrentFocusView(mySlider); - Assert.AreEqual(true, mySlider.flagFocusGained, "OnFocusGained Check Fail."); - window.Remove(mySlider); - } - - [Test] - [Category("P1")] - [Description("Test OnFocusLost. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Slider.OnFocusLost M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void OnFocusLost_CHECK_VALUE() - { - /* TEST CODE */ - Window window = Window.Instance; - var mySlider = new MySlider(); - var mySlider2 = new MySlider(); - mySlider.Focusable = true; - mySlider2.Focusable = true; - window.Add(mySlider); - window.Add(mySlider2); - FocusManager.Instance.SetCurrentFocusView(mySlider); - FocusManager.Instance.SetCurrentFocusView(mySlider2); - Assert.AreEqual(true, mySlider.flagFocusLost, "OnFocusLost Check Fail."); - window.Remove(mySlider); - window.Remove(mySlider2); - } - [Test] [Category("P1")] [Description("Test Dispose, try to dispose the Slider.")] @@ -534,7 +413,10 @@ namespace Tizen.NUI.Components.Tests /* TEST CODE */ try { - Slider slider = new Slider(); + var slider = new Slider(); + Assert.IsNotNull(slider, "Can't create success object Slider"); + Assert.IsInstanceOf(slider, "Should be an instance of Slider type"); + slider.Dispose(); } catch (Exception e) @@ -545,97 +427,4 @@ namespace Tizen.NUI.Components.Tests } } } - - public class MySlider : Slider - { - public bool flagGetAttributes = false; - public bool flagOnUpdate = false; - public bool flagOnThemeChangedEvent = false; - public bool flagFocusGained = false; - public bool flagFocusLost = false; - - public MySlider() : base() - { } - - public MySlider(string style) : base(style) - { } - - public override void OnFocusGained() - { - flagFocusGained = true; - } - - public override void OnFocusLost() - { - flagFocusLost = true; - } - - protected override Attributes GetAttributes() - { - flagGetAttributes = true; - return new SliderAttributes(); - } - - protected override void OnUpdate() - { - base.OnUpdate(); - flagOnUpdate = true; - } - - protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e) - { - flagOnThemeChangedEvent = true; - } - } - - internal class UtilityDefaultSliderStyle : StyleBase - { - protected override Attributes GetAttributes() - { - if (Content != null) - { - return (Content as Attributes).Clone(); - } - SliderAttributes attributes = new SliderAttributes - { - TrackThickness = 4, - BackgroundTrackAttributes = new ImageAttributes - { - BackgroundColor = new ColorSelector - { - All = new Color(0, 0, 0, 0.1f), - } - }, - - SlidedTrackAttributes = new ImageAttributes - { - BackgroundColor = new ColorSelector - { - All = Color.Green, - } - }, - - ThumbAttributes = new ImageAttributes - { - ResourceURL = new StringSelector - { - Normal = "9. Controller/controller_btn_slide_handler_normal.png", - Pressed = "9. Controller/controller_btn_slide_handler_press.png", - } - }, - - ThumbBackgroundAttributes = new ImageAttributes - { - Size2D = new Size2D(60, 60), - ResourceURL = new StringSelector - { - Normal = "", - Pressed = "9. Controller/controller_btn_slide_handler_effect.png", - } - } - }; - - return attributes; - } - } } diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSliderAttributes.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSliderAttributes.cs deleted file mode 100755 index 7dc95fdf5..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSliderAttributes.cs +++ /dev/null @@ -1,254 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.SliderAttributes Tests")] - public class SliderAttributesTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("SliderAttributesTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a SliderAttributes object. Check whether SliderAttributes is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.SliderAttributes.SliderAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void SliderAttributes_INIT() - { - /* TEST CODE */ - var sliderAttributes = new SliderAttributes(); - Assert.IsNotNull(sliderAttributes, "Can't create success object SliderAttributes"); - Assert.IsInstanceOf(sliderAttributes, "Should be an instance of SliderAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Create a SliderAttributes object. Check whether SliderAttributes is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.SliderAttributes.SliderAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "SliderAttributes")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void SliderAttributes_INIT_WITH_SliderAttributes() - { - /* TEST CODE */ - var sliderAttributes = new SliderAttributes(); - var sliderAttributes2 = new SliderAttributes(sliderAttributes); - Assert.IsNotNull(sliderAttributes2, "Can't create success object SliderAttributes"); - Assert.IsInstanceOf(sliderAttributes2, "Should be an instance of SliderAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Test BackgroundTrackAttributes. Check whether BackgroundTrackAttributes is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SliderAttributes.BackgroundTrackAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void BackgroundTrackAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var sliderAttributes = new SliderAttributes(); - var imageAttributes = new ImageAttributes() { ResourceURL = new StringSelector() { All = "test.png" } }; - sliderAttributes.BackgroundTrackAttributes = imageAttributes; - Assert.AreEqual(imageAttributes.ResourceURL.All, sliderAttributes.BackgroundTrackAttributes.ResourceURL.All, "Retrieved BackgroundTrackAttributes should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test SlidedTrackAttributes. Check whether SlidedTrackAttributes is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SliderAttributes.SlidedTrackAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void SlidedTrackAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var sliderAttributes = new SliderAttributes(); - var imageAttributes = new ImageAttributes() { ResourceURL = new StringSelector() { All = "test.png" } }; - sliderAttributes.SlidedTrackAttributes = imageAttributes; - Assert.AreEqual(imageAttributes.ResourceURL.All, sliderAttributes.SlidedTrackAttributes.ResourceURL.All, "Retrieved SlidedTrackAttributes should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test ThumbAttributes. Check whether ThumbAttributes is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SliderAttributes.ThumbAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void ThumbAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var sliderAttributes = new SliderAttributes(); - var imageAttributes = new ImageAttributes() { ResourceURL = new StringSelector() { All = "test.png" } }; - sliderAttributes.ThumbAttributes = imageAttributes; - Assert.AreEqual(imageAttributes, sliderAttributes.ThumbAttributes, "Retrieved ThumbAttributes should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test ThumbBackgroundAttributes. Check whether ThumbBackgroundAttributes is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SliderAttributes.ThumbBackgroundAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void ThumbBackgroundAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var sliderAttributes = new SliderAttributes(); - var imageAttributes = new ImageAttributes() { ResourceURL = new StringSelector() { All = "test.png" } }; - sliderAttributes.ThumbBackgroundAttributes = imageAttributes; - Assert.AreEqual(imageAttributes.ResourceURL.All, sliderAttributes.ThumbBackgroundAttributes.ResourceURL.All, "Retrieved ThumbBackgroundAttributes should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test LowIndicatorImageAttributes. Check whether LowIndicatorImageAttributes is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SliderAttributes.LowIndicatorImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void LowIndicatorImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var sliderAttributes = new SliderAttributes(); - var imageAttributes = new ImageAttributes() { ResourceURL = new StringSelector() { All = "test.png" } }; - sliderAttributes.LowIndicatorImageAttributes = imageAttributes; - Assert.AreEqual(imageAttributes.ResourceURL.All, sliderAttributes.LowIndicatorImageAttributes.ResourceURL.All, "Retrieved LowIndicatorImageAttributes should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test HighIndicatorImageAttributes. Check whether HighIndicatorImageAttributes is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SliderAttributes.HighIndicatorImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void HighIndicatorImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var sliderAttributes = new SliderAttributes(); - var imageAttributes = new ImageAttributes() { ResourceURL = new StringSelector() { All = "test.png" } }; - sliderAttributes.HighIndicatorImageAttributes = imageAttributes; - Assert.AreEqual(imageAttributes.ResourceURL.All, sliderAttributes.HighIndicatorImageAttributes.ResourceURL.All, "Retrieved HighIndicatorImageAttributes should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test LowIndicatorTextAttributes. Check whether LowIndicatorTextAttributes is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SliderAttributes.LowIndicatorTextAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void LowIndicatorTextAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var sliderAttributes = new SliderAttributes(); - var textAttributes = new TextAttributes() { Text = new StringSelector() { All = "test" } }; - sliderAttributes.LowIndicatorTextAttributes = textAttributes; - Assert.AreEqual(textAttributes.Text.All, sliderAttributes.LowIndicatorTextAttributes.Text.All, "Retrieved LowIndicatorTextAttributes should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test HighIndicatorTextAttributes. Check whether HighIndicatorTextAttributes is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SliderAttributes.HighIndicatorTextAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void HighIndicatorTextAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var sliderAttributes = new SliderAttributes(); - var textAttributes = new TextAttributes() { Text = new StringSelector() { All = "test" } }; - sliderAttributes.HighIndicatorTextAttributes = textAttributes; - Assert.AreEqual(textAttributes.Text.All, sliderAttributes.HighIndicatorTextAttributes.Text.All, "Retrieved HighIndicatorTextAttributes should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TrackThickness. Check whether TrackThickness is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SliderAttributes.TrackThickness A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void TrackThickness_SET_GET_VALUE() - { - /* TEST CODE */ - var sliderAttributes = new SliderAttributes(); - sliderAttributes.TrackThickness = 4; - Assert.AreEqual(4, sliderAttributes.TrackThickness, "Retrieved TrackThickness should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test SpaceBetweenTrackAndIndicator. Check whether SpaceBetweenTrackAndIndicator is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SliderAttributes.SpaceBetweenTrackAndIndicator A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void SpaceBetweenTrackAndIndicator_SET_GET_VALUE() - { - /* TEST CODE */ - var sliderAttributes = new SliderAttributes(); - sliderAttributes.SpaceBetweenTrackAndIndicator = 4; - Assert.AreEqual(4, sliderAttributes.SpaceBetweenTrackAndIndicator, "Retrieved SpaceBetweenTrackAndIndicator should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test IndicatorType. Check whether IndicatorType is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.SliderAttributes.IndicatorType A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void IndicatorType_SET_GET_VALUE() - { - /* TEST CODE */ - var sliderAttributes = new SliderAttributes(); - sliderAttributes.IndicatorType = Slider.IndicatorType.Image; - Assert.AreEqual(Slider.IndicatorType.Image, sliderAttributes.IndicatorType, "Retrieved IndicatorType should be equal to set value"); - sliderAttributes.IndicatorType = Slider.IndicatorType.None; - Assert.AreEqual(Slider.IndicatorType.None, sliderAttributes.IndicatorType, "Retrieved IndicatorType should be equal to set value"); - sliderAttributes.IndicatorType = Slider.IndicatorType.Text; - Assert.AreEqual(Slider.IndicatorType.Text, sliderAttributes.IndicatorType, "Retrieved IndicatorType should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check whether Clone works or not")] - [Property("SPEC", "Tizen.NUI.Components.SliderAttributes.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Clone_CHECK_RETURN_VALUE() - { - var sliderAttributes = new SliderAttributes(); - sliderAttributes.TrackThickness = 30; - var sliderAttributes2 = sliderAttributes.Clone() as SliderAttributes; - Assert.AreEqual(sliderAttributes.TrackThickness, sliderAttributes2.TrackThickness, "Retrieved TrackThickness should be equal to clone value"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSStringSelector.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSStringSelector.cs deleted file mode 100755 index 7fca416e0..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSStringSelector.cs +++ /dev/null @@ -1,64 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Threading.Tasks; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.StringSelector Tests")] - public class StringSelectorTests - { - private const string TAG = "NUI.Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("StringSelectorTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a StringSelector object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.StringSelector.StringSelector C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void StringSelector_INIT() - { - /* TEST CODE */ - var stringSelector = new StringSelector(); - Assert.IsNotNull(stringSelector, "Can't create success object StringSelector"); - Assert.IsInstanceOf(stringSelector, "Should be an instance of StringSelector type."); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check Whether Clone works or not")] - [Property("SPEC", "Tizen.NUI.Components.StringSelector.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Clone_TEST() - { - /* TEST CODE */ - var stringSelector1 = new StringSelector(); - stringSelector1.All = "TEST"; - var stringSelector = stringSelector1.Clone(); - Assert.IsNotNull(stringSelector, "should be not null!"); - Assert.AreEqual("TEST", stringSelector.All); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSStyleBase.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSStyleBase.cs deleted file mode 100755 index a35e25bae..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSStyleBase.cs +++ /dev/null @@ -1,120 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Threading.Tasks; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.StyleBase Tests")] - public class StyleBaseTests - { - private const string TAG = "NUI.Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("StyleBaseTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a StyleBase object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.StyleBase.StyleBase C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void StyleBase_INIT() - { - /* TEST CODE */ - var styleBase = new StyleBase(); - Assert.IsNotNull(styleBase, "Can't create success object StyleBase"); - Assert.IsInstanceOf(styleBase, "Should be an instance of StyleBase type."); - } - - [Test] - [Category("P1")] - [Description("Test Content.Check whether Content is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.StyleBase.Content A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Content_SET_GET_VALUE() - { - /* TEST CODE */ - var style = new MyControlStyle(); - style.SetContent(); - object content = style.GetContent(); - Assert.IsNotNull(content, "Should be not null!"); - } - - [Test] - [Category("P1")] - [Description("Test GetAttributes. Check Whether GetAttributes works or not")] - [Property("SPEC", "Tizen.NUI.Components.StyleBase.GetAttributes M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetAttributes_TEST() - { - /* TEST CODE */ - try - { - var myControl = new MyControlStyle(); - var attr = myControl.TestGetAttributes() as ControlTests.MyControlAttributes; - Assert.IsNotNull(attr, "Should be not null"); - Assert.IsInstanceOf(attr, "Should be an instance of Attributes!"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - } - - public class MyControlStyle : StyleBase - { - protected override Attributes GetAttributes() - { - ControlTests.MyControlAttributes attributes = new ControlTests.MyControlAttributes - { - BGImageAttributes = new ImageAttributes - { - BackgroundColor = new ColorSelector - { - All = new Color(0.43f, 0.43f, 0.43f, 0.6f), - } - }, - }; - return attributes; - } - - public void SetContent() - { - Content = GetAttributes(); - } - - public object GetContent() - { - return Content; - } - - public Attributes TestGetAttributes() - { - return GetAttributes(); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSStyleManager.ThemeChangeEventArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSStyleManager.ThemeChangeEventArgs.cs deleted file mode 100755 index 5eb60d514..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSStyleManager.ThemeChangeEventArgs.cs +++ /dev/null @@ -1,67 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.StyleManager.ThemeChangeEventArgs Tests")] - public class ThemeChangeEventArgsTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("ThemeChangeEventArgsTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a ThemeChangeEventArgs object. Check whether ThemeChangeEventArgs is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.StyleManager.ThemeChangeEventArgs.ThemeChangeEventArgs C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ThemeChangeEventArgs_INIT() - { - /* TEST CODE */ - var themeChangedEventArgs = new Components.StyleManager.ThemeChangeEventArgs(); - Assert.IsNotNull(themeChangedEventArgs, "Can't create success object ThemeChangeEventArgs"); - Assert.IsInstanceOf(themeChangedEventArgs, "Should be an instance of ThemeChangeEventArgs type."); - } - - - [Test] - [Category("P1")] - [Description("Test CurrentTheme. Check whether CurrentTheme is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.StyleManager.ThemeChangeEventArgs.CurrentTheme A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void CurrentTheme_SET_GET_VALUE() - { - /* TEST CODE */ - Components.StyleManager.Instance.Theme = "Utility"; - Components.StyleManager.Instance.Theme = "Food"; - Components.StyleManager.Instance.ThemeChangedEvent += OnThemeChanged; - Components.StyleManager.Instance.ThemeChangedEvent -= OnThemeChanged; - } - - private void OnThemeChanged(object sender, Components.StyleManager.ThemeChangeEventArgs args) - { - Assert.AreEqual("Food", args.CurrentTheme, "Should be equal!"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSStyleManager.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSStyleManager.cs deleted file mode 100755 index 7734ad050..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSStyleManager.cs +++ /dev/null @@ -1,159 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Threading.Tasks; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.StyleManager Tests")] - public class StyleManagerTests - { - private const string TAG = "NUI.Components"; - private bool _themeChangedFlag = false; - - [SetUp] - public void Init() - { - _themeChangedFlag = false; - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("StyleManagerTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test Instance.Check whether Instance is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.StyleManager.Instance A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Instance_GET_VALUE() - { - /* TEST CODE */ - var styleManager = Tizen.NUI.Components.StyleManager.Instance; - Assert.IsNotNull(styleManager, "Should be not null"); - Assert.IsInstanceOf(styleManager, "Should be an instance of StyleManager type."); - } - - [Test] - [Category("P1")] - [Description("Test RegisterStyle. Check whether RegisterStyle works or not.")] - [Property("SPEC", "Tizen.NUI.Components.StyleManager.RegisterStyle M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void RegisterStyle_TEST() - { - /* TEST CODE */ - try - { - Components.StyleManager.Instance.RegisterStyle("MyControl", "Utility", typeof(Tizen.NUI.Components.Tests.MyControlStyle)); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test GetAttributes. Check whether GetAttributes works or not.")] - [Property("SPEC", "Tizen.NUI.Components.StyleManager.GetAttributes M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void GetAttributes_TEST() - { - /* TEST CODE */ - try - { - Components.StyleManager.Instance.RegisterStyle("MyControl", "Food", typeof(Tizen.NUI.Components.Tests.MyControlFoodStyle), true); - var attributes = Components.StyleManager.Instance.GetAttributes("MyControl"); - Assert.IsNotNull(attributes, "Should be not null"); - Assert.IsInstanceOf(attributes, "Should be an instance of Attributes"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test ThemeChangedEvent. Check Whether ThemeChangedEvent works or not")] - [Property("SPEC", "Tizen.NUI.Components.StyleManager.ThemeChangedEvent E")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "EVL")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ThemeChangedEvent_TEST() - { - /* TEST CODE */ - try - { - Components.StyleManager.Instance.Theme = "Utility"; - Components.StyleManager.Instance.ThemeChangedEvent += OnThemeChangedEvent; - Components.StyleManager.Instance.Theme = "Food"; - Assert.IsTrue(_themeChangedFlag, "Should be true!"); - Components.StyleManager.Instance.ThemeChangedEvent -= OnThemeChangedEvent; - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - private void OnThemeChangedEvent(object sender, EventArgs args) - { - _themeChangedFlag = true; - } - - [Test] - [Category("P1")] - [Description("Test Theme. Check whether Theme works or not.")] - [Property("SPEC", "Tizen.NUI.Components.StyleManager.Theme A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Theme_SET_GET_VALUE() - { - /* TEST CODE */ - try - { - Components.StyleManager.Instance.Theme = "Utility"; - Assert.AreEqual("Utility", Components.StyleManager.Instance.Theme, "Should be equal!"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - } - - public class MyControlFoodStyle : StyleBase - { - protected override Attributes GetAttributes() - { - ControlTests.MyControlAttributes attributes = new ControlTests.MyControlAttributes - { - BGImageAttributes = new ImageAttributes - { - BackgroundColor = new ColorSelector - { - All = new Color(0.43f, 0.43f, 0.43f, 0.6f), - } - }, - }; - return attributes; - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSwitch.SelectEventArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSwitch.SelectEventArgs.cs index fb763f38f..c9797e96a 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSwitch.SelectEventArgs.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSwitch.SelectEventArgs.cs @@ -59,6 +59,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var selectEventArgs = new Switch.SelectEventArgs(); + Assert.IsNotNull(selectEventArgs, "Should be not null!"); + Assert.IsInstanceOf(selectEventArgs, "Should be equal!"); + selectEventArgs.IsSelected = true; Assert.AreEqual(true, selectEventArgs.IsSelected, "Should be equal"); selectEventArgs.IsSelected = false; diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSwitch.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSwitch.cs index 9326d7d6f..9445de7f1 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSwitch.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSwitch.cs @@ -51,73 +51,6 @@ namespace Tizen.NUI.Components.Tests [Test] [Category("P1")] - [Description("Test Switch style constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Switch.Switch C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Switch_Style_CHECK_VALUE() - { - /* TEST CODE */ - StyleManager.Instance.RegisterStyle("SwitchStyle", null, typeof(SwitchStyle)); - var _switch = new Switch("SwitchStyle"); - Assert.IsNotNull(_switch, "Should be not null!"); - Assert.IsInstanceOf(_switch, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Switch SwitchAttributes constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Switch.Switch C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "SwitchAttributes")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Switch_SwitchAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var attrs = new SwitchAttributes - { - IsSelectable = true, - SwitchBackgroundImageAttributes = new ImageAttributes - { - ResourceURL = new StringSelector - { - All = _image_path - }, - }, - SwitchHandlerImageAttributes = new ImageAttributes - { - Size2D = new Size2D(60, 60), - ResourceURL = new StringSelector - { - All = _image_path - }, - }, - }; - var _switch = new Switch(attrs); - Assert.IsNotNull(_switch, "Should be not null!"); - Assert.IsInstanceOf(_switch, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test SwitchBackgroundImageURL. Check whether SwitchBackgroundImageURL is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Switch.SwitchBackgroundImageURL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void SwitchBackgroundImageURL_SET_GET_VALUE() - { - /* TEST CODE */ - var _switch = new Switch(); - _switch.SwitchBackgroundImageURL = _image_path; - Assert.AreEqual(_image_path, _switch.SwitchBackgroundImageURL, "Should be equals to the set value of SwitchBackgroundImageURL"); - } - - [Test] - [Category("P1")] [Description("Test SwitchBackgroundImageURLSelector. Check whether SwitchBackgroundImageURLSelector is readable and writable.")] [Property("SPEC", "Tizen.NUI.Components.Switch.SwitchBackgroundImageURLSelector A")] [Property("SPEC_URL", "-")] @@ -127,11 +60,17 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var _switch = new Switch(); + Assert.IsNotNull(_switch, "Should be not null!"); + Assert.IsInstanceOf(_switch, "Should be equal!"); + StringSelector stringSelector = new StringSelector { Normal = _image_path, Selected = _image_path, }; + Assert.IsNotNull(stringSelector, "Should be not null!"); + Assert.IsInstanceOf(stringSelector, "Should be equal!"); + _switch.SwitchBackgroundImageURLSelector = stringSelector; Assert.AreEqual(stringSelector.Normal, _switch.SwitchBackgroundImageURLSelector.Normal, "Should be equals to the set value of SwitchBackgroundImageURLSelector Normal"); Assert.AreEqual(stringSelector.Selected, _switch.SwitchBackgroundImageURLSelector.Selected, "Should be equals to the set value of SwitchBackgroundImageURLSelector Selected"); @@ -148,6 +87,9 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var _switch = new Switch(); + Assert.IsNotNull(_switch, "Should be not null!"); + Assert.IsInstanceOf(_switch, "Should be equal!"); + _switch.SwitchHandlerImageURL = _image_path; Assert.AreEqual(_image_path, _switch.SwitchHandlerImageURL, "Should be equals to the set value of SwitchHandlerImageURL"); } @@ -163,11 +105,17 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var _switch = new Switch(); + Assert.IsNotNull(_switch, "Should be not null!"); + Assert.IsInstanceOf(_switch, "Should be equal!"); + StringSelector stringSelector = new StringSelector { Normal = _image_path, Selected = _image_path, }; + Assert.IsNotNull(stringSelector, "Should be not null!"); + Assert.IsInstanceOf(stringSelector, "Should be equal!"); + _switch.SwitchHandlerImageURLSelector = stringSelector; Assert.AreEqual(stringSelector.Normal, _switch.SwitchHandlerImageURLSelector.Normal, "Should be equals to the set value of SwitchHandlerImageURLSelector Normal"); Assert.AreEqual(stringSelector.Selected, _switch.SwitchHandlerImageURLSelector.Selected, "Should be equals to the set value of SwitchHandlerImageURLSelector Selected"); @@ -175,125 +123,21 @@ namespace Tizen.NUI.Components.Tests [Test] [Category("P1")] - [Description("Test SwitchHandlerImageSize2D. Check whether SwitchHandlerImageSize2D is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Switch.SwitchHandlerImageSize2D A")] + [Description("Test SwitchHandlerImageSize. Check whether SwitchHandlerImageSize is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Components.Switch.SwitchHandlerImageSize A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void SwitchHandlerImageSize2D_SET_GET_VALUE() + public void SwitchHandlerImageSize_SET_GET_VALUE() { /* TEST CODE */ var _switch = new Switch(); - _switch.SwitchHandlerImageSize2D = new Size2D(10, 10); - Assert.AreEqual(10, _switch.SwitchHandlerImageSize2D.Width, "Should be equals to the set value of SwitchHandlerImageSize2D.Width"); - Assert.AreEqual(10, _switch.SwitchHandlerImageSize2D.Height, "Should be equals to the set value of SwitchHandlerImageSize2D.Height"); - } - - [Test] - [Category("P1")] - [Description("Test OnKey. Check return the right value or not")] - [Property("SPEC", "Tizen.NUI.Components.Switch.OnKey M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void OnKey_CHECK_RETURN_VALUE() - { - /* TEST CODE */ - try - { - var _switch = new Switch(); - bool flag = true; - flag = _switch.OnKey(new Key()); - Assert.AreEqual(false, flag, "OnKey return check fail."); - } - 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 OnThemeChangedEvent. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Switch.OnThemeChangedEvent M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public async Task OnThemeChangedEvent_CHECK_VALUE() - { - Tizen.NUI.Components.StyleManager.Instance.Theme = "Utility"; - var mySwitch = new MySwitch(); - Window window = Window.Instance; - window.Add(mySwitch); - Tizen.NUI.Components.StyleManager.Instance.Theme = "Food"; - await Task.Delay(500); - Assert.AreEqual(true, mySwitch.ThemeChangeFlag, "OnThemeChangedEvent trigger Check Fail."); - window.Remove(mySwitch); - } - - public class MySwitch : Switch - { - public bool UpdateFlag = false; - public bool ThemeChangeFlag = false; - - protected override void OnUpdate() - { - UpdateFlag = true; - } - - protected override void OnThemeChangedEvent(object sender, Components.StyleManager.ThemeChangeEventArgs e) - { - ThemeChangeFlag = true; - base.OnThemeChangedEvent(sender, e); - } - - protected override Attributes GetAttributes() - { - return base.GetAttributes(); - } - - public Attributes TestGetAttributes() - { - return GetAttributes(); - } - } - - [Test] - [Category("P1")] - [Description("Test OnUpdate. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Switch.OnUpdate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MCST")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public async Task OnUpdate_CHECK_VALUE() - { - /* TEST CODE */ - var mySwitch = new MySwitch(); - mySwitch.BackgroundColor = Color.Red; - mySwitch.Size2D = new Size2D(200, 200); - Window.Instance.Add(mySwitch); - await Task.Delay(500); - Assert.AreEqual(true, mySwitch.UpdateFlag, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test GetAttributes. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Switch.GetAttributes M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void GetAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var mySwitch = new MySwitch(); - var attr = mySwitch.TestGetAttributes(); - Assert.IsNotNull(attr, "Should be not null!"); - Assert.IsInstanceOf(attr, "Should be equal!"); - + Assert.IsNotNull(_switch, "Should be not null!"); + Assert.IsInstanceOf(_switch, "Should be equal!"); + + _switch.SwitchHandlerImageSize = new Size(10, 10); + Assert.AreEqual(10, _switch.SwitchHandlerImageSize.Width, "Should be equals to the set value of SwitchHandlerImageSize2D.Width"); + Assert.AreEqual(10, _switch.SwitchHandlerImageSize.Height, "Should be equals to the set value of SwitchHandlerImageSize2D.Height"); } [Test] @@ -308,7 +152,10 @@ namespace Tizen.NUI.Components.Tests /* TEST CODE */ try { - Switch mySwitch = new Switch(); + var mySwitch = new Switch(); + Assert.IsNotNull(mySwitch, "Should be not null!"); + Assert.IsInstanceOf(mySwitch, "Should be equal!"); + mySwitch.Dispose(); } catch (Exception e) @@ -319,34 +166,4 @@ namespace Tizen.NUI.Components.Tests } } } - - public class SwitchStyle : StyleBase - { - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - protected override Attributes GetAttributes() - { - SwitchAttributes attributes = new SwitchAttributes - { - IsSelectable = true, - SwitchBackgroundImageAttributes = new ImageAttributes - { - Size2D = new Size2D(96, 60), - ResourceURL = new StringSelector - { - All = _image_path - }, - }, - SwitchHandlerImageAttributes = new ImageAttributes - { - Size2D = new Size2D(60, 60), - ResourceURL = new StringSelector - { - All = _image_path - }, - }, - }; - - return attributes; - } - } } diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSwitchAttributes.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSwitchAttributes.cs deleted file mode 100755 index e7a6a9e60..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSwitchAttributes.cs +++ /dev/null @@ -1,155 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.Components; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.SwitchAttributes Tests")] - public class SwitchAttributesTests - { - private const string TAG = "Components"; - private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("SwitchAttributesTests"); - App.MainTitleChangeBackgroundColor(null); - - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Test SwitchAttributes empty constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.SwitchAttributes.SwitchAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void SwitchAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var switchAttributes = new SwitchAttributes(); - Assert.IsNotNull(switchAttributes, "Should be not null!"); - Assert.IsInstanceOf(switchAttributes, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test SwitchAttributes copy constructor. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.SwitchAttributes.SwitchAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "SwitchAttributes")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void SwitchAttributes_SwitchAttributes_CHECK_VALUE() - { - /* TEST CODE */ - var attrs = new SwitchAttributes - { - IsSelectable = true, - SwitchBackgroundImageAttributes = new ImageAttributes - { - ResourceURL = new StringSelector - { - All = _image_path - }, - }, - SwitchHandlerImageAttributes = new ImageAttributes - { - Size2D = new Size2D(60, 60), - ResourceURL = new StringSelector - { - All = _image_path - }, - }, - }; - var switchAttributes = new SwitchAttributes(attrs); - Assert.IsNotNull(switchAttributes, "Should be not null!"); - Assert.IsInstanceOf(switchAttributes, "Should be equal!"); - - } - - [Test] - [Category("P1")] - [Description("Test SwitchHandlerImageAttributes. Check whether SwitchHandlerImageAttributes is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.SwitchAttributes.SwitchHandlerImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void SwitchHandlerImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var switchAttributes = new SwitchAttributes(); - switchAttributes.SwitchHandlerImageAttributes = new ImageAttributes(); - Assert.IsNotNull(switchAttributes.SwitchHandlerImageAttributes, "Should be not null!"); - Assert.IsInstanceOf(switchAttributes.SwitchHandlerImageAttributes, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test SwitchBackgroundImageAttributes. Check whether SwitchBackgroundImageAttributes is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.SwitchAttributes.SwitchBackgroundImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void SwitchBackgroundImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var switchAttributes = new SwitchAttributes(); - switchAttributes.SwitchBackgroundImageAttributes = new ImageAttributes(); - Assert.IsNotNull(switchAttributes.SwitchBackgroundImageAttributes, "Should be not null!"); - Assert.IsInstanceOf(switchAttributes.SwitchBackgroundImageAttributes, "Should be equals!"); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.SwitchAttributes.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")] - public void Clone_CHECK_VALUE() - { - SwitchAttributes switchAttributes = new SwitchAttributes - { - IsSelectable = true, - SwitchBackgroundImageAttributes = new ImageAttributes - { - ResourceURL = new StringSelector - { - All = _image_path - }, - }, - SwitchHandlerImageAttributes = new ImageAttributes - { - Size2D = new Size2D(60, 60), - ResourceURL = new StringSelector - { - All = _image_path - }, - }, - }; - var attr = switchAttributes.Clone() as SwitchAttributes; - Assert.IsNotNull(attr, "Should be not null!"); - Assert.IsInstanceOf(attr, "Should be equals!"); - Assert.AreEqual(_image_path, attr.SwitchHandlerImageAttributes.ResourceURL.All, "Should be equals!"); - - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.ItemChangeEventArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.ItemChangeEventArgs.cs deleted file mode 100755 index 8d12e6f25..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.ItemChangeEventArgs.cs +++ /dev/null @@ -1,69 +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.ItemChangeEventArgs Tests")] - public class ItemChangedEventArgsTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("ItemChangeEventArgsTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a ItemChangeEventArgs object. Check whether ItemChangeEventArgs is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.ItemChangeEventArgs.ItemChangeEventArgs C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void ItemChangeEventArgs_INIT() - { - var eventArgs = new Tab.ItemChangeEventArgs(); - Assert.IsNotNull(eventArgs, "Should be not null!"); - Assert.IsInstanceOf(eventArgs, "Should return ItemChangeEventArgs instance."); - } - - [Test] - [Category("P1")] - [Description("Test PreviousIndex. Check whether PreviousIndex is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.ItemChangeEventArgs.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.ItemChangeEventArgs(); - 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.ItemChangeEventArgs.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.ItemChangeEventArgs(); - 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.ItemChangedEventArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.ItemChangedEventArgs.cs new file mode 100755 index 000000000..a2dee7505 --- /dev/null +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.ItemChangedEventArgs.cs @@ -0,0 +1,75 @@ +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!"); + App.MainTitleChangeText("ItemChangedEventArgsTests"); + App.MainTitleChangeBackgroundColor(null); + } + + [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 index b869c5fe2..133524856 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.TabItemData.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.TabItemData.cs @@ -48,6 +48,9 @@ namespace Tizen.NUI.Components.Tests 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 index 412b49364..758ed4f5f 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTab.cs @@ -28,7 +28,7 @@ namespace Tizen.NUI.Components.Tests Tizen.Log.Info(TAG, "Destroy() is called!"); } - private void OnItemChangedEvent(object obj, Tab.ItemChangeEventArgs args) + private void OnItemChangedEvent(object obj, Tab.ItemChangedEventArgs args) { _checkValue = true; } @@ -43,43 +43,9 @@ namespace Tizen.NUI.Components.Tests [Property("COVPARAM", "")] public void Tab_INIT() { - var temp_view = new Tab(); - Assert.IsNotNull(temp_view, "Should be not null!"); - Assert.IsInstanceOf(temp_view, "Should return Tab instance."); - } - - [Test] - [Category("P1")] - [Description("Create a Tab object with attributes. Check whether object whose text is initialized is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.Tab C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "TabAttributes")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Tab_INIT_WITH_TabAttributes() - { - /* TEST CODE */ - var tab = new Tab(new TabAttributes()); - Assert.IsNotNull(tab, "Can't create success object Tab"); - Assert.IsInstanceOf(tab, "Should be an instance of textLabel type."); - } - - [Test] - [Category("P1")] - [Description("Create a Tab object with string. Check whether object whose text is initialized 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.RegisterStyle("DefaultTab", "Utility", typeof(UtilityTabStyle), true); - - var tab = new Tab("DefaultTab"); - Assert.IsNotNull(tab, "Can't create success object Tab"); - Assert.IsInstanceOf(tab, "Should be an instance of Tab type."); + var tab = new Tab(); + Assert.IsNotNull(tab, "Should be not null!"); + Assert.IsInstanceOf(tab, "Should return Tab instance."); } [Test] @@ -93,6 +59,9 @@ namespace Tizen.NUI.Components.Tests { /* 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"); } @@ -100,117 +69,76 @@ namespace Tizen.NUI.Components.Tests [Test] [Category("P1")] - [Description("Test IsNatureTextWidth. Check whether IsNatureTextWidth works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.IsNatureTextWidth A")] + [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 IsNatureTextWidth_SET_GET_VALUE() + 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.IsNatureTextWidth = true; - Assert.AreEqual(true, tab.IsNatureTextWidth, "Retrieved IsNatureTextWidth should be equal to set value"); - tab.IsNatureTextWidth = false; - Assert.AreEqual(false, tab.IsNatureTextWidth, "Retrieved IsNatureTextWidth should be equal to set value"); + 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 ItemGap. Check whether ItemGap works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.ItemGap A")] + [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 ItemGap_SET_GET_VALUE() + 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.ItemGap = 25; - Assert.AreEqual(25, tab.ItemGap, "Retrieved ItemGap should be equal to set value"); + tab.ItemSpace = 25; + Assert.AreEqual(25, tab.ItemSpace, "Retrieved ItemSpace should be equal to set value"); } [Test] [Category("P1")] - [Description("Test LeftSpace. Check whether LeftSpace works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.LeftSpace A")] + [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 LeftSpace_SET_GET_VALUE() + 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.LeftSpace = 25; - Assert.AreEqual(25, tab.LeftSpace, "Retrieved LeftSpace should be equal to set value"); + 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 BottomSpace. Check whether BottomSpace works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.BottomSpace A")] + [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 BottomSpace_SET_GET_VALUE() + 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.BottomSpace = 25; - Assert.AreEqual(25, tab.BottomSpace, "Retrieved BottomSpace should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test RightSpace. Check whether RightSpace works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.RightSpace A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void RightSpace_SET_GET_VALUE() - { - /* TEST CODE */ - var tab = new Tab(); - Assert.IsInstanceOf(tab, "Should be an instance of Tab type"); - tab.RightSpace = 25; - Assert.AreEqual(25, tab.RightSpace, "Retrieved RightSpace should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TopSpace. Check whether TopSpace works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.TopSpace A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void TopSpace_SET_GET_VALUE() - { - /* TEST CODE */ - var tab = new Tab(); - Assert.IsInstanceOf(tab, "Should be an instance of Tab type"); - tab.TopSpace = 25; - Assert.AreEqual(25, tab.TopSpace, "Retrieved TopSpace should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test UnderLineSize2D. Check whether UnderLineSize2D works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Tab.UnderLineSize2D A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void UnderLineSize2D_SET_GET_VALUE() - { - /* TEST CODE */ - var tab = new Tab(); - Assert.IsInstanceOf(tab, "Should be an instance of Tab type"); - tab.UnderLineSize2D = new Size2D(100, 100); - Assert.AreEqual(100, tab.UnderLineSize2D.Width, "Retrieved UnderLineSize2D width should be equal to set value"); - Assert.AreEqual(100, tab.UnderLineSize2D.Height, "Retrieved UnderLineSize2D height should be equal to set value"); + 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] @@ -224,7 +152,13 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var tab = new Tab(); - Color color = Color.Red; + 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"); @@ -244,6 +178,9 @@ namespace Tizen.NUI.Components.Tests { /* 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!"); @@ -261,6 +198,9 @@ namespace Tizen.NUI.Components.Tests { /* 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!"); } @@ -276,7 +216,13 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var tab = new Tab(); - Color color = Color.Red; + 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"); @@ -295,7 +241,13 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var tab = new Tab(); - Color color = Color.Red; + 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"); @@ -315,7 +267,13 @@ namespace Tizen.NUI.Components.Tests 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" }); } @@ -337,10 +295,16 @@ namespace Tizen.NUI.Components.Tests { try { - var testView = new Tab(); + var tab = new Tab(); + Assert.IsNotNull(tab, "Should be not null!"); + Assert.IsInstanceOf(tab, "Should be an instance of Tab type"); + var temActor = new View(); + Assert.IsNotNull(temActor, "Should be not null!"); + Assert.IsInstanceOf(temActor, "Should be an instance of View type"); + temActor.Name = "ChildActor"; - testView.InsertItem(new Tab.TabItemData() { Text = "" }, 0); + tab.InsertItem(new Tab.TabItemData() { Text = "" }, 0); } catch (Exception e) { @@ -360,128 +324,22 @@ namespace Tizen.NUI.Components.Tests { try { - var testView = new Tab(); - var temActor = new View(); - temActor.Name = "ChildActor"; - testView.DeleteItem(0); - } - catch (Exception e) - { - Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); - Assert.Fail("Caught Exception" + e.ToString()); - } - } - - [Test] - [Category("P1")] - [Description("Test GetAttributes. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Tab.GetAttributes M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void GetAttributes_CHECK_VALUE() - { - /* TEST CODE */ - try - { - var myTab = new MyTab(); - Assert.IsTrue(myTab.flagGetAttributes, "GetAttributes trigger Check Fail."); - } - 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 OnUpdate. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Tab.OnUpdate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public async Task OnUpdate_CHECK_VALUE() - { - /* TEST CODE */ - var myTab = new MyTab(); - Window.Instance.Add(myTab); - try - { - await Task.Delay(200); - Assert.IsTrue(myTab.flagOnUpdate, "OnUpdate trigger Check Fail."); - } - 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); - } - } + var tab = new Tab(); + Assert.IsNotNull(tab, "Should be not null!"); + Assert.IsInstanceOf(tab, "Should be an instance of Tab type"); - [Test] - [Category("P1")] - [Description("Test OnThemeChangedEvent. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Tab.OnThemeChangedEvent M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public async Task OnThemeChangedEvent_CHECK_VALUE() - { - /* TEST CODE */ - StyleManager.Instance.Theme = "Utility"; - var myTab = new MyTab(); - Window.Instance.Add(myTab); - try - { - StyleManager.Instance.Theme = "Food"; - await Task.Delay(200); - Assert.IsTrue(myTab.flagOnThemeChangedEvent, "OnThemeChangedEvent trigger Check Fail."); - } - 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); - } - } + var temActor = new View(); + Assert.IsNotNull(temActor, "Should be not null!"); + Assert.IsInstanceOf(temActor, "Should be an instance of View type"); - [Test] - [Category("P1")] - [Description("Test LayoutChild. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Tab.LayoutChild M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public async Task LayoutChild_CHECK_VALUE() - { - /* TEST CODE */ - var myTab = new MyTab(); - Window.Instance.Add(myTab); - try - { - await Task.Delay(200); - Assert.IsTrue(myTab.flagLayoutChild, "OnUpdate trigger Check Fail."); + temActor.Name = "ChildActor"; + tab.DeleteItem(0); } 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] @@ -498,13 +356,10 @@ namespace Tizen.NUI.Components.Tests Size2D = new Size2D(700, 108), Position2D = new Position2D(100, 300), BackgroundColor = new Color(1.0f, 1.0f, 1.0f, 0.5f), - IsNatureTextWidth = true, - ItemGap = 40, - LeftSpace = 56, - RightSpace = 56, - TopSpace = 1, - BottomSpace = 0, - UnderLineSize2D = new Size2D(1, 3), + UseTextNaturalSize = true, + ItemSpace = 40, + Space = new Extents(56, 56, 1, 0), + UnderLineSize = new Size(1, 3), UnderLineBackgroundColor = Color.Cyan, PointSize = 25, TextColorSelector = new ColorSelector @@ -555,6 +410,9 @@ namespace Tizen.NUI.Components.Tests 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) @@ -612,7 +470,7 @@ namespace Tizen.NUI.Components.Tests Space = new Vector4(56, 56, 1, 0), UnderLineAttributes = new ViewAttributes { - Size2D = new Size2D(1, 3), + Size = new Size(1, 3), PositionUsesPivotPoint = true, ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft, PivotPoint = Tizen.NUI.PivotPoint.BottomLeft, diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTabAttributes.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTabAttributes.cs deleted file mode 100755 index 52c8c5633..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTabAttributes.cs +++ /dev/null @@ -1,160 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.TabAttributes Tests")] - public class TabAttributesTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("TabAttributesTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a TabAttributes object. Check whether TabAttributes is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.TabAttributes.TabAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void TabAttributes_INIT() - { - /* TEST CODE */ - var tabAttributes = new TabAttributes(); - Assert.IsNotNull(tabAttributes, "Can't create success object TabAttributes"); - Assert.IsInstanceOf(tabAttributes, "Should be an instance of TabAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Create a TabAttributes object. Check whether TabAttributes is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.TabAttributes.TabAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "TabAttributes")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void TabAttributes_INIT_WITH_TabAttributes() - { - /* TEST CODE */ - var tabAttributes = new TabAttributes(); - var tabAttributes2 = new TabAttributes(tabAttributes); - Assert.IsNotNull(tabAttributes2, "Can't create success object TabAttributes"); - Assert.IsInstanceOf(tabAttributes2, "Should be an instance of TabAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Test UnderLineAttributes. Check whether UnderLineAttributes is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TabAttributes.UnderLineAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void UnderLineAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var tabAttributes = new TabAttributes(); - var viewAttributes = new ViewAttributes() { PaddingLeft = 30 }; - tabAttributes.UnderLineAttributes = viewAttributes; - Assert.AreEqual(viewAttributes.PaddingLeft, tabAttributes.UnderLineAttributes.PaddingLeft, "Retrieved UnderLineAttributes should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TextAttributes. Check whether TextAttributes is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TabAttributes.TextAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void TextAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var tabAttributes = new TabAttributes(); - var textAttributes = new TextAttributes() { FontFamily = "test" }; - tabAttributes.TextAttributes = textAttributes; - Assert.AreEqual(textAttributes.FontFamily, tabAttributes.TextAttributes.FontFamily, "Retrieved TextAttributes should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test IsNatureTextWidth. Check whether IsNatureTextWidth is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TabAttributes.IsNatureTextWidth A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void IsNatureTextWidth_SET_GET_VALUE() - { - /* TEST CODE */ - var tabAttributes = new TabAttributes(); - tabAttributes.IsNatureTextWidth = false; - Assert.AreEqual(false, tabAttributes.IsNatureTextWidth, "Retrieved IsNatureTextWidth should be equal to set value"); - tabAttributes.IsNatureTextWidth = true; - Assert.AreEqual(true, tabAttributes.IsNatureTextWidth, "Retrieved IsNatureTextWidth should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test ItemGap. Check whether ItemGap is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TabAttributes.ItemGap A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void ItemGap_SET_GET_VALUE() - { - /* TEST CODE */ - var tabAttributes = new TabAttributes(); - tabAttributes.ItemGap = 10; - Assert.AreEqual(10, tabAttributes.ItemGap, "Retrieved ItemGap should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test Space. Check whether Space is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TabAttributes.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 tabAttributes = new TabAttributes(); - Vector4 vector4 = new Vector4(5, 10, 5, 10); - tabAttributes.Space = vector4; - Assert.AreEqual(vector4.X, tabAttributes.Space.X, "Retrieved Space should be equal to set value"); - Assert.AreEqual(vector4.Y, tabAttributes.Space.Y, "Retrieved Space should be equal to set value"); - Assert.AreEqual(vector4.Z, tabAttributes.Space.Z, "Retrieved Space should be equal to set value"); - Assert.AreEqual(vector4.W, tabAttributes.Space.W, "Retrieved Space should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check whether Clone works or not")] - [Property("SPEC", "Tizen.NUI.Components.TabAttributes.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Clone_CHECK_RETURN_VALUE() - { - var tabAttributes = new TabAttributes(); - tabAttributes.IsNatureTextWidth = true; - var tabAttributes2 = tabAttributes.Clone() as TabAttributes; - Assert.AreEqual(tabAttributes.IsNatureTextWidth, tabAttributes2.IsNatureTextWidth, "Retrieved IsNatureTextWidth should be equal to clone value"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTextAttributes.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTextAttributes.cs deleted file mode 100755 index f92e3737f..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTextAttributes.cs +++ /dev/null @@ -1,416 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Threading.Tasks; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.TextAttributes Tests")] - public class TextAttributesTests - { - private const string TAG = "NUI.Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("TextAttributesTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a TextAttributes object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.TextAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void TextAttributes_INIT() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - Assert.IsNotNull(textAttributes, "Can't create success object TextAttributes"); - Assert.IsInstanceOf(textAttributes, "Should be an instance of TextAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Create a TextAttributes object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.TextAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "TextAttributes")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void TextAttributes_INIT_WITH_TEXTATTRIBUTES() - { - /* TEST CODE */ - var textAttributes1 = new TextAttributes(); - var textAttributes = new TextAttributes(textAttributes1); - Assert.IsNotNull(textAttributes, "Can't create success object TextAttributes"); - Assert.IsInstanceOf(textAttributes, "Should be an instance of TextAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Test ShadowColor.Check whether ShadowColor is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.ShadowColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ShadowColor_SET_GET_VALUE() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - textAttributes.ShadowColor = new ColorSelector { All = new Color(1.0f, 0.45f, 1.0f, 1.0f) }; - Assert.AreEqual(1.0f, textAttributes.ShadowColor.All.R, "Should be equal to 1.0f!"); - Assert.AreEqual(0.45f, textAttributes.ShadowColor.All.G, "Should be equal to 0.45f!"); - Assert.AreEqual(1.0f, textAttributes.ShadowColor.All.B, "Should be equal to 1.0f!"); - Assert.AreEqual(1.0f, textAttributes.ShadowColor.All.A, "Should be equal to 1.0f!"); - } - - [Test] - [Category("P1")] - [Description("Test ShadowOffset.Check whether ShadowOffset is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.ShadowOffset A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ShadowOffset_SET_GET_VALUE() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - textAttributes.ShadowOffset = new Vector2Selector { All = new Vector2(10, 20) }; - Assert.AreEqual(10, textAttributes.ShadowOffset.All.X, "Should be equal to 10f!"); - Assert.AreEqual(20, textAttributes.ShadowOffset.All.Y, "Should be equal to 20f!"); - } - - [Test] - [Category("P1")] - [Description("Test PointSize.Check whether PointSize is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.PointSize A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void PointSize_SET_GET_VALUE() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - textAttributes.PointSize = new FloatSelector { All = 30 }; - Assert.AreEqual(30, textAttributes.PointSize.All, "Should be equal to 30!"); - } - - [Test] - [Category("P1")] - [Description("Test FontFamily.Check whether FontFamily is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.FontFamily A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void FontFamily_SET_GET_VALUE() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - textAttributes.FontFamily = "Sumsung400"; - Assert.AreEqual("Sumsung400", textAttributes.FontFamily, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test TextColor.Check whether TextColor is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.TextColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void TextColor_SET_GET_VALUE() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - textAttributes.TextColor = new ColorSelector { All = new Color(1.0f, 0.45f, 1.0f, 1.0f) }; - Assert.AreEqual(1.0f, textAttributes.TextColor.All.R, "Should be equal to 1.0f!"); - Assert.AreEqual(0.45f, textAttributes.TextColor.All.G, "Should be equal to 0.45f!"); - Assert.AreEqual(1.0f, textAttributes.TextColor.All.B, "Should be equal to 1.0f!"); - Assert.AreEqual(1.0f, textAttributes.TextColor.All.A, "Should be equal to 1.0f!"); - } - - [Test] - [Category("P1")] - [Description("Test LineSpacing.Check whether LineSpacing is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.LineSpacing A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void LineSpacing_SET_GET_VALUE() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - textAttributes.LineSpacing = 30; - Assert.AreEqual(30, textAttributes.LineSpacing, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test AutoScrollStopMode.Check whether AutoScrollStopMode is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.AutoScrollStopMode A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void AutoScrollStopMode_SET_GET_VALUE() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - textAttributes.AutoScrollStopMode = AutoScrollStopMode.FinishLoop; - Assert.AreEqual(AutoScrollStopMode.FinishLoop, textAttributes.AutoScrollStopMode, "Should be equal!"); - textAttributes.AutoScrollStopMode = AutoScrollStopMode.Immediate; - Assert.AreEqual(AutoScrollStopMode.Immediate, textAttributes.AutoScrollStopMode, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test AutoScrollLoopDelay.Check whether AutoScrollLoopDelay is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.AutoScrollLoopDelay A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void AutoScrollLoopDelay_SET_GET_VALUE() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - textAttributes.AutoScrollLoopDelay = 30; - Assert.AreEqual(30, textAttributes.AutoScrollLoopDelay, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test AutoScrollGap.Check whether AutoScrollGap is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.AutoScrollGap A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void AutoScrollGap_SET_GET_VALUE() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - textAttributes.AutoScrollGap = 30; - Assert.AreEqual(30, textAttributes.AutoScrollGap, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test AutoScrollLoopCount.Check whether AutoScrollLoopCount is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.AutoScrollLoopCount A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void AutoScrollLoopCount_SET_GET_VALUE() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - textAttributes.AutoScrollLoopCount = 30; - Assert.AreEqual(30, textAttributes.AutoScrollLoopCount, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test AutoScrollSpeed.Check whether AutoScrollSpeed is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.AutoScrollSpeed A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void AutoScrollSpeed_SET_GET_VALUE() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - textAttributes.AutoScrollSpeed = 30; - Assert.AreEqual(30, textAttributes.AutoScrollSpeed, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test EnableAutoScroll.Check whether EnableAutoScroll is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.EnableAutoScroll A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void EnableAutoScroll_SET_GET_VALUE() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - textAttributes.EnableAutoScroll = true; - Assert.IsTrue(textAttributes.EnableAutoScroll, "Should be equal!"); - textAttributes.EnableAutoScroll = false; - Assert.IsFalse(textAttributes.EnableAutoScroll, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test EnableMarkup.Check whether EnableMarkup is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.EnableMarkup A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void EnableMarkup_SET_GET_VALUE() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - textAttributes.EnableMarkup = true; - Assert.IsTrue(textAttributes.EnableMarkup, "Should be equal!"); - textAttributes.EnableMarkup = false; - Assert.IsFalse(textAttributes.EnableMarkup, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test VerticalAlignment.Check whether VerticalAlignment is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.VerticalAlignment A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void VerticalAlignment_SET_GET_VALUE() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - textAttributes.VerticalAlignment = VerticalAlignment.Top; - Assert.AreEqual(VerticalAlignment.Top, textAttributes.VerticalAlignment, "Should be equal!"); - textAttributes.VerticalAlignment = VerticalAlignment.Center; - Assert.AreEqual(VerticalAlignment.Center, textAttributes.VerticalAlignment, "Should be equal!"); - textAttributes.VerticalAlignment = VerticalAlignment.Bottom; - Assert.AreEqual(VerticalAlignment.Bottom, textAttributes.VerticalAlignment, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test HorizontalAlignment.Check whether HorizontalAlignment is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.HorizontalAlignment A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void HorizontalAlignment_SET_GET_VALUE() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - textAttributes.HorizontalAlignment = HorizontalAlignment.Begin; - Assert.AreEqual(HorizontalAlignment.Begin, textAttributes.HorizontalAlignment, "Should be equal!"); - textAttributes.HorizontalAlignment = HorizontalAlignment.Center; - Assert.AreEqual(HorizontalAlignment.Center, textAttributes.HorizontalAlignment, "Should be equal!"); - textAttributes.HorizontalAlignment = HorizontalAlignment.End; - Assert.AreEqual(HorizontalAlignment.End, textAttributes.HorizontalAlignment, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test MultiLine.Check whether MultiLine is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.MultiLine A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void MultiLine_SET_GET_VALUE() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - textAttributes.MultiLine = true; - Assert.IsTrue(textAttributes.MultiLine, "Should be equal!"); - textAttributes.MultiLine = false; - Assert.IsFalse(textAttributes.MultiLine, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test TranslatableText.Check whether TranslatableText is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.TranslatableText A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void TranslatableText_SET_GET_VALUE() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - textAttributes.TranslatableText = new StringSelector { All = "Text" }; - Assert.AreEqual("Text", textAttributes.TranslatableText.All, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Text.Check whether Text is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.Text A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Text_SET_GET_VALUE() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - textAttributes.Text = new StringSelector { All = "Text" }; - Assert.AreEqual("Text", textAttributes.Text.All, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test OutstrokeColor.Check whether OutstrokeColor is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.OutstrokeColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OutstrokeColor_SET_GET_VALUE() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - textAttributes.OutstrokeColor = new ColorSelector { All = new Color(1.0f, 0.45f, 1.0f, 1.0f) }; - Assert.AreEqual(1.0f, textAttributes.OutstrokeColor.All.R, "Should be equal to 1.0f!"); - Assert.AreEqual(0.45f, textAttributes.OutstrokeColor.All.G, "Should be equal to 0.45f!"); - Assert.AreEqual(1.0f, textAttributes.OutstrokeColor.All.B, "Should be equal to 1.0f!"); - Assert.AreEqual(1.0f, textAttributes.OutstrokeColor.All.A, "Should be equal to 1.0f!"); - } - - [Test] - [Category("P1")] - [Description("Test OutstrokeThickness.Check whether OutstrokeThickness is readable ahd writeable.")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.OutstrokeThickness A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void OutstrokeThickness_SET_GET_VALUE() - { - /* TEST CODE */ - var textAttributes = new TextAttributes(); - textAttributes.OutstrokeThickness = new IntSelector { All = 10 }; - Assert.AreEqual(10, textAttributes.OutstrokeThickness.All, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check Whether Clone works or not")] - [Property("SPEC", "Tizen.NUI.Components.TextAttributes.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Clone_TEST() - { - /* TEST CODE */ - try - { - var textAttributes = new TextAttributes(); - textAttributes.Text = new StringSelector() { All = "Text" }; ; - var attributes = textAttributes.Clone() as TextAttributes; - Assert.IsNotNull(attributes, "Should be not null"); - Assert.IsInstanceOf(attributes, "Should be an instance of TextAttributes type."); - Assert.AreEqual("Text", attributes.Text.All, "Should be equal!"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTextFieldAttributes.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTextFieldAttributes.cs deleted file mode 100755 index 71b74ac13..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSTextFieldAttributes.cs +++ /dev/null @@ -1,353 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.TextFieldAttributes Tests")] - public class TextFieldAttributesTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("TextFieldAttributesTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a TextFieldAttributes object. Check whether TextFieldAttributes is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.TextFieldAttributes.TextFieldAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void TextFieldAttributes_INIT() - { - /* TEST CODE */ - var textFieldAttributes = new TextFieldAttributes(); - Assert.IsNotNull(textFieldAttributes, "Can't create success object TextFieldAttributes"); - Assert.IsInstanceOf(textFieldAttributes, "Should be an instance of TextFieldAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Create a TextFieldAttributes object. Check whether TextFieldAttributes is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.TextFieldAttributes.TextFieldAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "TextFieldAttributes")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void TextFieldAttributes_INIT_WITH_TextFieldAttributes() - { - /* TEST CODE */ - var textFieldAttributes = new TextFieldAttributes(); - var textFieldAttributes2 = new TextFieldAttributes(textFieldAttributes); - Assert.IsNotNull(textFieldAttributes2, "Can't create success object TextFieldAttributes"); - Assert.IsInstanceOf(textFieldAttributes2, "Should be an instance of TextFieldAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Test Text. Check whether Text is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TextFieldAttributes.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 textFieldAttributes = new TextFieldAttributes(); - StringSelector stringSelector = new StringSelector() { All = "Test"}; - textFieldAttributes.Text = stringSelector; - Assert.AreEqual("Test", textFieldAttributes.Text.All, "Retrieved Text should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test PlaceholderText. Check whether PlaceholderText is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TextFieldAttributes.PlaceholderText A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void PlaceholderText_SET_GET_VALUE() - { - /* TEST CODE */ - var textFieldAttributes = new TextFieldAttributes(); - StringSelector stringSelector = new StringSelector() { All = "test" }; - textFieldAttributes.PlaceholderText = stringSelector; - Assert.AreEqual(stringSelector.All, textFieldAttributes.PlaceholderText.All, "Retrieved PlaceholderText should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TranslatablePlaceholderText. Check whether TranslatablePlaceholderText is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TextFieldAttributes.TranslatablePlaceholderText A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void TranslatablePlaceholderText_SET_GET_VALUE() - { - /* TEST CODE */ - var textFieldAttributes = new TextFieldAttributes(); - StringSelector stringSelector = new StringSelector() { All = "test" }; - textFieldAttributes.TranslatablePlaceholderText = stringSelector; - Assert.AreEqual(stringSelector.All, textFieldAttributes.TranslatablePlaceholderText.All, "Retrieved TranslatablePlaceholderText should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test HorizontalAlignment. Check whether HorizontalAlignment is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TextFieldAttributes.HorizontalAlignment A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void HorizontalAlignment_SET_GET_VALUE() - { - /* TEST CODE */ - var textFieldAttributes = new TextFieldAttributes(); - textFieldAttributes.HorizontalAlignment = HorizontalAlignment.Begin; - Assert.AreEqual(HorizontalAlignment.Begin, textFieldAttributes.HorizontalAlignment, "Retrieved HorizontalAlignment should be equal to set value"); - textFieldAttributes.HorizontalAlignment = HorizontalAlignment.Center; - Assert.AreEqual(HorizontalAlignment.Center, textFieldAttributes.HorizontalAlignment, "Retrieved HorizontalAlignment should be equal to set value"); - textFieldAttributes.HorizontalAlignment = HorizontalAlignment.End; - Assert.AreEqual(HorizontalAlignment.End, textFieldAttributes.HorizontalAlignment, "Retrieved HorizontalAlignment should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test VerticalAlignment. Check whether VerticalAlignment is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TextFieldAttributes.VerticalAlignment A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void VerticalAlignment_SET_GET_VALUE() - { - /* TEST CODE */ - var textFieldAttributes = new TextFieldAttributes(); - textFieldAttributes.VerticalAlignment = VerticalAlignment.Top; - Assert.AreEqual(VerticalAlignment.Top, textFieldAttributes.VerticalAlignment, "Retrieved VerticalAlignment should be equal to set value"); - textFieldAttributes.VerticalAlignment = VerticalAlignment.Center; - Assert.AreEqual(VerticalAlignment.Center, textFieldAttributes.VerticalAlignment, "Retrieved VerticalAlignment should be equal to set value"); - textFieldAttributes.VerticalAlignment = VerticalAlignment.Bottom; - Assert.AreEqual(VerticalAlignment.Bottom, textFieldAttributes.VerticalAlignment, "Retrieved VerticalAlignment should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test EnableMarkup. Check whether EnableMarkup is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TextFieldAttributes.EnableMarkup A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void EnableMarkup_SET_GET_VALUE() - { - /* TEST CODE */ - var textFieldAttributes = new TextFieldAttributes(); - textFieldAttributes.EnableMarkup = false; - Assert.AreEqual(false, textFieldAttributes.EnableMarkup, "Retrieved EnableMarkup should be equal to set value"); - textFieldAttributes.EnableMarkup = true; - Assert.AreEqual(true, textFieldAttributes.EnableMarkup, "Retrieved EnableMarkup should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TextColor. Check whether TextColor is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TextFieldAttributes.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 textFieldAttributes = new TextFieldAttributes(); - ColorSelector colorSelector = new ColorSelector() { All = new Color(1.0f, 0.5f, 1.0f, 1.0f) }; - textFieldAttributes.TextColor = colorSelector; - Assert.AreEqual(colorSelector.All.R, textFieldAttributes.TextColor.All.R, "Retrieved TextColor should be equal to set value"); - Assert.AreEqual(colorSelector.All.G, textFieldAttributes.TextColor.All.G, "Retrieved TextColor should be equal to set value"); - Assert.AreEqual(colorSelector.All.B, textFieldAttributes.TextColor.All.B, "Retrieved TextColor should be equal to set value"); - Assert.AreEqual(colorSelector.All.A, textFieldAttributes.TextColor.All.A, "Retrieved TextColor should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test PlaceholderTextColor. Check whether PlaceholderTextColor is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TextFieldAttributes.PlaceholderTextColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void PlaceholderTextColor_SET_GET_VALUE() - { - /* TEST CODE */ - var textFieldAttributes = new TextFieldAttributes(); - ColorSelector colorSelector = new ColorSelector() { All = new Color(1.0f, 0.5f, 1.0f, 1.0f) }; - textFieldAttributes.PlaceholderTextColor = colorSelector; - Assert.AreEqual(colorSelector.All.R, textFieldAttributes.PlaceholderTextColor.All.R, "Retrieved PlaceholderTextColor should be equal to set value"); - Assert.AreEqual(colorSelector.All.G, textFieldAttributes.PlaceholderTextColor.All.G, "Retrieved PlaceholderTextColor should be equal to set value"); - Assert.AreEqual(colorSelector.All.B, textFieldAttributes.PlaceholderTextColor.All.B, "Retrieved PlaceholderTextColor should be equal to set value"); - Assert.AreEqual(colorSelector.All.A, textFieldAttributes.PlaceholderTextColor.All.A, "Retrieved PlaceholderTextColor should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test PrimaryCursorColor. Check whether PrimaryCursorColor is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TextFieldAttributes.PrimaryCursorColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void PrimaryCursorColor_SET_GET_VALUE() - { - /* TEST CODE */ - var textFieldAttributes = new TextFieldAttributes(); - ColorSelector colorSelector = new ColorSelector() { All = new Color(1.0f, 0.5f, 1.0f, 1.0f) }; - textFieldAttributes.PrimaryCursorColor = colorSelector; - Assert.AreEqual(colorSelector.All.R, textFieldAttributes.PrimaryCursorColor.All.R, "Retrieved PrimaryCursorColor should be equal to set value"); - Assert.AreEqual(colorSelector.All.G, textFieldAttributes.PrimaryCursorColor.All.G, "Retrieved PrimaryCursorColor should be equal to set value"); - Assert.AreEqual(colorSelector.All.B, textFieldAttributes.PrimaryCursorColor.All.B, "Retrieved PrimaryCursorColor should be equal to set value"); - Assert.AreEqual(colorSelector.All.A, textFieldAttributes.PrimaryCursorColor.All.A, "Retrieved PrimaryCursorColor should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test SecondaryCursorColor. Check whether SecondaryCursorColor is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TextFieldAttributes.SecondaryCursorColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void SecondaryCursorColor_SET_GET_VALUE() - { - /* TEST CODE */ - var textFieldAttributes = new TextFieldAttributes(); - ColorSelector colorSelector = new ColorSelector() { All = new Color(1.0f, 0.5f, 1.0f, 1.0f) }; - textFieldAttributes.SecondaryCursorColor = colorSelector; - Assert.AreEqual(colorSelector.All.R, textFieldAttributes.SecondaryCursorColor.All.R, "Retrieved SecondaryCursorColor should be equal to set value"); - Assert.AreEqual(colorSelector.All.G, textFieldAttributes.SecondaryCursorColor.All.G, "Retrieved SecondaryCursorColor should be equal to set value"); - Assert.AreEqual(colorSelector.All.B, textFieldAttributes.SecondaryCursorColor.All.B, "Retrieved SecondaryCursorColor should be equal to set value"); - Assert.AreEqual(colorSelector.All.A, textFieldAttributes.SecondaryCursorColor.All.A, "Retrieved SecondaryCursorColor should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test FontFamily. Check whether FontFamily is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TextFieldAttributes.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 textFieldAttributes = new TextFieldAttributes(); - textFieldAttributes.FontFamily = "test"; - Assert.AreEqual("test", textFieldAttributes.FontFamily, "Retrieved FontFamily should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test PointSize. Check whether PointSize is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TextFieldAttributes.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 textFieldAttributes = new TextFieldAttributes(); - FloatSelector floatSelector = new FloatSelector() { All = 15.0f }; - textFieldAttributes.PointSize = floatSelector; - Assert.AreEqual(floatSelector.All, textFieldAttributes.PointSize.All, "Retrieved PointSize should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test EnableCursorBlink. Check whether EnableCursorBlink is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TextFieldAttributes.EnableCursorBlink A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void EnableCursorBlink_SET_GET_VALUE() - { - /* TEST CODE */ - var textFieldAttributes = new TextFieldAttributes(); - textFieldAttributes.EnableCursorBlink = false; - Assert.AreEqual(false, textFieldAttributes.EnableCursorBlink, "Retrieved EnableCursorBlink should be equal to set value"); - textFieldAttributes.EnableCursorBlink = true; - Assert.AreEqual(true, textFieldAttributes.EnableCursorBlink, "Retrieved EnableCursorBlink should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test EnableSelection. Check whether EnableSelection is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TextFieldAttributes.EnableSelection A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void EnableSelection_SET_GET_VALUE() - { - /* TEST CODE */ - var textFieldAttributes = new TextFieldAttributes(); - textFieldAttributes.EnableSelection = false; - Assert.AreEqual(false, textFieldAttributes.EnableSelection, "Retrieved EnableSelection should be equal to set value"); - textFieldAttributes.EnableSelection = true; - Assert.AreEqual(true, textFieldAttributes.EnableSelection, "Retrieved EnableSelection should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test CursorWidth. Check whether CursorWidth is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TextFieldAttributes.CursorWidth A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void CursorWidth_SET_GET_VALUE() - { - /* TEST CODE */ - var textFieldAttributes = new TextFieldAttributes(); - textFieldAttributes.CursorWidth = 2; - Assert.AreEqual(2, textFieldAttributes.CursorWidth, "Retrieved CursorWidth should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test EnableEllipsis. Check whether EnableEllipsis is readable and writable.")] - [Property("SPEC", "Tizen.NUI.Components.TextFieldAttributes.EnableEllipsis A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void EnableEllipsis_SET_GET_VALUE() - { - /* TEST CODE */ - var textFieldAttributes = new TextFieldAttributes(); - textFieldAttributes.EnableEllipsis = false; - Assert.AreEqual(false, textFieldAttributes.EnableEllipsis, "Retrieved EnableEllipsis should be equal to set value"); - textFieldAttributes.EnableEllipsis = true; - Assert.AreEqual(true, textFieldAttributes.EnableEllipsis, "Retrieved EnableEllipsis should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check whether Clone works or not")] - [Property("SPEC", "Tizen.NUI.Components.TextFieldAttributes.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Clone_CHECK_RETURN_VALUE() - { - var textFieldAttributes = new TextFieldAttributes(); - textFieldAttributes.FontFamily = "test"; - var textFieldAttributes2 = textFieldAttributes.Clone() as TextFieldAttributes; - Assert.AreEqual(textFieldAttributes.FontFamily, textFieldAttributes2.FontFamily, "Retrieved FontFamily should be equal to clone value"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSToast.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSToast.cs index 7ad444ee2..16e2e848b 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSToast.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSToast.cs @@ -42,39 +42,6 @@ namespace Tizen.NUI.Components.Tests Assert.IsInstanceOf(toast, "Should return Toast instance."); } - [Test] - [Category("P1")] - [Description("Create a Toast object with attributes. Check whether object whose text is initialized is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.Toast C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "ToastAttributes")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Toast_INIT_WITH_ToastAttributes() - { - /* TEST CODE */ - var toast = new Toast(new ToastAttributes()); - Assert.IsNotNull(toast, "Can't create success object Toast"); - Assert.IsInstanceOf(toast, "Should be an instance of Toast type."); - } - - [Test] - [Category("P1")] - [Description("Create a Toast object with string. Check whether object whose text is initialized 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.RegisterStyle("BasicShortToast", null, typeof(BasicShortToasStyle)); - var toast = new Toast("BasicShortToast"); - Assert.IsNotNull(toast, "Can't create success object Toast"); - Assert.IsInstanceOf(toast, "Should be an instance of Toast type."); - } - [Test] [Category("P1")] [Description("Test TextArray. Check whether TextArray works or not.")] @@ -86,6 +53,9 @@ namespace Tizen.NUI.Components.Tests { /* 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; @@ -105,6 +75,7 @@ namespace Tizen.NUI.Components.Tests { /* 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"); @@ -121,6 +92,7 @@ namespace Tizen.NUI.Components.Tests { /* 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"); @@ -137,8 +109,12 @@ namespace Tizen.NUI.Components.Tests { /* TEST CODE */ var toast = new Toast(); + Assert.IsNotNull(toast, "Should be not null!"); Assert.IsInstanceOf(toast, "Should be an instance of Toast type"); - Color textColor = new Color(1.0f, 0.0f, 0.0f, 1.0f); + 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"); @@ -157,6 +133,7 @@ namespace Tizen.NUI.Components.Tests { /* 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"); @@ -168,98 +145,22 @@ namespace Tizen.NUI.Components.Tests [Test] [Category("P1")] - [Description("Test BackgroundImageURL. Check whether BackgroundImageURL works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.BackgroundImageURL A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void BackgroundImageURL_SET_GET_VALUE() - { - /* TEST CODE */ - var toast = new Toast(); - Assert.IsInstanceOf(toast, "Should be an instance of Toast type"); - toast.BackgroundImageURL = "test.png"; - Assert.AreEqual("test.png", toast.BackgroundImageURL, "Retrieved BackgroundImageURL should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test BackgroundImageBorder. Check whether BackgroundImageBorder works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.BackgroundImageBorder A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] - public void BackgroundImageBorder_SET_GET_VALUE() - { - /* TEST CODE */ - var toast = new Toast(); - Assert.IsInstanceOf(toast, "Should be an instance of Toast type"); - toast.BackgroundImageBorder = new Rectangle(5, 5, 5, 5); - Assert.AreEqual(5, toast.BackgroundImageBorder.X, "Retrieved BackgroundImageBorder should be equal to set value"); - Assert.AreEqual(5, toast.BackgroundImageBorder.Y, "Retrieved BackgroundImageBorder should be equal to set value"); - Assert.AreEqual(5, toast.BackgroundImageBorder.Width, "Retrieved BackgroundImageBorder should be equal to set value"); - Assert.AreEqual(5, toast.BackgroundImageBorder.Height, "Retrieved BackgroundImageBorder should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TextPaddingLeft. Check whether TextPaddingLeft works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.TextPaddingLeft A")] + [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 TextPaddingLeft_SET_GET_VALUE() + 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.TextPaddingLeft = 30; - Assert.AreEqual(30, toast.TextPaddingLeft, "Retrieved TextPaddingLeft should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TextPaddingRight. Check whether TextPaddingRight works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.TextPaddingRight A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void TextPaddingRight_SET_GET_VALUE() - { - /* TEST CODE */ - var toast = new Toast(); - toast.TextPaddingRight = 30; - Assert.AreEqual(30, toast.TextPaddingRight, "Retrieved TextPaddingRight should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TextPaddingTop. Check whether TextPaddingTop works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.TextPaddingTop A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void TextPaddingTop_SET_GET_VALUE() - { - /* TEST CODE */ - var toast = new Toast(); - toast.TextPaddingTop = 38; - Assert.AreEqual(38, toast.TextPaddingTop, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test TextPaddingBottom. Check whether TextPaddingBottom works or not.")] - [Property("SPEC", "Tizen.NUI.Components.Toast.TextPaddingBottom A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void TextPaddingBottom_SET_GET_VALUE() - { - /* TEST CODE */ - var toast = new Toast(); - toast.TextPaddingBottom = 38; - Assert.AreEqual(38, toast.TextPaddingBottom, "Should be equal!"); + 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] @@ -273,6 +174,8 @@ namespace Tizen.NUI.Components.Tests { /* 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"); } @@ -288,6 +191,8 @@ namespace Tizen.NUI.Components.Tests { /* 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"); } @@ -303,91 +208,12 @@ namespace Tizen.NUI.Components.Tests { /* 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 GetAttributes. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Toast.GetAttributes M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void GetAttributes_CHECK_VALUE() - { - /* TEST CODE */ - try - { - var myToast = new MyToast(); - Assert.IsTrue(myToast.flagGetAttributes, "GetAttributes trigger Check Fail."); - } - 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 OnUpdate. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Toast.OnUpdate M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public async Task OnUpdate_CHECK_VALUE() - { - /* TEST CODE */ - var myToast = new MyToast(); - Window.Instance.Add(myToast); - try - { - await Task.Delay(200); - Assert.IsTrue(myToast.flagOnUpdate, "OnUpdate trigger Check Fail."); - } - 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(myToast); - } - } - - [Test] - [Category("P1")] - [Description("Test LayoutChild. Check it has been triggered")] - [Property("SPEC", "Tizen.NUI.Components.Toast.LayoutChild M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public async Task LayoutChild_CHECK_VALUE() - { - /* TEST CODE */ - var myToast = new MyToast(); - Window.Instance.Add(myToast); - try - { - await Task.Delay(200); - Assert.IsTrue(myToast.flagLayoutChild, "OnUpdate trigger Check Fail."); - } - 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(myToast); - } - } - [Test] [Category("P1")] [Description("Test Dispose, try to dispose the Toast.")] @@ -400,7 +226,10 @@ namespace Tizen.NUI.Components.Tests /* TEST CODE */ try { - Toast toast = new Toast(); + 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) @@ -411,68 +240,4 @@ namespace Tizen.NUI.Components.Tests } } } - - public class MyToast : Toast - { - public bool flagGetAttributes = false; - public bool flagOnUpdate = false; - public bool flagLayoutChild = false; - - public MyToast() : base() - { } - - public MyToast(string style) : base(style) - { } - - protected override Attributes GetAttributes() - { - flagGetAttributes = true; - return new ToastAttributes(); - } - - protected override void OnUpdate() - { - base.OnUpdate(); - flagOnUpdate = true; - } - - protected override void LayoutChild() - { - base.LayoutChild(); - flagLayoutChild = true; - } - } - - internal class BasicShortToasStyle : StyleBase - { - protected override Attributes GetAttributes() - { - ToastAttributes attributes = new ToastAttributes - { - Size2D = new Tizen.NUI.Size2D(512, 132), - BackgroundImageAttributes = new ImageAttributes - { - ResourceURL = new StringSelector - { - All = "12. Toast Popup/toast_background.png", - }, - Border = new RectangleSelector - { - All = new Tizen.NUI.Rectangle(64, 64, 4, 4) - } - }, - - TextAttributes = new TextAttributes - { - PaddingTop = 38, - PaddingBottom = 38, - PaddingLeft = 96, - PaddingRight = 96, - PointSize = new FloatSelector { All = 26, }, - TextColor = new ColorSelector { All = Color.White, } - } - }; - return attributes; - } - } } \ No newline at end of file diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSToastAttributes.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSToastAttributes.cs deleted file mode 100755 index 27ab0f07d..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSToastAttributes.cs +++ /dev/null @@ -1,154 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components.Test; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.ToastAttributes Tests")] - public class ToastAttributesTests - { - private const string TAG = "Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("ToastAttributesTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a ToastAttributes object. Check whether ToastAttributes is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.ToastAttributes.ToastAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void ToastAttributes_INIT() - { - /* TEST CODE */ - var toastAttributes = new ToastAttributes(); - Assert.IsNotNull(toastAttributes, "Can't create success object ToastAttributes"); - Assert.IsInstanceOf(toastAttributes, "Should be an instance of ToastAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Create a ToastAttributes object. Check whether ToastAttributes is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.ToastAttributes.ToastAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "ToastAttributes")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void ToastAttributes_INIT_WITH_ToastAttributes() - { - /* TEST CODE */ - var toastAttributes = new ToastAttributes(); - var toastAttributes2 = new ToastAttributes(toastAttributes); - Assert.IsNotNull(toastAttributes2, "Can't create success object ToastAttributes"); - Assert.IsInstanceOf(toastAttributes2, "Should be an instance of ToastAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Test BackgroundImageAttributes. Check whether BackgroundImageAttributes works or not.")] - [Property("SPEC", "Tizen.NUI.Components.ToastAttributes.BackgroundImageAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void BackgroundImageAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var toastAttributes = new ToastAttributes(); - var imageAttributes = new ImageAttributes() { ResourceURL = new StringSelector() { All = "test.png" } }; - toastAttributes.BackgroundImageAttributes = imageAttributes; - Assert.AreEqual(imageAttributes.ResourceURL.All, toastAttributes.BackgroundImageAttributes.ResourceURL.All, "Retrieved BackgroundImageAttributes should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TextAttributes. Check whether TextAttributes works or not.")] - [Property("SPEC", "Tizen.NUI.Components.ToastAttributes.TextAttributes A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA","PRW")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void TextAttributes_SET_GET_VALUE() - { - /* TEST CODE */ - var toastAttributes = new ToastAttributes(); - var textAttributes = new TextAttributes() { Text = new StringSelector() { All = "test" } }; - toastAttributes.TextAttributes = textAttributes; - Assert.AreEqual(textAttributes.Text.All, toastAttributes.TextAttributes.Text.All, "Retrieved TextAttributes should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test TextLineHeight. Check whether TextLineHeight works or not.")] - [Property("SPEC", "Tizen.NUI.Components.ToastAttributes.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 toastAttributes = new ToastAttributes(); - toastAttributes.TextLineHeight = 30; - Assert.AreEqual(30, toastAttributes.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.ToastAttributes.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 toastAttributes = new ToastAttributes(); - toastAttributes.TextLineSpace = 30; - Assert.AreEqual(30, toastAttributes.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.ToastAttributes.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 toastAttributes = new ToastAttributes(); - toastAttributes.Duration = 30; - Assert.AreEqual(30, toastAttributes.Duration, "Retrieved Duration should be equal to set value"); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check whether Clone works or not")] - [Property("SPEC", "Tizen.NUI.Components.ToastAttributes.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] - public void Clone_CHECK_RETURN_VALUE() - { - var toastAttributes = new ToastAttributes(); - toastAttributes.Duration = 30; - var toastAttributes2 = toastAttributes.Clone() as ToastAttributes; - Assert.AreEqual(toastAttributes.Duration, toastAttributes2.Duration, "Retrieved Duration should be equal to clone value"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSVector2Selector.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSVector2Selector.cs deleted file mode 100755 index 0eb85862c..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSVector2Selector.cs +++ /dev/null @@ -1,65 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Threading.Tasks; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.Vector2Selector Tests")] - public class Vector2SelectorTests - { - private const string TAG = "NUI.Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("Vector2SelectorTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a Vector2Selector object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.Vector2Selector.Vector2Selector C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Vector2Selector_INIT() - { - /* TEST CODE */ - var vector2Selector = new Vector2Selector(); - Assert.IsNotNull(vector2Selector, "Can't create success object Vector2Selector"); - Assert.IsInstanceOf(vector2Selector, "Should be an instance of Vector2Selector type."); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check Whether Clone works or not")] - [Property("SPEC", "Tizen.NUI.Components.Vector2Selector.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Clone_TEST() - { - /* TEST CODE */ - var vector2Selector1 = new Vector2Selector(); - vector2Selector1.All = new Vector2(10.0f, 10.0f); - var vector2SelectorSelector = vector2Selector1.Clone(); - Assert.IsNotNull(vector2SelectorSelector, "should be not null!"); - Assert.AreEqual(10.0f, vector2SelectorSelector.All.X, "Should be equal!"); - Assert.AreEqual(10.0f, vector2SelectorSelector.All.Y, "Should be equal!"); - } - } -} diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSViewAttributes.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSViewAttributes.cs deleted file mode 100755 index 2154a8052..000000000 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSViewAttributes.cs +++ /dev/null @@ -1,356 +0,0 @@ -using NUnit.Framework; -using NUnit.Framework.TUnit; -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Components; -using Tizen.NUI.Components.Test; -using System.Threading.Tasks; - -namespace Tizen.NUI.Components.Tests -{ - [TestFixture] - [Description("Tizen.NUI.Components.ViewAttributes Tests")] - public class ViewAttributesTests - { - private const string TAG = "NUI.Components"; - - [SetUp] - public void Init() - { - Tizen.Log.Info(TAG, "Init() is called!"); - App.MainTitleChangeText("ViewAttributesTests"); - App.MainTitleChangeBackgroundColor(null); - } - - [TearDown] - public void Destroy() - { - Tizen.Log.Info(TAG, "Destroy() is called!"); - } - - [Test] - [Category("P1")] - [Description("Create a ViewAttributes object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.ViewAttributes.ViewAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ViewAttributes_INIT() - { - /* TEST CODE */ - var viewAttributes = new ViewAttributes(); - Assert.IsNotNull(viewAttributes, "Can't create success object ViewAttributes"); - Assert.IsInstanceOf(viewAttributes, "Should be an instance of ViewAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Create a ViewAttributes object. Check whether object is successfully created or not.")] - [Property("SPEC", "Tizen.NUI.Components.ViewAttributes.ViewAttributes C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("COVPARAM", "ViewAttributes")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ViewAttributes_INIT_WITH_VIEWATTRIBUTES() - { - /* TEST CODE */ - var viewAttributes1 = new ViewAttributes(); - var viewAttributes = new ViewAttributes(viewAttributes1); - Assert.IsNotNull(viewAttributes, "Can't create success object ViewAttributes"); - Assert.IsInstanceOf(viewAttributes, "Should be an instance of ViewAttributes type."); - } - - [Test] - [Category("P1")] - [Description("Test PaddingRight.Check whether PaddingRight is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ViewAttributes.PaddingRight A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void PaddingRight_SET_GET_VALUE() - { - /* TEST CODE */ - var viewAttributes = new ViewAttributes(); - viewAttributes.PaddingRight = 10; - Assert.AreEqual(10, viewAttributes.PaddingRight, "Should be equal to 10!"); - } - - [Test] - [Category("P1")] - [Description("Test PaddingLeft.Check whether PaddingLeft is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ViewAttributes.PaddingLeft A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void PaddingLeft_SET_GET_VALUE() - { - /* TEST CODE */ - var viewAttributes = new ViewAttributes(); - viewAttributes.PaddingLeft = 10; - Assert.AreEqual(10, viewAttributes.PaddingLeft, "Should be equal to 10!"); - } - [Test] - [Category("P1")] - [Description("Test PaddingTop.Check whether PaddingTop is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ViewAttributes.PaddingTop A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void PaddingTop_SET_GET_VALUE() - { - /* TEST CODE */ - var viewAttributes = new ViewAttributes(); - viewAttributes.PaddingTop = 10; - Assert.AreEqual(10, viewAttributes.PaddingTop, "Should be equal to 10!"); - } - - [Test] - [Category("P1")] - [Description("Test PaddingBottom.Check whether PaddingBottom is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ViewAttributes.PaddingBottom A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void PaddingBottom_SET_GET_VALUE() - { - /* TEST CODE */ - var viewAttributes = new ViewAttributes(); - viewAttributes.PaddingBottom = 10; - Assert.AreEqual(10, viewAttributes.PaddingBottom, "Should be equal to 10!"); - } - - [Test] - [Category("P1")] - [Description("Test Opacity.Check whether Opacity is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ViewAttributes.Opacity A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Opacity_SET_GET_VALUE() - { - /* TEST CODE */ - var viewAttributes = new ViewAttributes(); - viewAttributes.Opacity = new FloatSelector { All = 1.0f }; - Assert.AreEqual(1.0f, viewAttributes.Opacity.All, "Should be equal to 1.0f!"); - } - - [Test] - [Category("P1")] - [Description("Test SizeModeFactor.Check whether SizeModeFactor is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ViewAttributes.SizeModeFactor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void SizeModeFactor_SET_GET_VALUE() - { - /* TEST CODE */ - var viewAttributes = new ViewAttributes(); - viewAttributes.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f); - Assert.AreEqual(1.0f, viewAttributes.SizeModeFactor.X, "Should be equal to 1.0f!"); - Assert.AreEqual(0.45f, viewAttributes.SizeModeFactor.Y, "Should be equal to 0.45f!"); - Assert.AreEqual(1.0f, viewAttributes.SizeModeFactor.Z, "Should be equal to 1.0f!"); - } - - [Test] - [Category("P1")] - [Description("Test MinimumSize.Check whether MinimumSize is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ViewAttributes.MinimumSize A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void MinimumSize_SET_GET_VALUE() - { - /* TEST CODE */ - var viewAttributes = new ViewAttributes(); - viewAttributes.MinimumSize = new Size2D(200, 200); - Assert.AreEqual(200, viewAttributes.MinimumSize.Width, "Should be equal to 200!"); - Assert.AreEqual(200, viewAttributes.MinimumSize.Height, "Should be equal to 200!"); - } - - [Test] - [Category("P1")] - [Description("Test HeightResizePolicy.Check whether HeightResizePolicy is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ViewAttributes.HeightResizePolicy A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void HeightResizePolicy_SET_GET_VALUE() - { - /* TEST CODE */ - var viewAttributes = new ViewAttributes(); - viewAttributes.HeightResizePolicy = ResizePolicyType.Fixed; - Assert.AreEqual(ResizePolicyType.Fixed, viewAttributes.HeightResizePolicy, "Should be equal!"); - viewAttributes.HeightResizePolicy = ResizePolicyType.UseNaturalSize; - Assert.AreEqual(ResizePolicyType.UseNaturalSize, viewAttributes.HeightResizePolicy, "Should be equal!"); - viewAttributes.HeightResizePolicy = ResizePolicyType.FillToParent; - Assert.AreEqual(ResizePolicyType.FillToParent, viewAttributes.HeightResizePolicy, "Should be equal!"); - viewAttributes.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; - Assert.AreEqual(ResizePolicyType.SizeRelativeToParent, viewAttributes.HeightResizePolicy, "Should be equal!"); - viewAttributes.HeightResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent; - Assert.AreEqual(ResizePolicyType.SizeFixedOffsetFromParent, viewAttributes.HeightResizePolicy, "Should be equal!"); - viewAttributes.HeightResizePolicy = ResizePolicyType.FitToChildren; - Assert.AreEqual(ResizePolicyType.FitToChildren, viewAttributes.HeightResizePolicy, "Should be equal!"); - viewAttributes.HeightResizePolicy = ResizePolicyType.DimensionDependency; - Assert.AreEqual(ResizePolicyType.DimensionDependency, viewAttributes.HeightResizePolicy, "Should be equal!"); - viewAttributes.HeightResizePolicy = ResizePolicyType.UseAssignedSize; - Assert.AreEqual(ResizePolicyType.UseAssignedSize, viewAttributes.HeightResizePolicy, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test WidthResizePolicy.Check whether WidthResizePolicy is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ViewAttributes.WidthResizePolicy A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void WidthResizePolicy_SET_GET_VALUE() - { - /* TEST CODE */ - var viewAttributes = new ViewAttributes(); - viewAttributes.WidthResizePolicy = ResizePolicyType.Fixed; - Assert.AreEqual(ResizePolicyType.Fixed, viewAttributes.WidthResizePolicy, "Should be equal!"); - viewAttributes.WidthResizePolicy = ResizePolicyType.UseNaturalSize; - Assert.AreEqual(ResizePolicyType.UseNaturalSize, viewAttributes.WidthResizePolicy, "Should be equal!"); - viewAttributes.WidthResizePolicy = ResizePolicyType.FillToParent; - Assert.AreEqual(ResizePolicyType.FillToParent, viewAttributes.WidthResizePolicy, "Should be equal!"); - viewAttributes.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; - Assert.AreEqual(ResizePolicyType.SizeRelativeToParent, viewAttributes.WidthResizePolicy, "Should be equal!"); - viewAttributes.WidthResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent; - Assert.AreEqual(ResizePolicyType.SizeFixedOffsetFromParent, viewAttributes.WidthResizePolicy, "Should be equal!"); - viewAttributes.WidthResizePolicy = ResizePolicyType.FitToChildren; - Assert.AreEqual(ResizePolicyType.FitToChildren, viewAttributes.WidthResizePolicy, "Should be equal!"); - viewAttributes.WidthResizePolicy = ResizePolicyType.DimensionDependency; - Assert.AreEqual(ResizePolicyType.DimensionDependency, viewAttributes.WidthResizePolicy, "Should be equal!"); - viewAttributes.WidthResizePolicy = ResizePolicyType.UseAssignedSize; - Assert.AreEqual(ResizePolicyType.UseAssignedSize, viewAttributes.WidthResizePolicy, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test PivotPoint.Check whether PivotPoint is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ViewAttributes.PivotPoint A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void PivotPoint_SET_GET_VALUE() - { - /* TEST CODE */ - var viewAttributes = new ViewAttributes(); - viewAttributes.PivotPoint = new Vector3(1.0f, 0.45f, 1.0f); - Assert.AreEqual(1.0f, viewAttributes.PivotPoint.X, "Should be equal to 1.0f!"); - Assert.AreEqual(0.45f, viewAttributes.PivotPoint.Y, "Should be equal to 0.45f!"); - Assert.AreEqual(1.0f, viewAttributes.PivotPoint.Z, "Should be equal to 1.0f!"); - } - - [Test] - [Category("P1")] - [Description("Test ParentOrigin.Check whether ParentOrigin is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ViewAttributes.ParentOrigin A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void ParentOrigin_SET_GET_VALUE() - { - /* TEST CODE */ - var viewAttributes = new ViewAttributes(); - viewAttributes.ParentOrigin = new Vector3(1.0f, 0.45f, 1.0f); - Assert.AreEqual(1.0f, viewAttributes.ParentOrigin.X, "Should be equal to 1.0f!"); - Assert.AreEqual(0.45f, viewAttributes.ParentOrigin.Y, "Should be equal to 0.45f!"); - Assert.AreEqual(1.0f, viewAttributes.ParentOrigin.Z, "Should be equal to 1.0f!"); - } - - [Test] - [Category("P1")] - [Description("Test PositionUsesPivotPoint.Check whether PositionUsesPivotPoint is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ViewAttributes.PositionUsesPivotPoint A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void PositionUsesPivotPoint_SET_GET_VALUE() - { - /* TEST CODE */ - var viewAttributes = new ViewAttributes(); - viewAttributes.PositionUsesPivotPoint = true; - Assert.IsTrue(viewAttributes.PositionUsesPivotPoint, "Should be equal!"); - viewAttributes.PositionUsesPivotPoint = false; - Assert.IsFalse(viewAttributes.PositionUsesPivotPoint, "Should be equal!"); - } - - [Test] - [Category("P1")] - [Description("Test BackgroundColor.Check whether BackgroundColor is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ViewAttributes.BackgroundColor A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void BackgroundColor_SET_GET_VALUE() - { - /* TEST CODE */ - var viewAttributes = new ViewAttributes(); - viewAttributes.BackgroundColor = new ColorSelector { All = new Color(1.0f, 0.45f, 1.0f, 1.0f) }; - Assert.AreEqual(1.0f, viewAttributes.BackgroundColor.All.R, "Should be equal to 1.0f!"); - Assert.AreEqual(0.45f, viewAttributes.BackgroundColor.All.G, "Should be equal to 0.45f!"); - Assert.AreEqual(1.0f, viewAttributes.BackgroundColor.All.B, "Should be equal to 1.0f!"); - Assert.AreEqual(1.0f, viewAttributes.BackgroundColor.All.A, "Should be equal to 1.0f!"); - } - - [Test] - [Category("P1")] - [Description("Test Size2D.Check whether Size2D is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ViewAttributes.Size2D A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Size2D_SET_GET_VALUE() - { - /* TEST CODE */ - var viewAttributes = new ViewAttributes(); - viewAttributes.Size2D = new Size2D(200, 200); - Assert.AreEqual(200, viewAttributes.Size2D.Width, "Should be equal to 200!"); - Assert.AreEqual(200, viewAttributes.Size2D.Height, "Should be equal to 200!"); - } - - [Test] - [Category("P1")] - [Description("Test Position2D.Check whether Position2D is readable and writeable.")] - [Property("SPEC", "Tizen.NUI.Components.ViewAttributes.Position2D A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRW")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Position2D_SET_GET_VALUE() - { - /* TEST CODE */ - var viewAttributes = new ViewAttributes(); - viewAttributes.Position2D = new Position2D(200, 200); - Assert.AreEqual(200, viewAttributes.Position2D.X, "Should be equal to 200!"); - Assert.AreEqual(200, viewAttributes.Position2D.Y, "Should be equal to 200!"); - } - - [Test] - [Category("P1")] - [Description("Test Clone. Check Whether Clone works or not")] - [Property("SPEC", "Tizen.NUI.Components.ViewAttributes.Clone M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Clone_TEST() - { - /* TEST CODE */ - try - { - var viewAttributes = new ViewAttributes(); - viewAttributes.Opacity = new FloatSelector() { All = 1.0f }; - var attributes = viewAttributes.Clone() as ViewAttributes; - Assert.IsNotNull(attributes, "Should be not null!"); - Assert.IsInstanceOf(attributes, "Should be an instance of ViewAttributes type."); - Assert.AreEqual(1.0f, attributes.Opacity.All, "Should be equal!"); - } - catch (Exception e) - { - Assert.Fail("Caught Exception" + e.ToString()); - } - } - } -}