private void CreateMyButton(string buttonText)
{
- _button = new MyButton();
+ _button = new Button();
+ Assert.IsNotNull(_button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(_button, "Should be equal!");
_button.Text = buttonText;
_button.PointSize = _pointSize;
_button.BackgroundColor = Color.Cyan;
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")]
_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);
- }
-
- }
}
}
+++ /dev/null
-/*
- * 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);
- }
- }
-
- }
-}
+++ /dev/null
-/*
- * 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);
- }
- }
-
- }
-}
+++ /dev/null
-/*
- * 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<ListItemData> dataList = new List<ListItemData>();
- 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<ListItemData> _mDatas;
-
- public ListBridge(List<ListItemData> 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);
- }
- }
- }
-
-
-}
-
-
-
+++ /dev/null
-/*
- * 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;
- }
- }
- }
-}
-
-
-
private void CreatePopup()
{
_popup = new Popup();
+ Assert.IsNotNull(_popup, "Should be not null");
+ Assert.IsInstanceOf<Components.Popup>(_popup, "Should be equal!");
_popup.MinimumSize = new Size2D(232, 184);
_popup.Size2D = new Size2D(232, 200);
_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";
[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")]
[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);
+++ /dev/null
-/*
- * 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;\r
- 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()\r
- {\r
- _radioButton = new MyRadioButton();\r
- _radioButton.Size2D = new Size2D(150, 48);\r
- _radioButton.CheckImageSize2D = new Size2D(48, 48);\r
- _radioButton.CheckImagePaddingLeft = 0;\r
- _radioButton.CheckImagePaddingRight = 0;\r
- _radioButton.CheckImagePaddingTop = 0;\r
- _radioButton.CheckImagePaddingBottom = 0;\r
- _radioButton.CheckBackgroundImageURLSelector = new StringSelector\r
- {\r
- Normal = _resourcePath + "/images/controller_btn_check_off.png",\r
- Selected = _resourcePath + "/images/controller_btn_check_on.png",\r
- };\r
- _radioButton.CheckImageURLSelector = new StringSelector\r
- {\r
- Normal = "",\r
- Selected = _resourcePath + "/images/controller_btn_check.png",\r
- };\r
- _radioButton.CheckShadowImageURLSelector = new StringSelector\r
- {\r
- Normal = "",\r
- Selected = _resourcePath + "/images/controller_btn_check_shadow.png",\r
- };\r
-\r
- if (ManualTest.IsWearable())
- {
- _radioButton.Size2D = new Size2D(150, 48);
- _wearTestPage.ExecuteTC(_radioButton);
- }
- else
- {
- _testPage.ExecuteTC(_radioButton);
- }\r
- }
-
- [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();\r
- await ManualTest.WaitForConfirm();\r
- if (ManualTest.IsWearable())
- {
- _wearTestPage.ClearTestCase(_radioButton);
- }
- else
- {
- _testPage.ClearTestCase(_radioButton);
- }
- }
- }
-
- public class MyRadioButton: RadioButton\r
- {\r
- protected override void OnSelected()\r
- {\r
- ManualTest.Confirm();\r
- base.OnSelected();\r
- }\r
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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;\r
- private RadioButton _radioButton;\r
- 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()\r
- {\r
- _radioButtonGroup = new MyRadioButtonGroup();\r
- _radioButton = new MyRadioButton();\r
- _radioButton.Size2D = new Size2D(150, 48);\r
- _radioButton.CheckImageSize2D = new Size2D(48, 48);\r
- _radioButton.CheckImagePaddingLeft = 0;\r
- _radioButton.CheckImagePaddingRight = 0;\r
- _radioButton.CheckImagePaddingTop = 0;\r
- _radioButton.CheckImagePaddingBottom = 0;\r
- _radioButton.CheckBackgroundImageURLSelector = new StringSelector\r
- {\r
- Normal = _resourcePath + "/images/controller_btn_check_off.png",\r
- Selected = _resourcePath + "/images/controller_btn_check_on.png",\r
- };\r
- _radioButton.CheckImageURLSelector = new StringSelector\r
- {\r
- Normal = "",\r
- Selected = _resourcePath + "/images/controller_btn_check.png",\r
- };\r
- _radioButton.CheckShadowImageURLSelector = new StringSelector\r
- {\r
- Normal = "",\r
- Selected = _resourcePath + "/images/controller_btn_check_shadow.png",\r
- };\r
-\r
- _radioButtonGroup.Add(_radioButton);\r
-\r
- if (ManualTest.IsWearable())
- {
- _radioButton.Size2D = new Size2D(150, 48);
- _wearTestPage.ExecuteTC(_radioButton);
- }
- else
- {
- _testPage.ExecuteTC(_radioButton);
- }\r
- }
-
- [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();\r
- await ManualTest.WaitForConfirm();\r
- if (ManualTest.IsWearable())
- {
- _wearTestPage.ClearTestCase(_radioButton);
- }
- else
- {
- _testPage.ClearTestCase(_radioButton);
- }
- }
- }
-
- public class MyRadioButtonGroup : RadioButtonGroup\r
- {\r
- protected override void SelectionHandler(SelectButton selection)\r
- {\r
- ManualTest.Confirm();\r
- base.SelectionHandler(selection);\r
- }\r
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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();
- }
-
- }
- }
-}
+++ /dev/null
-/*
- * 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;\r
- private RadioButton _radioButton;\r
- 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()\r
- {\r
- _radioButtonGroup = new MyRadioButtonGroup();\r
- _radioButton = new MyRadioButton();\r
- _radioButton.Size2D = new Size2D(150, 48);\r
- _radioButton.CheckImageSize2D = new Size2D(48, 48);\r
- _radioButton.CheckImagePaddingLeft = 0;\r
- _radioButton.CheckImagePaddingRight = 0;\r
- _radioButton.CheckImagePaddingTop = 0;\r
- _radioButton.CheckImagePaddingBottom = 0;\r
- _radioButton.CheckBackgroundImageURLSelector = new StringSelector\r
- {\r
- Normal = _resourcePath + "/images/controller_btn_check_off.png",\r
- Selected = _resourcePath + "/images/controller_btn_check_on.png",\r
- };\r
- _radioButton.CheckImageURLSelector = new StringSelector\r
- {\r
- Normal = "",\r
- Selected = _resourcePath + "/images/controller_btn_check.png",\r
- };\r
- _radioButton.CheckShadowImageURLSelector = new StringSelector\r
- {\r
- Normal = "",\r
- Selected = _resourcePath + "/images/controller_btn_check_shadow.png",\r
- };\r
-\r
- _radioButtonGroup.Add(_radioButton);\r
-\r
- if (ManualTest.IsWearable())
- {
- _radioButton.Size2D = new Size2D(150, 48);
- _wearTestPage.ExecuteTC(_radioButton);
- }
- else
- {
- _testPage.ExecuteTC(_radioButton);
- }\r
- }
-
- [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();\r
- await ManualTest.WaitForConfirm();\r
- if (ManualTest.IsWearable())
- {
- _wearTestPage.ClearTestCase(_radioButton);
- }
- else
- {
- _testPage.ClearTestCase(_radioButton);
- }
- }
- }
-}
\ No newline at end of file
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 = "",
{
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;
private void CreateSwitch()
{
- _switch = new MySwitch();
+ _switch = new Switch();
+ Assert.IsNotNull(_switch, "Should be not null");
+ Assert.IsInstanceOf<Components.Switch>(_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",
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")]
_testPage.ClearTestCase(_switch);
}
}
-
- public class MySwitch : Switch
- {
- public override bool OnTouch(Touch touch)
- {
- ManualTest.Confirm();
- return base.OnTouch(touch);
- }
- }
}
}
+++ /dev/null
-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\r
-{\r
- [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!");
- }\r
-
- [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<ViewAttributes>(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;\r
- Assert.IsNotNull(attributes, "Can't create success object Attributes");\r
- Assert.IsInstanceOf<ViewAttributes>(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());
- }
- }
- }
-}
+++ /dev/null
-using NUnit.Framework;\r
-using NUnit.Framework.TUnit;\r
-using System;\r
-using Tizen.NUI;\r
-using Tizen.NUI.UIComponents;\r
-using Tizen.NUI.Components;\r
-using System.Runtime.InteropServices;\r
-using System.Threading.Tasks;\r
-using Tizen.NUI.Components.Test;\r
-\r
-namespace Tizen.NUI.Components.Tests\r
-{\r
- [TestFixture]\r
- [Description("Tizen.NUI.Components.Button.StateChangeEventArgs Tests")]\r
- public class ButtonStateChangeEventArgsTests\r
- {\r
- private const string TAG = "Components";\r
-\r
- public void Init()\r
- {\r
- Tizen.Log.Info(TAG, "Init() is called!");\r
- App.MainTitleChangeText("ButtonStateChangeEventArgsTests");\r
- App.MainTitleChangeBackgroundColor(null);\r
-\r
- }\r
-\r
- [TearDown]\r
- public void Destroy()\r
- {\r
- Tizen.Log.Info(TAG, "Destroy() is called!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test StateChangeEventArgs empty constructor. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.StateChangeEventArgs.StateChangeEventArgs C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("COVPARAM", "")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void StateChangeEventArgs_CHECK_VALUE()\r
- {\r
- /* TEST CODE */\r
- var stateChangeEventArgs = new Components.Button.StateChangeEventArgs();\r
- Assert.IsNotNull(stateChangeEventArgs, "Should be not null!");\r
- Assert.IsInstanceOf<Components.Button.StateChangeEventArgs>(stateChangeEventArgs, "Should be equal!");\r
-\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test PreviousState. Check whether PreviousState is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.StateChangeEventArgs.PreviousState A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void PreviousState_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var stateChangeEventArgs = new Components.Button.StateChangeEventArgs();\r
- stateChangeEventArgs.PreviousState = ControlStates.Normal;\r
- Assert.AreEqual(ControlStates.Normal, stateChangeEventArgs.PreviousState, "Should be equal");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CurrentState. Check whether CurrentState is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.StateChangeEventArgs.CurrentState A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CurrentState_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var stateChangeEventArgs = new Components.Button.StateChangeEventArgs();\r
- stateChangeEventArgs.CurrentState = ControlStates.Normal;\r
- Assert.AreEqual(ControlStates.Normal, stateChangeEventArgs.CurrentState, "Should be equal");\r
- }\r
- }\r
-}\r
--- /dev/null
+using NUnit.Framework;\r
+using NUnit.Framework.TUnit;\r
+using System;\r
+using Tizen.NUI;\r
+using Tizen.NUI.UIComponents;\r
+using Tizen.NUI.Components;\r
+using System.Runtime.InteropServices;\r
+using System.Threading.Tasks;\r
+using Tizen.NUI.Components.Test;\r
+\r
+namespace Tizen.NUI.Components.Tests\r
+{\r
+ [TestFixture]\r
+ [Description("Tizen.NUI.Components.Button.StateChangedEventArgs Tests")]\r
+ public class ButtonStateChangedEventArgsTests\r
+ {\r
+ private const string TAG = "Components";\r
+\r
+ public void Init()\r
+ {\r
+ Tizen.Log.Info(TAG, "Init() is called!");\r
+ App.MainTitleChangeText("ButtonStateChangedEventArgsTests");\r
+ App.MainTitleChangeBackgroundColor(null);\r
+\r
+ }\r
+\r
+ [TearDown]\r
+ public void Destroy()\r
+ {\r
+ Tizen.Log.Info(TAG, "Destroy() is called!");\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test StateChangedEventArgs empty constructor. Check it has been triggered")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Button.StateChangedEventArgs.StateChangedEventArgs C")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "CONSTR")]\r
+ [Property("COVPARAM", "")]\r
+ [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
+ public void StateChangedEventArgs_CHECK_VALUE()\r
+ {\r
+ /* TEST CODE */\r
+ var stateChangeEventArgs = new Components.Button.StateChangedEventArgs();\r
+ Assert.IsNotNull(stateChangeEventArgs, "Should be not null!");\r
+ Assert.IsInstanceOf<Components.Button.StateChangedEventArgs>(stateChangeEventArgs, "Should be equal!");\r
+\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test PreviousState. Check whether PreviousState is readable and writeable.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Button.StateChangedEventArgs.PreviousState A")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "PRW")]\r
+ [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
+ public void PreviousState_SET_GET_VALUE()\r
+ {\r
+ /* TEST CODE */\r
+ var stateChangeEventArgs = new Components.Button.StateChangedEventArgs();\r
+ Assert.IsNotNull(stateChangeEventArgs, "Should be not null!");\r
+ Assert.IsInstanceOf<Components.Button.StateChangedEventArgs>(stateChangeEventArgs, "Should be equal!");\r
+\r
+ stateChangeEventArgs.PreviousState = ControlStates.Normal;\r
+ Assert.AreEqual(ControlStates.Normal, stateChangeEventArgs.PreviousState, "Should be equal");\r
+\r
+ stateChangeEventArgs.PreviousState = ControlStates.Focused;\r
+ Assert.AreEqual(ControlStates.Focused, stateChangeEventArgs.PreviousState, "Should be equal");\r
+\r
+ stateChangeEventArgs.PreviousState = ControlStates.Disabled;\r
+ Assert.AreEqual(ControlStates.Disabled, stateChangeEventArgs.PreviousState, "Should be equal");\r
+\r
+ stateChangeEventArgs.PreviousState = ControlStates.Selected;\r
+ Assert.AreEqual(ControlStates.Selected, stateChangeEventArgs.PreviousState, "Should be equal");\r
+\r
+ stateChangeEventArgs.PreviousState = ControlStates.Pressed;\r
+ Assert.AreEqual(ControlStates.Pressed, stateChangeEventArgs.PreviousState, "Should be equal");\r
+\r
+ stateChangeEventArgs.PreviousState = ControlStates.DisabledFocused;\r
+ Assert.AreEqual(ControlStates.DisabledFocused, stateChangeEventArgs.PreviousState, "Should be equal");\r
+\r
+ stateChangeEventArgs.PreviousState = ControlStates.SelectedFocused;\r
+ Assert.AreEqual(ControlStates.SelectedFocused, stateChangeEventArgs.PreviousState, "Should be equal");\r
+\r
+ stateChangeEventArgs.PreviousState = ControlStates.DisabledSelected;\r
+ Assert.AreEqual(ControlStates.DisabledSelected, stateChangeEventArgs.PreviousState, "Should be equal");\r
+\r
+ stateChangeEventArgs.PreviousState = ControlStates.Max;\r
+ Assert.AreEqual(ControlStates.Max, stateChangeEventArgs.PreviousState, "Should be equal");\r
+\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test CurrentState. Check whether CurrentState is readable and writeable.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Button.StateChangedEventArgs.CurrentState A")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "PRW")]\r
+ [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
+ public void CurrentState_SET_GET_VALUE()\r
+ {\r
+ /* TEST CODE */\r
+ var stateChangeEventArgs = new Components.Button.StateChangedEventArgs();\r
+ Assert.IsNotNull(stateChangeEventArgs, "Should be not null!");\r
+ Assert.IsInstanceOf<Components.Button.StateChangedEventArgs>(stateChangeEventArgs, "Should be equal!");\r
+\r
+ stateChangeEventArgs.CurrentState = ControlStates.Normal;\r
+ Assert.AreEqual(ControlStates.Normal, stateChangeEventArgs.CurrentState, "Should be equal");\r
+\r
+ stateChangeEventArgs.CurrentState = ControlStates.Focused;\r
+ Assert.AreEqual(ControlStates.Focused, stateChangeEventArgs.CurrentState, "Should be equal");\r
+\r
+ stateChangeEventArgs.CurrentState = ControlStates.Disabled;\r
+ Assert.AreEqual(ControlStates.Disabled, stateChangeEventArgs.CurrentState, "Should be equal");\r
+\r
+ stateChangeEventArgs.CurrentState = ControlStates.Selected;\r
+ Assert.AreEqual(ControlStates.Selected, stateChangeEventArgs.CurrentState, "Should be equal");\r
+\r
+ stateChangeEventArgs.CurrentState = ControlStates.Pressed;\r
+ Assert.AreEqual(ControlStates.Pressed, stateChangeEventArgs.CurrentState, "Should be equal");\r
+\r
+ stateChangeEventArgs.CurrentState = ControlStates.DisabledFocused;\r
+ Assert.AreEqual(ControlStates.DisabledFocused, stateChangeEventArgs.CurrentState, "Should be equal");\r
+\r
+ stateChangeEventArgs.CurrentState = ControlStates.SelectedFocused;\r
+ Assert.AreEqual(ControlStates.SelectedFocused, stateChangeEventArgs.CurrentState, "Should be equal");\r
+\r
+ stateChangeEventArgs.CurrentState = ControlStates.DisabledSelected;\r
+ Assert.AreEqual(ControlStates.DisabledSelected, stateChangeEventArgs.CurrentState, "Should be equal");\r
+\r
+ stateChangeEventArgs.CurrentState = ControlStates.Max;\r
+ Assert.AreEqual(ControlStates.Max, stateChangeEventArgs.CurrentState, "Should be equal");\r
+ }\r
+ }\r
+}\r
\r
[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<Components.Button>(button, "Should be equal!");\r
- }\r
-\r
- [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\r
- {\r
- IsSelectable = true,\r
- BackgroundImageAttributes = new ImageAttributes\r
- {\r
- ResourceURL = new StringSelector { All = _image_path },\r
- Border = new RectangleSelector { All = new Rectangle(5, 5, 5, 5) }\r
- },\r
-\r
- TextAttributes = new TextAttributes\r
- {\r
- PointSize = new FloatSelector { All = 20 },\r
- HorizontalAlignment = HorizontalAlignment.Center,\r
- VerticalAlignment = VerticalAlignment.Center,\r
- WidthResizePolicy = ResizePolicyType.FillToParent,\r
- HeightResizePolicy = ResizePolicyType.FillToParent,\r
-\r
- TextColor = new ColorSelector\r
- {\r
- Normal = new Color(0, 0, 0, 1),\r
- Pressed = new Color(0, 0, 0, 0.7f),\r
- Selected = new Color(0.141f, 0.769f, 0.278f, 1),\r
- Disabled = new Color(0, 0, 0, 0.4f),\r
- },\r
- }\r
- };
- var button = new Components.Button(buttonAttributes);
- Assert.IsNotNull(button, "Should be not null");
- Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
[Description("Test IsSelectable. Check whether IsSelectable is readable and writable.")]\r
[Property("SPEC", "Tizen.NUI.Components.Button.IsSelectable A")]\r
[Property("SPEC_URL", "-")]\r
{\r
/* TEST CODE */\r
var button = new Components.Button();\r
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
button.IsSelectable = true;\r
Assert.AreEqual(true, button.IsSelectable, "Should be equals to the set value");\r
button.IsSelectable = false;\r
Assert.AreEqual(false, button.IsSelectable, "Should be equals to the set value");\r
}\r
\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test BackgroundImageURL. Check whether BackgroundImageURL is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.BackgroundImageURL A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void BackgroundImageURL_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var button = new Components.Button();\r
- button.BackgroundImageURL = _image_path;\r
- Assert.AreEqual(_image_path, button.BackgroundImageURL, "Should be equals to the set value of BackgroundImageURL");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test BackgroundImageBorder. Check whether BackgroundImageBorder is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.BackgroundImageBorder A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void BackgroundImageBorder_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var button = new Components.Button();\r
- button.BackgroundImageBorder = new Rectangle(0, 0, 10, 10);\r
- Assert.AreEqual(0, button.BackgroundImageBorder.X, "Retrieved BackgroundImageBorder should be equal to set value");\r
- Assert.AreEqual(0, button.BackgroundImageBorder.Y, "Retrieved BackgroundImageBorder should be equal to set value");\r
- Assert.AreEqual(10, button.BackgroundImageBorder.Width, "Retrieved BackgroundImageBorder should be equal to set value");\r
- Assert.AreEqual(10, button.BackgroundImageBorder.Height, "Retrieved BackgroundImageBorder should be equal to set value");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ShadowImageURL. Check whether ShadowImageURL is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.ShadowImageURL A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ShadowImageURL_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var button = new Components.Button();\r
- button.ShadowImageURL = _image_path;\r
- Assert.AreEqual(_image_path, button.ShadowImageURL, "Should be equals to the set value of ShadowImageURL");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ShadowImageBorder. Check whether ShadowImageBorder is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.ShadowImageBorder A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ShadowImageBorder_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var button = new Components.Button();\r
- button.ShadowImageBorder = new Rectangle(0, 0, 10, 10);\r
- Assert.AreEqual(0, button.ShadowImageBorder.X, "Retrieved ShadowImageBorder should be equal to set value");\r
- Assert.AreEqual(0, button.ShadowImageBorder.Y, "Retrieved ShadowImageBorder should be equal to set value");\r
- Assert.AreEqual(10, button.ShadowImageBorder.Width, "Retrieved ShadowImageBorder should be equal to set value");\r
- Assert.AreEqual(10, button.ShadowImageBorder.Height, "Retrieved ShadowImageBorder should be equal to set value");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test OverlayImageURL. Check whether OverlayImageURL is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.OverlayImageURL A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void OverlayImageURL_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var button = new Components.Button();\r
- button.OverlayImageURL = _image_path;\r
- Assert.AreEqual(_image_path, button.OverlayImageURL, "Should be equals to the set value of OverlayImageURL");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test OverlayImageBorder. Check whether OverlayImageBorder is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.OverlayImageBorder A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void OverlayImageBorder_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var button = new Components.Button();\r
- button.OverlayImageBorder = new Rectangle(0, 0, 10, 10);\r
- Assert.AreEqual(0, button.OverlayImageBorder.X, "Retrieved OverlayImageBorder should be equal to set value");\r
- Assert.AreEqual(0, button.OverlayImageBorder.Y, "Retrieved OverlayImageBorder should be equal to set value");\r
- Assert.AreEqual(10, button.OverlayImageBorder.Width, "Retrieved OverlayImageBorder should be equal to set value");\r
- Assert.AreEqual(10, button.OverlayImageBorder.Height, "Retrieved OverlayImageBorder should be equal to set value");\r
- }\r
-\r
[Test]\r
[Category("P1")]\r
[Description("Test Text. Check whether Text is readable and writable.")]\r
{\r
/* TEST CODE */\r
var button = new Components.Button();\r
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
button.Text = "Test Text";\r
Assert.AreEqual("Test Text", button.Text, "Should be equals to the set value of Text");\r
}\r
{\r
/* TEST CODE */\r
var button = new Components.Button();\r
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
button.TranslatableText = "Test TranslatableText";\r
Assert.AreEqual("Test TranslatableText", button.TranslatableText, "Should be equals to the set value of TranslatableText");\r
}\r
{\r
/* TEST CODE */\r
var button = new Components.Button();\r
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
button.PointSize = 10.0f;\r
Assert.AreEqual(10.0f, button.PointSize, "Should be equals to the set value of PointSize");\r
}\r
{\r
/* TEST CODE */\r
var button = new Components.Button();\r
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
button.FontFamily = "SamsungOne 500";\r
Assert.AreEqual("SamsungOne 500", button.FontFamily, "Should be equals to the set value of FontFamily");\r
}\r
{\r
/* TEST CODE */\r
var button = new Components.Button();\r
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
var color = new Color(1.0f, 0.0f, 0.0f, 1.0f);\r
+ Assert.IsNotNull(color, "Should be not null");
+ Assert.IsInstanceOf<Color>(color, "Should be equal!");
button.TextColor = color;\r
\r
Assert.AreEqual(color.R, button.TextColor.R, "Should be equals to the color.R set");
{\r
/* TEST CODE */\r
var button = new Components.Button();\r
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
button.TextAlignment = HorizontalAlignment.Begin;\r
Assert.AreEqual(HorizontalAlignment.Begin, button.TextAlignment, "Should be equals to the set value of TextAlignment");\r
button.TextAlignment = HorizontalAlignment.Center;
{\r
/* TEST CODE */\r
var button = new Components.Button();\r
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
button.IconURL = _image_path;\r
Assert.AreEqual(_image_path, button.IconURL, "Should be equals to the set value of IconURL");\r
}\r
{\r
/* TEST CODE */\r
var button = new Components.Button();\r
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
var stringSelector = new StringSelector\r
{\r
Normal = "Normal",\r
Selected = "Selected",\r
};\r
+ Assert.IsNotNull(stringSelector, "Should be not null");
+ Assert.IsInstanceOf<StringSelector>(stringSelector, "Should be equal!");
\r
button.TextSelector = stringSelector;\r
Assert.AreEqual(stringSelector.Normal, button.TextSelector.Normal, "Should be equals to the set value of TextSelector");\r
{\r
/* TEST CODE */\r
var button = new Components.Button();\r
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
var stringSelector = new StringSelector\r
{\r
Normal = "Normal",\r
Selected = "Selected",\r
};\r
+ Assert.IsNotNull(stringSelector, "Should be not null");
+ Assert.IsInstanceOf<StringSelector>(stringSelector, "Should be equal!");
\r
button.TranslatableTextSelector = stringSelector;\r
Assert.AreEqual(stringSelector.Normal, button.TranslatableTextSelector.Normal, "Should be equals to the set value of TranslatableTextSelector");\r
{\r
/* TEST CODE */\r
var button = new Components.Button();\r
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
var colorSelector = new ColorSelector\r
{\r
Normal = new Color(0.0f, 0.0f, 1.0f, 1.0f),\r
Selected = new Color(0.0f, 1.0f, 0.0f, 1.0f),\r
};\r
+ Assert.IsNotNull(colorSelector, "Should be not null");
+ Assert.IsInstanceOf<ColorSelector>(colorSelector, "Should be equal!");
\r
button.TextColorSelector = colorSelector;\r
Assert.AreEqual(colorSelector.Normal.R, button.TextColorSelector.Normal.R, "Should be equals to the set value of TextColorSelector Normal R");\r
{\r
/* TEST CODE */\r
var button = new Components.Button();\r
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
var floatSelector = new FloatSelector\r
{\r
Normal = 10.0f,\r
Selected = 12.0f,\r
};\r
+ Assert.IsNotNull(floatSelector, "Should be not null");
+ Assert.IsInstanceOf<FloatSelector>(floatSelector, "Should be equal!");
\r
button.PointSizeSelector = floatSelector;\r
Assert.AreEqual(floatSelector.Normal, button.PointSizeSelector.Normal, "Should be equals to the set value of PointSizeSelector Normal");\r
{\r
/* TEST CODE */\r
var button = new Components.Button();\r
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
var stringSelector = new StringSelector\r
{\r
Normal = _image_path,\r
Selected = _image_path,\r
};\r
+ Assert.IsNotNull(stringSelector, "Should be not null");
+ Assert.IsInstanceOf<StringSelector>(stringSelector, "Should be equal!");
+
button.IconURLSelector = stringSelector;\r
Assert.AreEqual(stringSelector.Normal, button.IconURLSelector.Normal, "Should be equals to the set value of IconURLSelector Normal");\r
Assert.AreEqual(stringSelector.Selected, button.IconURLSelector.Selected, "Should be equals to the set value of IconURLSelector Selected");\r
}\r
\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test BackgroundImageURLSelector. Check whether BackgroundImageURLSelector is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.BackgroundImageURLSelector A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void BackgroundImageURLSelector_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var button = new Components.Button();\r
- var stringSelector = new StringSelector\r
- {\r
- Normal = _image_path,\r
- Selected = _image_path,\r
- };\r
- button.BackgroundImageURLSelector = stringSelector;\r
- Assert.AreEqual(stringSelector.Normal, button.BackgroundImageURLSelector.Normal, "Should be equals to the set value of BackgroundImageURLSelector Normal");\r
- Assert.AreEqual(stringSelector.Selected, button.BackgroundImageURLSelector.Selected, "Should be equals to the set value of BackgroundImageURLSelector Selected");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test BackgroundImageBorderSelector. Check whether BackgroundImageBorderSelector is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.BackgroundImageBorderSelector A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void BackgroundImageBorderSelector_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var button = new Components.Button();\r
- var rectangleSelector = new RectangleSelector\r
- {\r
- Normal = new Rectangle(0, 0, 10, 10),\r
- Selected = new Rectangle(0, 0, 11, 11),\r
- };\r
- button.BackgroundImageBorderSelector = rectangleSelector;\r
-\r
- Assert.AreEqual(0, button.BackgroundImageBorderSelector.Normal.X, "Retrieved BackgroundImageBorderSelector Normal X should be equal to set value");\r
- Assert.AreEqual(0, button.BackgroundImageBorderSelector.Normal.Y, "Retrieved BackgroundImageBorderSelector Normal Y should be equal to set value");\r
- Assert.AreEqual(10, button.BackgroundImageBorderSelector.Normal.Width, "Retrieved BackgroundImageBorderSelector Normal Width should be equal to set value");\r
- Assert.AreEqual(10, button.BackgroundImageBorderSelector.Normal.Height, "Retrieved BackgroundImageBorderSelector Normal Height should be equal to set value");\r
-\r
- Assert.AreEqual(0, button.BackgroundImageBorderSelector.Selected.X, "Retrieved BackgroundImageBorderSelector Selected X should be equal to set value");\r
- Assert.AreEqual(0, button.BackgroundImageBorderSelector.Selected.Y, "Retrieved BackgroundImageBorderSelector Selected Y should be equal to set value");\r
- Assert.AreEqual(11, button.BackgroundImageBorderSelector.Selected.Width, "Retrieved BackgroundImageBorderSelector Selected Width should be equal to set value");\r
- Assert.AreEqual(11, button.BackgroundImageBorderSelector.Selected.Height, "Retrieved BackgroundImageBorderSelector Selected Height should be equal to set value");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ShadowImageURLSelector. Check whether ShadowImageURLSelector is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.ShadowImageURLSelector A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ShadowImageURLSelector_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var button = new Components.Button();\r
- var stringSelector = new StringSelector\r
- {\r
- Normal = _image_path,\r
- Selected = _image_path,\r
- };\r
- button.ShadowImageURLSelector = stringSelector;\r
- Assert.AreEqual(stringSelector.Normal, button.ShadowImageURLSelector.Normal, "Should be equals to the set value of ShadowImageURLSelector Normal");\r
- Assert.AreEqual(stringSelector.Selected, button.ShadowImageURLSelector.Selected, "Should be equals to the set value of ShadowImageURLSelector Selected");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ShadowImageBorderSelector. Check whether ShadowImageBorderSelector is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.ShadowImageBorderSelector A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ShadowImageBorderSelector_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var button = new Components.Button();\r
- var rectangleSelector = new RectangleSelector\r
- {\r
- Normal = new Rectangle(0, 0, 10, 10),\r
- Selected = new Rectangle(0, 0, 11, 11),\r
- };\r
- button.ShadowImageBorderSelector = rectangleSelector;\r
-\r
- Assert.AreEqual(0, button.ShadowImageBorderSelector.Normal.X, "Retrieved ShadowImageBorderSelector Normal X should be equal to set value");\r
- Assert.AreEqual(0, button.ShadowImageBorderSelector.Normal.Y, "Retrieved ShadowImageBorderSelector Normal Y should be equal to set value");\r
- Assert.AreEqual(10, button.ShadowImageBorderSelector.Normal.Width, "Retrieved ShadowImageBorderSelector Normal Width should be equal to set value");\r
- Assert.AreEqual(10, button.ShadowImageBorderSelector.Normal.Height, "Retrieved ShadowImageBorderSelector Normal Height should be equal to set value");\r
-\r
- Assert.AreEqual(0, button.ShadowImageBorderSelector.Selected.X, "Retrieved ShadowImageBorderSelector Selected X should be equal to set value");\r
- Assert.AreEqual(0, button.ShadowImageBorderSelector.Selected.Y, "Retrieved ShadowImageBorderSelector Selected Y should be equal to set value");\r
- Assert.AreEqual(11, button.ShadowImageBorderSelector.Selected.Width, "Retrieved ShadowImageBorderSelector Selected Width should be equal to set value");\r
- Assert.AreEqual(11, button.ShadowImageBorderSelector.Selected.Height, "Retrieved ShadowImageBorderSelector Selected Height should be equal to set value");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test OverlayImageURLSelector. Check whether OverlayImageURLSelector is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.OverlayImageURLSelector A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void OverlayImageURLSelector_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var button = new Components.Button();\r
- var stringSelector = new StringSelector\r
- {\r
- Normal = _image_path,\r
- Selected = _image_path,\r
- };\r
- button.OverlayImageURLSelector = stringSelector;\r
- Assert.AreEqual(stringSelector.Normal, button.OverlayImageURLSelector.Normal, "Should be equals to the set value of OverlayImageURLSelector Normal");\r
- Assert.AreEqual(stringSelector.Selected, button.OverlayImageURLSelector.Selected, "Should be equals to the set value of OverlayImageURLSelector Selected");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test OverlayImageBorderSelector. Check whether OverlayImageBorderSelector is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.OverlayImageBorderSelector A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void OverlayImageBorderSelector_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var button = new Components.Button();\r
- var rectangleSelector = new RectangleSelector\r
- {\r
- Normal = new Rectangle(0, 0, 10, 10),\r
- Selected = new Rectangle(0, 0, 11, 11),\r
- };\r
- button.OverlayImageBorderSelector = rectangleSelector;\r
-\r
- Assert.AreEqual(0, button.OverlayImageBorderSelector.Normal.X, "Retrieved OverlayImageBorderSelector Normal X should be equal to set value");\r
- Assert.AreEqual(0, button.OverlayImageBorderSelector.Normal.Y, "Retrieved OverlayImageBorderSelector Normal Y should be equal to set value");\r
- Assert.AreEqual(10, button.OverlayImageBorderSelector.Normal.Width, "Retrieved OverlayImageBorderSelector Normal Width should be equal to set value");\r
- Assert.AreEqual(10, button.OverlayImageBorderSelector.Normal.Height, "Retrieved OverlayImageBorderSelector Normal Height should be equal to set value");\r
-\r
- Assert.AreEqual(0, button.OverlayImageBorderSelector.Selected.X, "Retrieved OverlayImageBorderSelector Selected X should be equal to set value");\r
- Assert.AreEqual(0, button.OverlayImageBorderSelector.Selected.Y, "Retrieved OverlayImageBorderSelector Selected Y should be equal to set value");\r
- Assert.AreEqual(11, button.OverlayImageBorderSelector.Selected.Width, "Retrieved OverlayImageBorderSelector Selected Width should be equal to set value");\r
- Assert.AreEqual(11, button.OverlayImageBorderSelector.Selected.Height, "Retrieved OverlayImageBorderSelector Selected Height should be equal to set value");\r
- }\r
-\r
[Test]\r
[Category("P1")]\r
[Description("Test IsSelected. Check whether IsSelected is readable and writable.")]\r
{\r
/* TEST CODE */\r
var button = new Components.Button();\r
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
+
button.IsSelected = true;\r
Assert.AreEqual(true, button.IsSelected, "Retrieved IsSelected should be equal to set value");\r
button.IsSelected = false;\r
{\r
/* TEST CODE */\r
var button = new Components.Button();\r
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
+
button.IsEnabled = true;\r
Assert.AreEqual(true, button.IsEnabled, "Retrieved IsEnabled should be equal to set value");\r
button.IsEnabled = false;\r
\r
[Test]\r
[Category("P1")]\r
- [Description("Test IconRelativeOrientation. Check whether IconRelativeOrientation is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.IconRelativeOrientation A")]\r
+ [Description("Test IconPadding. Check whether IconPadding is readable and writable.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Button.IconPadding A")]\r
[Property("SPEC_URL", "-")]\r
[Property("CRITERIA", "PRW")]
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void IconRelativeOrientation_SET_GET_VALUE()\r
+ public void IconPadding_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var button = new Components.Button();\r
- button.IconRelativeOrientation = Components.Button.IconOrientation.Left;\r
- Assert.AreEqual(Components.Button.IconOrientation.Left, button.IconRelativeOrientation, "Retrieved IconRelativeOrientation should be equal to set value");\r
- button.IconRelativeOrientation = Components.Button.IconOrientation.Right;\r
- Assert.AreEqual(Components.Button.IconOrientation.Right, button.IconRelativeOrientation, "Retrieved IconRelativeOrientation should be equal to set value");\r
- button.IconRelativeOrientation = Components.Button.IconOrientation.Top;\r
- Assert.AreEqual(Components.Button.IconOrientation.Top, button.IconRelativeOrientation, "Retrieved IconRelativeOrientation should be equal to set value");\r
- button.IconRelativeOrientation = Components.Button.IconOrientation.Bottom;\r
- Assert.AreEqual(Components.Button.IconOrientation.Bottom, button.IconRelativeOrientation, "Retrieved IconRelativeOrientation should be equal to set value");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test IconPaddingLeft. Check whether IconPaddingLeft is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.IconPaddingLeft A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void IconPaddingLeft_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var button = new Components.Button();\r
- button.IconPaddingLeft = 10;\r
- Assert.AreEqual(10, button.IconPaddingLeft, "Retrieved IconPaddingLeft should be equal to set value");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test IconPaddingRight. Check whether IconPaddingRight is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.IconPaddingRight A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void IconPaddingRight_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var button = new Components.Button();\r
- button.IconPaddingRight = 10;\r
- Assert.AreEqual(10, button.IconPaddingRight, "Retrieved IconPaddingRight should be equal to set value");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test IconPaddingTop. Check whether IconPaddingTop is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.IconPaddingTop A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void IconPaddingTop_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var button = new Components.Button();\r
- button.IconPaddingTop = 10;\r
- Assert.AreEqual(10, button.IconPaddingTop, "Retrieved IconPaddingTop should be equal to set value");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test IconPaddingBottom. Check whether IconPaddingBottom is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.IconPaddingBottom A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void IconPaddingBottom_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var button = new Components.Button();\r
- button.IconPaddingBottom = 10;\r
- Assert.AreEqual(10, button.IconPaddingBottom, "Retrieved IconPaddingBottom should be equal to set value");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test TextPaddingLeft. Check whether TextPaddingLeft is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.TextPaddingLeft A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void TextPaddingLeft_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var button = new Components.Button();\r
- button.TextPaddingLeft = 10;\r
- Assert.AreEqual(10, button.TextPaddingLeft, "Retrieved TextPaddingLeft should be equal to set value");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test TextPaddingRight. Check whether TextPaddingRight is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.TextPaddingRight A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void TextPaddingRight_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var button = new Components.Button();\r
- button.TextPaddingRight = 10;\r
- Assert.AreEqual(10, button.TextPaddingRight, "Retrieved TextPaddingRight should be equal to set value");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test TextPaddingTop. Check whether TextPaddingTop is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.TextPaddingTop A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void TextPaddingTop_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var button = new Components.Button();\r
- button.TextPaddingTop = 10;\r
- Assert.AreEqual(10, button.TextPaddingTop, "Retrieved TextPaddingTop should be equal to set value");\r
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
+
+ button.IconPadding = new Extents(0, 0, 10, 10);\r
+ Assert.AreEqual(0, button.IconPadding.Start, "Retrieved IconPadding.Start should be equal to set value");\r
+ Assert.AreEqual(0, button.IconPadding.End, "Retrieved IconPadding.End should be equal to set value");\r
+ Assert.AreEqual(10, button.IconPadding.Top, "Retrieved IconPadding.Top should be equal to set value");\r
+ Assert.AreEqual(10, button.IconPadding.Bottom, "Retrieved IconPadding.Bottom should be equal to set value");\r
}\r
\r
[Test]\r
[Category("P1")]\r
- [Description("Test TextPaddingBottom. Check whether TextPaddingBottom is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Button.TextPaddingBottom A")]\r
+ [Description("Test TextPadding. Check whether TextPadding is readable and writable.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Button.TextPadding A")]\r
[Property("SPEC_URL", "-")]\r
[Property("CRITERIA", "PRW")]
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void TextPaddingBottom_SET_GET_VALUE()\r
+ public void TextPadding_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var button = new Components.Button();\r
- button.TextPaddingBottom = 10;\r
- Assert.AreEqual(10, button.TextPaddingBottom, "Retrieved TextPaddingBottom should be equal to set value");\r
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
+
+ button.TextPadding = new Extents(0, 0, 10, 10);\r
+ Assert.AreEqual(0, button.TextPadding.Start, "Retrieved TextPadding.Start should be equal to set value");\r
+ Assert.AreEqual(0, button.TextPadding.End, "Retrieved TextPadding.End should be equal to set value");\r
+ Assert.AreEqual(10, button.TextPadding.Top, "Retrieved TextPadding.Top should be equal to set value");\r
+ Assert.AreEqual(10, button.TextPadding.Bottom, "Retrieved TextPadding.Bottom should be equal to set value");\r
}\r
\r
[Test]
try
{
var button = new Components.Button();
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
+
bool flag = true;
flag = button.OnKey(new Key());
Assert.AreEqual(false, flag, "OnKey return check fail.");
}\r
}\r
\r
- public class ButtonStyle : StyleBase\r
- {\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
- public ButtonStyle()\r
- {\r
-\r
- }\r
- protected override Attributes GetAttributes()\r
- {\r
- ButtonAttributes attributes = new ButtonAttributes\r
- {\r
- IsSelectable = true,\r
- BackgroundImageAttributes = new ImageAttributes\r
- {\r
- ResourceURL = new StringSelector\r
- {\r
- Normal = _image_path,\r
- Selected = _image_path,\r
- },\r
- Border = new RectangleSelector { All = new Rectangle(5, 5, 5, 5) }\r
- },\r
-\r
- ShadowImageAttributes = new ImageAttributes\r
- {\r
- ResourceURL = new StringSelector { All = _image_path },\r
- Border = new RectangleSelector { All = new Rectangle(5, 5, 5, 5) }\r
- },\r
-\r
- OverlayImageAttributes = new ImageAttributes\r
- {\r
- ResourceURL = new StringSelector { Pressed = _image_path, Other = "" },\r
- Border = new RectangleSelector { All = new Rectangle(5, 5, 5, 5) },\r
- },\r
-\r
- IconAttributes = new ImageAttributes\r
- {\r
- WidthResizePolicy = ResizePolicyType.FillToParent,\r
- HeightResizePolicy = ResizePolicyType.FillToParent,\r
- }\r
- };\r
- return attributes;\r
- }\r
- }\r
-\r
- public class MyButton : Components.Button\r
- {\r
- public override void OnFocusGained()\r
- {\r
- _focusGainedFlag = true;\r
- base.OnFocusGained();\r
- }\r
-\r
- public override void OnFocusLost()\r
- {\r
- _focusLostFlag = true;\r
- base.OnFocusLost();\r
- }\r
-\r
- protected override void OnUpdate()\r
- {\r
- _updateFlag = true;\r
- base.OnUpdate();\r
- }\r
-\r
- protected override void MeasureText()\r
- {\r
- _measureTextFlag = true;\r
- base.MeasureText();\r
- }\r
-\r
- protected override void LayoutChild()\r
- {\r
- _layoutChildFlag = true;\r
- base.LayoutChild();\r
- }\r
-\r
- protected override void OnThemeChangedEvent(object sender, Components.StyleManager.ThemeChangeEventArgs e)\r
- {\r
- _themeFlag = true;\r
- base.OnThemeChangedEvent(sender, e);\r
- }\r
-\r
- protected override Attributes GetAttributes()\r
- {\r
- return base.GetAttributes();\r
- }\r
-\r
- public Attributes TestGetAttributes()\r
- {\r
- return GetAttributes();\r
- }\r
- }\r
-\r
- [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;\r
- Window.Instance.Add(myButton);
- FocusManager.Instance.SetCurrentFocusView(myButton);
- Assert.AreEqual(true, _focusGainedFlag, "Should be equal!");\r
-\r
- }\r
-\r
- [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;\r
- Window.Instance.Add(myButton);
- Window.Instance.Add(view);
- FocusManager.Instance.SetCurrentFocusView(myButton);
- FocusManager.Instance.SetCurrentFocusView(view);
- Assert.AreEqual(true, _focusLostFlag, "Should be equal!");\r
-\r
- }\r
-\r
- [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")]\r
- public async Task OnThemeChangedEvent_CHECK_VALUE()\r
- {\r
- _themeFlag = false;\r
- Tizen.NUI.Components.StyleManager.Instance.Theme = "Utility";\r
- var myButton = new MyButton();\r
- Window window = Window.Instance;\r
- window.Add(myButton);\r
- Tizen.NUI.Components.StyleManager.Instance.Theme = "Food";\r
- await Task.Delay(500);\r
- Assert.AreEqual(true, _themeFlag, "OnThemeChangedEvent trigger Check Fail.");\r
- window.Remove(myButton);\r
- }\r
-\r
- [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;\r
- myButton.Size2D = new Size2D(400, 80);\r
- myButton.BackgroundColor = Color.Red;\r
- Window.Instance.Add(myButton);
- await Task.Delay(500);
- Assert.AreEqual(true, _updateFlag, "Should be equal!");\r
-\r
- }\r
-\r
- [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;\r
- myButton.Size2D = new Size2D(400, 80);\r
- myButton.BackgroundColor = Color.Red;\r
- myButton.Text = "Button";\r
- Window.Instance.Add(myButton);
- await Task.Delay(500);
- Assert.AreEqual(true, _measureTextFlag, "Should be equal!");\r
-\r
- }\r
-\r
- [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;\r
- myButton.Size2D = new Size2D(400, 80);\r
- myButton.BackgroundColor = Color.Red;\r
- myButton.Text = "Button";\r
- Window.Instance.Add(myButton);
- await Task.Delay(500);
- Assert.AreEqual(true, _layoutChildFlag, "Should be equal!");\r
-\r
- }\r
-\r
- [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<ButtonAttributes>(attr, "Should be equal!");\r
- }\r
-\r
- [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\r
- {\r
- var myButton = new MyButton();\r
- myButton.Size2D = new Size2D(400, 80);\r
- myButton.BackgroundColor = Color.Red;\r
- Window.Instance.Add(myButton);\r
- myButton.IsSelected = true;\r
- Assert.IsTrue(_updateFlag, "Should be true!");\r
- }
- 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());
- }\r
-\r
- }\r
-\r
[Test]
[Category("P1")]
[Description("Test StateChangedEvent. Check it has been triggered")]
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<Components.Button>(button, "Should be equal!");
+
+ button.StateChangedEvent += OnStateChangedEvent;
+ button.IsSelected = true;
Assert.AreEqual(true, _stateChangedEvent, "Should be equal!");\r
- myButton.StateChangedEvent -= OnStateChangedEvent;\r
+ button.StateChangedEvent -= OnStateChangedEvent;\r
}\r
\r
[Test]
try
{
Button button = new Button();
+ Assert.IsNotNull(button, "Should be not null");
+ Assert.IsInstanceOf<Components.Button>(button, "Should be equal!");
button.Dispose();
}
catch (Exception e)
}
}
\r
- private void OnStateChangedEvent(object sender, Components.Button.StateChangeEventArgs args)\r
+ private void OnStateChangedEvent(object sender, Components.Button.StateChangedEventArgs args)\r
{\r
_stateChangedEvent = true;\r
}\r
+++ /dev/null
-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;\r
-using Tizen.NUI.Components.Test;\r
-\r
-namespace Tizen.NUI.Components.Tests\r
-{\r
- [TestFixture]\r
- [Description("Tizen.NUI.Components.ButtonAttributes Tests")]\r
- public class ButtonAttributesTests\r
- {\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
- private const string TAG = "Components";\r
-\r
- [SetUp]\r
- public void Init()
- {
- Tizen.Log.Info(TAG, "Init() is called!");
- App.MainTitleChangeText("ButtonAttributesTests");
- App.MainTitleChangeBackgroundColor(null);
-
- }\r
-\r
- [TearDown]
- public void Destroy()
- {
- Tizen.Log.Info(TAG, "Destroy() is called!");
- }\r
-\r
- [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>(buttonAttributes, "Should be equal!");\r
-\r
- }\r
-\r
- [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\r
- {\r
- IsSelectable = true,\r
- BackgroundImageAttributes = new ImageAttributes\r
- {\r
- ResourceURL = new StringSelector { All = _image_path },\r
- Border = new RectangleSelector { All = new Rectangle(5, 5, 5, 5) }\r
- },\r
-\r
- TextAttributes = new TextAttributes\r
- {\r
- PointSize = new FloatSelector { All = 20 },\r
- HorizontalAlignment = HorizontalAlignment.Center,\r
- VerticalAlignment = VerticalAlignment.Center,\r
- WidthResizePolicy = ResizePolicyType.FillToParent,\r
- HeightResizePolicy = ResizePolicyType.FillToParent,\r
-\r
- TextColor = new ColorSelector\r
- {\r
- Normal = new Color(0, 0, 0, 1),\r
- Pressed = new Color(0, 0, 0, 0.7f),\r
- Selected = new Color(0.141f, 0.769f, 0.278f, 1),\r
- Disabled = new Color(0, 0, 0, 0.4f),\r
- },\r
- }\r
- };
- var _buttonAttributes = new ButtonAttributes(buttonAttributes);
- Assert.IsNotNull(_buttonAttributes, "Should be not null!");
- Assert.IsInstanceOf<ButtonAttributes>(_buttonAttributes, "Should be equal!");\r
-\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ShadowImageAttributes. Check whether ShadowImageAttributes is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.ButtonAttributes.ShadowImageAttributes A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ShadowImageAttributes_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var buttonAttributes = new ButtonAttributes();\r
- buttonAttributes.ShadowImageAttributes = new ImageAttributes();\r
- Assert.IsNotNull(buttonAttributes.ShadowImageAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<ImageAttributes>(buttonAttributes.ShadowImageAttributes, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test BackgroundImageAttributes. Check whether BackgroundImageAttributes is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.ButtonAttributes.BackgroundImageAttributes A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void BackgroundImageAttributes_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var buttonAttributes = new ButtonAttributes();\r
- buttonAttributes.BackgroundImageAttributes = new ImageAttributes();\r
- Assert.IsNotNull(buttonAttributes.BackgroundImageAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<ImageAttributes>(buttonAttributes.BackgroundImageAttributes, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test OverlayImageAttributes. Check whether OverlayImageAttributes is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.ButtonAttributes.OverlayImageAttributes A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void OverlayImageAttributes_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var buttonAttributes = new ButtonAttributes();\r
- buttonAttributes.OverlayImageAttributes = new ImageAttributes();\r
- Assert.IsNotNull(buttonAttributes.OverlayImageAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<ImageAttributes>(buttonAttributes.OverlayImageAttributes, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test TextAttributes. Check whether TextAttributes is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.ButtonAttributes.TextAttributes A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void TextAttributes_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var buttonAttributes = new ButtonAttributes();\r
- buttonAttributes.TextAttributes = new TextAttributes();\r
- Assert.IsNotNull(buttonAttributes.TextAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<TextAttributes>(buttonAttributes.TextAttributes, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test IconAttributes. Check whether IconAttributes is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.ButtonAttributes.IconAttributes A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void IconAttributes_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var buttonAttributes = new ButtonAttributes();\r
- buttonAttributes.IconAttributes = new ImageAttributes();\r
- Assert.IsNotNull(buttonAttributes.IconAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<ImageAttributes>(buttonAttributes.IconAttributes, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test IsSelectable. Check whether IsSelectable is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.ButtonAttributes.IsSelectable A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void IsSelectable_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var buttonAttributes = new ButtonAttributes();\r
- buttonAttributes.IsSelectable = true;\r
- Assert.AreEqual(true, buttonAttributes.IsSelectable, "Should be equals!");\r
- buttonAttributes.IsSelectable = false;\r
- Assert.AreEqual(false, buttonAttributes.IsSelectable, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test IconRelativeOrientation. Check whether IconRelativeOrientation is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.ButtonAttributes.IconRelativeOrientation A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void IconRelativeOrientation_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var buttonAttributes = new ButtonAttributes();\r
- buttonAttributes.IconRelativeOrientation = Components.Button.IconOrientation.Top;\r
- Assert.AreEqual(Components.Button.IconOrientation.Top, buttonAttributes.IconRelativeOrientation, "Should be equals!");\r
- 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!");
- }\r
-\r
- [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")]\r
- public void Clone_CHECK_VALUE()\r
- {\r
- var buttonAttributes = new ButtonAttributes();\r
- buttonAttributes.IsSelectable = true;\r
- var attr = buttonAttributes.Clone() as ButtonAttributes;\r
- Assert.IsNotNull(attr, "Should be not null!");\r
- Assert.IsInstanceOf<ButtonAttributes>(attr, "Should be an instance of ButtonAttributes!");\r
- Assert.AreEqual(true, attr.IsSelectable, "Should be equal!");\r
- }\r
-\r
- }\r
-}\r
+++ /dev/null
-using NUnit.Framework;\r
-using NUnit.Framework.TUnit;\r
-using System;\r
-using Tizen.NUI;\r
-using Tizen.NUI.UIComponents;\r
-using Tizen.NUI.Components;\r
-using System.Runtime.InteropServices;\r
-using System.Threading.Tasks;\r
-using Tizen.NUI.Components.Test;\r
-\r
-namespace Tizen.NUI.Components.Tests\r
-{\r
- [TestFixture]\r
- [Description("Tizen.NUI.Components.CheckBox Tests")]\r
- public class ChecBoxTests\r
- {\r
- private const string TAG = "Components";\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
-\r
- [SetUp]\r
- public void Init()\r
- {\r
- Tizen.Log.Info(TAG, "Init() is called!");\r
- App.MainTitleChangeText("CommonChecBoxTests");\r
- App.MainTitleChangeBackgroundColor(null);\r
-\r
- }\r
-\r
- [TearDown]\r
- public void Destroy()\r
- {\r
- Tizen.Log.Info(TAG, "Destroy() is called!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckBox empty constructor. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.CheckBox.CheckBox C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("COVPARAM", "")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckBox_CHECK_VALUE()\r
- {\r
- /* TEST CODE */\r
- var checkBox = new CheckBox();\r
- Assert.IsInstanceOf<CheckBox>(checkBox, "Should be equal!");\r
- Assert.IsNotNull(checkBox, "Should be not null!");\r
-\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckBox style constructor. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.CheckBox.CheckBox C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("COVPARAM", "string")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckBox_Style_CHECK_VALUE()\r
- {\r
- /* TEST CODE */\r
- StyleManager.Instance.RegisterStyle("BasicCheckBox", null, typeof(CheckBoxStyle));\r
- var checkBox = new CheckBox("BasicCheckBox");\r
- Assert.IsNotNull(checkBox, "Should be not null!");\r
- Assert.IsInstanceOf<CheckBox>(checkBox, "Should be equal!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckBox SelectButtonAttributes constructor. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.CheckBox.CheckBox C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("COVPARAM", "SelectButtonAttributes")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckBox_SelectButtonAttributes_CHECK_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButtonAttributes = new SelectButtonAttributes\r
- {\r
- CheckImageAttributes = new ImageAttributes\r
- {\r
- Size2D = new Size2D(48, 48),\r
- ResourceURL = new StringSelector\r
- {\r
- All = _image_path,\r
- },\r
- Opacity = new FloatSelector\r
- {\r
- Normal = 1.0f,\r
- Selected = 1.0f,\r
- Disabled = 0.4f,\r
- DisabledSelected = 0.4f\r
- },\r
- },\r
- };\r
- var checkBox = new CheckBox(selectButtonAttributes);\r
- Assert.IsNotNull(checkBox, "Should be not null!");\r
- Assert.IsInstanceOf<CheckBox>(checkBox, "Should be equal!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ItemGroup. Check whether ItemGroup is readable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.CheckBox.ItemGroup A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRO")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ItemGroup_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var checkBoxGroup = new CheckBoxGroup();\r
- var checkBox = new CheckBox();\r
- checkBoxGroup.Add(checkBox);\r
- Assert.IsNotNull(checkBox.ItemGroup, "Should be equal!");\r
- }\r
- }\r
-\r
- public class CheckBoxStyle : StyleBase\r
- {\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
- protected override Attributes GetAttributes()\r
- {\r
- SelectButtonAttributes attributes = new SelectButtonAttributes\r
- {\r
- IsSelectable = true,\r
- CheckImageAttributes = new ImageAttributes\r
- {\r
- Size2D = new Size2D(48, 48),\r
- Position2D = new Position2D(0, 0),\r
- ResourceURL = new StringSelector\r
- {\r
- Normal = _image_path,\r
- Selected = _image_path,\r
- Disabled = _image_path,\r
- DisabledSelected = _image_path,\r
- },\r
- Opacity = new FloatSelector\r
- {\r
- Normal = 1.0f,\r
- Selected = 1.0f,\r
- Disabled = 0.4f,\r
- DisabledSelected = 0.4f\r
- },\r
- },\r
- };\r
-\r
- return attributes;\r
- }\r
- }\r
-}\r
+++ /dev/null
-using NUnit.Framework;\r
-using NUnit.Framework.TUnit;\r
-using System;\r
-using Tizen.NUI;\r
-using Tizen.NUI.UIComponents;\r
-using Tizen.NUI.Components;\r
-using System.Runtime.InteropServices;\r
-using System.Threading.Tasks;\r
-using Tizen.NUI.Components.Test;\r
-\r
-namespace Tizen.NUI.Components.Tests\r
-{\r
- [TestFixture]\r
- [Description("Tizen.NUI.Components.CheckBoxGroup Tests")]\r
- public class CheckBoxGroupTests\r
- {\r
- private const string TAG = "Components";\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
-\r
- [SetUp]\r
- public void Init()\r
- {\r
- Tizen.Log.Info(TAG, "Init() is called!");\r
- App.MainTitleChangeText("CheckBoxGroupTests");\r
- App.MainTitleChangeBackgroundColor(null);\r
-\r
- }\r
-\r
- [TearDown]\r
- public void Destroy()\r
- {\r
- Tizen.Log.Info(TAG, "Destroy() is called!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckBoxGroup. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.CheckBoxGroup C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckBoxGroup_CHECK_VALUE()\r
- {\r
- var checkBoxGroup = new CheckBoxGroup();\r
- Assert.IsNotNull(checkBoxGroup, "Should be not null!");\r
- Assert.IsInstanceOf<CheckBoxGroup>(checkBoxGroup, "Should be equal!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test Add. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.Add M")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "MCST")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void Add_CHECK_VALUE()\r
- {\r
- var checkBox1 = new CheckBox();\r
- checkBox1.Name = "checkbox1";\r
-\r
- var checkBoxGroup = new CheckBoxGroup();\r
- checkBoxGroup.Add(checkBox1);\r
-\r
- string checkboxName1 = checkBoxGroup.GetItemByIndex(0).Name;\r
-\r
- Assert.AreEqual("checkbox1", checkboxName1, "Should be equals to the name of CheckBox");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test Remove. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.Remove M")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "MCST")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void Remove_CHECK_VALUE()\r
- {\r
- var checkBox1 = new CheckBox();\r
- checkBox1.Name = "checkbox1";\r
- var checkBox2 = new CheckBox();\r
- checkBox2.Name = "checkbox2";\r
-\r
- var checkBoxGroup = new CheckBoxGroup();\r
- checkBoxGroup.Add(checkBox1);\r
- checkBoxGroup.Add(checkBox2);\r
-\r
- checkBoxGroup.Remove(checkBox1);\r
-\r
- string checkboxName1 = checkBoxGroup.GetItemByIndex(0).Name;\r
-\r
- Assert.AreEqual("checkbox2", checkboxName1, "Should be equals to the name of CheckBox");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test GetItemByIndex. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.GetItemByIndex M")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "MR")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void GetItemByIndex_CHECK_VALUE()\r
- {\r
- var checkBox1 = new CheckBox();\r
- checkBox1.Name = "checkbox1";\r
- var checkBox2 = new CheckBox();\r
- checkBox2.Name = "checkbox2";\r
-\r
- var checkBoxGroup = new CheckBoxGroup();\r
- checkBoxGroup.Add(checkBox1);\r
- checkBoxGroup.Add(checkBox2);\r
-\r
- string checkboxName1 = checkBoxGroup.GetItemByIndex(0).Name;\r
- string checkboxName2 = checkBoxGroup.GetItemByIndex(1).Name;\r
-\r
- Assert.AreEqual("checkbox1", checkboxName1, "Should be equals to the name of CheckBox");\r
- Assert.AreEqual("checkbox2", checkboxName2, "Should be equals to the name of CheckBox");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test GetCheckedIndexArray. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.GetCheckedIndexArray M")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "MR")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void GetCheckedIndexArray_CHECK_VALUE()\r
- {\r
- var checkBox1 = new CheckBox();\r
- checkBox1.Name = "checkbox1";\r
- var checkBox2 = new CheckBox();\r
- checkBox2.Name = "checkbox2";\r
-\r
- var checkBoxGroup = new CheckBoxGroup();\r
- checkBoxGroup.Add(checkBox1);\r
- checkBoxGroup.Add(checkBox2);\r
-\r
- checkBoxGroup.CheckingAll(true);\r
-\r
- int[] indexArray = new int[2];\r
- indexArray = checkBoxGroup.GetCheckedIndexArray();\r
-\r
- Assert.AreEqual(0, indexArray[0], "Should be equal to GetCheckedIndexArray return value");\r
- Assert.AreEqual(1, indexArray[1], "Should be equal to GetCheckedIndexArray return value");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test GetCheckedItemArray. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.GetCheckedItemArray M")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "MR")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void GetCheckedItemArray_CHECK_VALUE()\r
- {\r
- var checkBox1 = new CheckBox();\r
- checkBox1.Name = "checkbox1";\r
- var checkBox2 = new CheckBox();\r
- checkBox2.Name = "checkbox2";\r
-\r
- var checkBoxGroup = new CheckBoxGroup();\r
- checkBoxGroup.Add(checkBox1);\r
- checkBoxGroup.Add(checkBox2);\r
-\r
- checkBoxGroup.CheckingAll(true);\r
-\r
- CheckBox[] checkboxArray = new CheckBox[2];\r
- checkboxArray = checkBoxGroup.GetCheckedItemArray();\r
-\r
- Assert.AreEqual("checkbox1", checkboxArray[0].Name, "Should be equal to GetCheckedItemArray return value");\r
- Assert.AreEqual("checkbox2", checkboxArray[1].Name, "Should be equal to GetCheckedItemArray return value");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test IsCheckedAll. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.IsCheckedAll M")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "MR")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void IsCheckedAll_CHECK_VALUE()\r
- {\r
- var checkBox1 = new CheckBox();\r
- checkBox1.Name = "checkbox1";\r
- var checkBox2 = new CheckBox();\r
- checkBox2.Name = "checkbox2";\r
-\r
- var checkBoxGroup = new CheckBoxGroup();\r
- checkBoxGroup.Add(checkBox1);\r
- checkBoxGroup.Add(checkBox2);\r
-\r
- checkBoxGroup.CheckingAll(false);\r
- bool flag = checkBoxGroup.IsCheckedAll();\r
- Assert.AreEqual(false, flag, "Should be equal!");\r
- checkBoxGroup.CheckingAll(true);\r
- Assert.AreEqual(true, checkBoxGroup.IsCheckedAll(), "Should be equal!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckingAll. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.CheckingAll M")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "MCST")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckingAll_CHECK_VALUE()\r
- {\r
- var checkBox1 = new CheckBox();\r
- checkBox1.Name = "checkbox1";\r
- var checkBox2 = new CheckBox();\r
- checkBox2.Name = "checkbox2";\r
-\r
- var checkBoxGroup = new CheckBoxGroup();\r
- checkBoxGroup.Add(checkBox1);\r
- checkBoxGroup.Add(checkBox2);\r
-\r
- checkBoxGroup.CheckingAll(true);\r
-\r
- bool flag = checkBoxGroup.IsCheckedAll();\r
- Assert.AreEqual(true, flag, "Should be equal!");\r
- checkBoxGroup.CheckingAll(false);\r
- Assert.AreEqual(false, checkBoxGroup.IsCheckedAll(), "Should be equal!");\r
- }\r
-\r
- }\r
-}\r
+++ /dev/null
-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>(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!");
- }
- }
-}
+++ /dev/null
-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\r
-{\r
- [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;\r
- private static bool _relayoutFlag = false;\r
- private static bool _updateFlag = false;\r
- private static bool _themeChanged = false;
-
- [SetUp]
- public void Init()
- {
- Tizen.Log.Info(TAG, "Init() is called!");
- App.MainTitleChangeText("ControlTests");
- App.MainTitleChangeBackgroundColor(null);
-
- if (!_styleRegiesterFlag)\r
- {\r
- StyleManager.Instance.RegisterStyle("DAMyControl", null, typeof(Tizen.NUI.Components.Tests.DAMyControlStyle));\r
- _styleRegiesterFlag = true;\r
- }\r
-\r
- }
-
- [TearDown]
- public void Destroy()
- {
- Tizen.Log.Info(TAG, "Destroy() is called!");
- }\r
-
- [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>(myControl, "Should be an instance of MyControl type.");
- }\r
-\r
- [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>(myControl, "Should be an instance of MyControl type.");
- }\r
-\r
- [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>(myControl, "Should be an instance of MyControl type.");
- }\r
-\r
- [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");
- }\r
-\r
- [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\r
- {\r
- BGImageAttributes = new ImageAttributes\r
- {\r
- BackgroundColor = new ColorSelector\r
- {\r
- All = new Color(0.43f, 0.43f, 0.43f, 0.1f),\r
- }\r
- },\r
- };
-
- 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();\r
- view.Size2D = new Size2D(200, 200);\r
- view.BackgroundColor = Color.Red;\r
- Window.Instance.Add(view);\r
- view.BackgroundColor = Color.Cyan;\r
- await Task.Delay(500);\r
- Assert.AreEqual(true, _updateFlag, "OnUpdate trigger Check Fail.");\r
- 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\r
- {\r
- public MyControlAttributes() : base()\r
- {\r
-\r
- }\r
-\r
- public MyControlAttributes(MyControlAttributes attributes) : base(attributes)\r
- {\r
- if (attributes == null)\r
- {\r
- return;\r
- }\r
-\r
- if (attributes.BGImageAttributes != null)\r
- {\r
- BGImageAttributes = attributes.BGImageAttributes.Clone() as ImageAttributes;\r
- }\r
- }\r
- public ImageAttributes BGImageAttributes\r
- {\r
- get;\r
- set;\r
- }\r
-\r
- public override Attributes Clone()\r
- {\r
- return new MyControlAttributes(this);\r
- }\r
- }\r
-\r
- public class MyControl : Control\r
- {\r
- private MyControlAttributes _myControlAttrs;\r
- private ImageView _bgImage;\r
- public MyControl() : base()\r
- {\r
- Initialize();\r
- }\r
-\r
- public MyControl(string style) : base(style)\r
- {\r
- Initialize();\r
- }\r
-\r
- public MyControl(MyControlAttributes attributes) : base(attributes)\r
- {\r
- Initialize();\r
- }\r
-\r
- private void Initialize()\r
- {\r
- _myControlAttrs = this.attributes as MyControlAttributes;\r
- if (_myControlAttrs == null)\r
- {\r
- throw new Exception("ScrollBar attribute parse error.");\r
- }\r
-\r
- _bgImage = new ImageView\r
- {\r
- Focusable = false,\r
- WidthResizePolicy = ResizePolicyType.FillToParent,\r
- HeightResizePolicy = ResizePolicyType.FillToParent,\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,\r
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft\r
-\r
- };\r
- }\r
-\r
- public void ApplyAttributes(ViewAttributes attrs)\r
- {\r
- ApplyAttributes(this, _myControlAttrs);\r
- }\r
-\r
- public Attributes TestGetAttributes()\r
- {\r
- return GetAttributes();\r
- }\r
- protected override Attributes GetAttributes()\r
- {\r
- return new MyControlAttributes()\r
- {\r
- BGImageAttributes = new ImageAttributes\r
- {\r
- WidthResizePolicy = ResizePolicyType.FillToParent,\r
- HeightResizePolicy = ResizePolicyType.FillToParent,\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,\r
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft\r
- }\r
-\r
- };\r
- }\r
-\r
- public override void OnRelayout(Vector2 size, RelayoutContainer container)\r
- {\r
- _relayoutFlag = true;\r
- ApplyAttributes(this, _myControlAttrs);\r
- ApplyAttributes(_bgImage, _myControlAttrs.BGImageAttributes);\r
- base.OnRelayout(size, container);\r
- }\r
-\r
- public override void OnFocusGained()\r
- {\r
- _focusGainedFlag = true;\r
- base.OnFocusGained();\r
- }\r
-\r
- public override void OnFocusLost()\r
- {\r
- _focusLostFlag = true;\r
- base.OnFocusLost();\r
- }\r
-\r
- protected override void OnUpdate()\r
- {\r
- _updateFlag = true;\r
- base.OnUpdate();\r
- }\r
-\r
- protected override void OnThemeChangedEvent(object sender, Tizen.NUI.Components.StyleManager.ThemeChangeEventArgs e)\r
- {\r
- _themeChanged = true;\r
- base.OnThemeChangedEvent(sender, e);\r
- }\r
- }
- }
-
- 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;
- }
- }
-}
+++ /dev/null
-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;\r
-\r
-namespace Tizen.NUI.Components.Tests\r
-{\r
- [TestFixture]\r
- [Description("Tizen.NUI.Components.DropDown.DropDownItemData Tests")]\r
- public class DropDownItemDataTests\r
- {\r
- private const string TAG = "Components";\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
-\r
- [SetUp]\r
- public void Init()
- {
- Tizen.Log.Info(TAG, "Init() is called!");
- App.MainTitleChangeText("DropDownItemDataTests");
- App.MainTitleChangeBackgroundColor(null);
-
- }\r
-\r
- [TearDown]
- public void Destroy()
- {
- Tizen.Log.Info(TAG, "Destroy() is called!");
- }\r
-\r
- [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<DropDown.DropDownItemData>(dropDownItemData, "Should be equal!");\r
-\r
- }\r
-\r
- [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<DropDown.DropDownItemData>(dropDownItemData, "Should be equal!");\r
- }\r
-\r
- [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()
- {\r
- /* TEST CODE */\r
- var itemAttrs = new DropDownItemAttributes\r
- {\r
- BackgroundColor = new ColorSelector\r
- {\r
- Pressed = new Color(0, 0, 0, 0.4f),\r
- Other = new Color(1, 1, 1, 0),\r
- },\r
- TextAttributes = new TextAttributes\r
- {\r
- PointSize = new FloatSelector { All = 18 },\r
- FontFamily = "SamsungOne 500",\r
- Position2D = new Position2D(28, 0),\r
- },\r
- CheckImageAttributes = new ImageAttributes\r
- {\r
- Size2D = new Size2D(40, 40),\r
- ResourceURL = new StringSelector { All = _image_path },\r
- },\r
- CheckImageRightSpace = 16,\r
- };
- var dropDownItemData = new DropDown.DropDownItemData(itemAttrs);
- Assert.IsNotNull(dropDownItemData, "Should be not null");
- Assert.IsInstanceOf<DropDown.DropDownItemData>(dropDownItemData, "Should be equal!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test Size2D. Check whether Size2D is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.Size2D A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void Size2D_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownItemData = new DropDown.DropDownItemData();\r
- dropDownItemData.Size2D = new Size2D(10, 10);\r
- Assert.AreEqual(10, dropDownItemData.Size2D.Width, "Should be equals to the set value of dropDownItemData.Size2D.Width");\r
- Assert.AreEqual(10, dropDownItemData.Size2D.Height, "Should be equals to the set value of dropDownItemData.Size2D.Height");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test BackgroundColorSelector. Check whether BackgroundColorSelector is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.BackgroundColorSelector A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void BackgroundColorSelector_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownItemData = new DropDown.DropDownItemData();\r
- var colorSelector = new ColorSelector\r
- {\r
- Normal = new Color(0.0f, 0.0f, 1.0f, 1.0f),\r
- Selected = new Color(0.0f, 1.0f, 0.0f, 1.0f),\r
- };\r
-\r
- dropDownItemData.BackgroundColorSelector = colorSelector;\r
- Assert.AreEqual(colorSelector.Normal.R, dropDownItemData.BackgroundColorSelector.Normal.R, "Should be equals to the set value of BackgroundColorSelector Normal R");\r
- Assert.AreEqual(colorSelector.Normal.G, dropDownItemData.BackgroundColorSelector.Normal.G, "Should be equals to the set value of BackgroundColorSelector Normal G");\r
- Assert.AreEqual(colorSelector.Normal.B, dropDownItemData.BackgroundColorSelector.Normal.B, "Should be equals to the set value of BackgroundColorSelector Normal B");\r
- Assert.AreEqual(colorSelector.Normal.A, dropDownItemData.BackgroundColorSelector.Normal.A, "Should be equals to the set value of BackgroundColorSelector Normal A");\r
-\r
- Assert.AreEqual(colorSelector.Selected.R, dropDownItemData.BackgroundColorSelector.Selected.R, "Should be equals to the set value of BackgroundColorSelector Selected R");\r
- Assert.AreEqual(colorSelector.Selected.G, dropDownItemData.BackgroundColorSelector.Selected.G, "Should be equals to the set value of BackgroundColorSelector Selected G");\r
- Assert.AreEqual(colorSelector.Selected.B, dropDownItemData.BackgroundColorSelector.Selected.B, "Should be equals to the set value of BackgroundColorSelector Selected B");\r
- Assert.AreEqual(colorSelector.Selected.A, dropDownItemData.BackgroundColorSelector.Selected.A, "Should be equals to the set value of BackgroundColorSelector Selected A");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test Text. Check whether Text is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.Text A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void Text_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownItemData = new DropDown.DropDownItemData();\r
- dropDownItemData.Text = "Test Text";\r
- Assert.AreEqual("Test Text", dropDownItemData.Text, "Should be equals to the set value of Text");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test PointSize. Check whether PointSize is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.PointSize A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void PointSize_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownItemData = new DropDown.DropDownItemData();\r
- dropDownItemData.PointSize = 10.0f;\r
- Assert.AreEqual(10.0f, dropDownItemData.PointSize, "Should be equals to the set value of PointSize");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test FontFamily. Check whether FontFamily is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.FontFamily A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void FontFamily_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownItemData = new DropDown.DropDownItemData();\r
- dropDownItemData.FontFamily = "SamsungOne 500";\r
- Assert.AreEqual("SamsungOne 500", dropDownItemData.FontFamily, "Should be equals to the set value of FontFamily");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test TextPosition2D. Check whether TextPosition2D is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.TextPosition2D A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void TextPosition2D_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownItemData = new DropDown.DropDownItemData();\r
- dropDownItemData.TextPosition2D = new Position2D(10, 10);\r
- Assert.AreEqual(10, dropDownItemData.TextPosition2D.X, "Should be equals to the set value of TextPosition2D.X");\r
- Assert.AreEqual(10, dropDownItemData.TextPosition2D.Y, "Should be equals to the set value of TextPosition2D.Y");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test IconResourceUrl. Check whether IconResourceUrl is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.IconResourceUrl A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void IconResourceUrl_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownItemData = new DropDown.DropDownItemData();\r
- dropDownItemData.IconResourceUrl = _image_path;\r
- Assert.AreEqual(_image_path, dropDownItemData.IconResourceUrl, "Should be equals to the set value of IconResourceUrl");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test IconSize2D. Check whether IconSize2D is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.IconSize2D A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void IconSize2D_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownItemData = new DropDown.DropDownItemData();\r
- dropDownItemData.IconSize2D = new Size2D(10, 10);\r
- Assert.AreEqual(10, dropDownItemData.IconSize2D.Width, "Should be equals to the set value of IconSize2D.Width");\r
- Assert.AreEqual(10, dropDownItemData.IconSize2D.Height, "Should be equals to the set value of IconSize2D.Height");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test IconPosition2D. Check whether IconPosition2D is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.IconPosition2D A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void IconPosition2D_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownItemData = new DropDown.DropDownItemData();\r
- dropDownItemData.IconPosition2D = new Position2D(10, 10);\r
- Assert.AreEqual(10, dropDownItemData.IconPosition2D.X, "Should be equals to the set value of IconPosition2D.X");\r
- Assert.AreEqual(10, dropDownItemData.IconPosition2D.Y, "Should be equals to the set value of IconPosition2D.Y");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckImageResourceUrl. Check whether CheckImageResourceUrl is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.CheckImageResourceUrl A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckImageResourceUrl_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownItemData = new DropDown.DropDownItemData();\r
- dropDownItemData.CheckImageResourceUrl = _image_path;\r
- Assert.AreEqual(_image_path, dropDownItemData.CheckImageResourceUrl, "Should be equals to the set value of CheckImageResourceUrl");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckImageSize2D. Check whether CheckImageSize2D is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.CheckImageSize2D A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckImageSize2D_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownItemData = new DropDown.DropDownItemData();\r
- dropDownItemData.CheckImageSize2D = new Size2D(10, 10);\r
- Assert.AreEqual(10, dropDownItemData.CheckImageSize2D.Width, "Should be equals to the set value of CheckImageSize2D.Width");\r
- Assert.AreEqual(10, dropDownItemData.CheckImageSize2D.Height, "Should be equals to the set value of CheckImageSize2D.Height");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckImageRightSpace. Check whether CheckImageRightSpace is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.CheckImageRightSpace A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckImageRightSpace_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownItemData = new DropDown.DropDownItemData();\r
- dropDownItemData.CheckImageRightSpace = 10;\r
- Assert.AreEqual(10, dropDownItemData.CheckImageRightSpace, "Should be equals to the set value of CheckImageRightSpace");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test IsSelected. Check whether IsSelected is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.DropDownItemData.IsSelected A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void IsSelected_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownItemData = new DropDown.DropDownItemData();\r
- dropDownItemData.IsSelected = true;\r
- Assert.AreEqual(true, dropDownItemData.IsSelected, "Should be equals to the set value of IsSelected");\r
- dropDownItemData.IsSelected = false;\r
- Assert.AreEqual(false, dropDownItemData.IsSelected, "Should be equals to the set value of IsSelected");\r
- }\r
-\r
- public class IconListItemStyle : StyleBase\r
- {\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
- protected override Attributes GetAttributes()\r
- {\r
- DropDownItemAttributes attributes = new DropDownItemAttributes\r
- {\r
- BackgroundColor = new ColorSelector\r
- {\r
- Pressed = new Color(0, 0, 0, 0.4f),\r
- Other = new Color(1, 1, 1, 0),\r
- },\r
- IconAttributes = new ImageAttributes\r
- {\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,\r
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,\r
- Size2D = new Size2D(28, 28),\r
- Position2D = new Position2D(28, 0),\r
- },\r
- CheckImageAttributes = new ImageAttributes\r
- {\r
- Size2D = new Size2D(40, 40),\r
- ResourceURL = new StringSelector { All = _image_path },\r
- },\r
- CheckImageRightSpace = 16,\r
- };\r
-\r
- return attributes;\r
- }\r
- }\r
- }\r
-}\r
+++ /dev/null
-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;\r
-\r
-namespace Tizen.NUI.Components.Tests\r
-{\r
- [TestFixture]\r
- [Description("Tizen.NUI.Components.DropDown.DropDownListBridge Tests")]\r
- public class DropDownListBridgeTests\r
- {\r
- private const string TAG = "Components";\r
-\r
- [SetUp]\r
- public void Init()
- {
- Tizen.Log.Info(TAG, "Init() is called!");
- App.MainTitleChangeText("DropDownListBridgeTests");
- App.MainTitleChangeBackgroundColor(null);
-
- }\r
-\r
- [TearDown]
- public void Destroy()
- {
- Tizen.Log.Info(TAG, "Destroy() is called!");
- }\r
-\r
- [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<DropDown.DropDownListBridge>(dropDownListBridge, "Should be equal!");\r
-\r
- }\r
-\r
- [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");
- }\r
-\r
- [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");
- }\r
-\r
- [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();\r
- var dropDownItemData = new DropDown.DropDownItemData();
- dropDownItemData.Text = "Item0";
- dropDownListBridge.InsertData(0, dropDownItemData);
- var dropDownRet = dropDownListBridge.GetData(0);
- Assert.IsNotNull(dropDownRet, "Should not be null");\r
- Assert.AreEqual("Item0", dropDownRet.Text, "Should be equal!");\r
- }\r
-\r
- [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");
- }\r
-\r
- [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");
- }\r
-\r
- [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()
- {\r
- /* TEST CODE */\r
-\r
- var myDropDownListBridge = new MyDropDownListBridge();
- var dropDownItemData = new DropDown.DropDownItemData();
- myDropDownListBridge.InsertData(0, dropDownItemData);
- myDropDownListBridge.TestOnBindViewHolder();
- Assert.AreEqual(true, myDropDownListBridge.bindViewHolderFlag, "Should be equal");
- }\r
-\r
- [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");
- }\r
-\r
- }\r
-\r
- public class MyDropDownListBridge : DropDown.DropDownListBridge\r
- {\r
- public bool createViewHolderFlag = false;\r
- public bool bindViewHolderFlag = false;\r
- public bool destroyViewHolderFlag = false;\r
-\r
- public override FlexibleView.ViewHolder OnCreateViewHolder(int viewType)\r
- {\r
- createViewHolderFlag = true;\r
- return base.OnCreateViewHolder(viewType);\r
- }\r
-\r
- public override void OnBindViewHolder(FlexibleView.ViewHolder holder, int position)\r
- {\r
- bindViewHolderFlag = true;\r
- }\r
-\r
- public override void OnDestroyViewHolder(FlexibleView.ViewHolder holder)\r
- {\r
- destroyViewHolderFlag = true;\r
- base.OnDestroyViewHolder(holder);\r
- }\r
-\r
- public void TestOnCreateViewHolder()\r
- {\r
- OnCreateViewHolder(0);\r
-\r
- }\r
-\r
- public void TestOnBindViewHolder()\r
- {\r
- FlexibleView.ViewHolder holder = new FlexibleView.ViewHolder(new BaseComponents.View());\r
- OnBindViewHolder(holder, 0);\r
- Assert.AreEqual(true, bindViewHolderFlag, "Should be equal");\r
- }\r
-\r
- public void TestDestroyViewHolderFlag()\r
- {\r
- FlexibleView.ViewHolder holder = new FlexibleView.ViewHolder(new BaseComponents.View());\r
- OnDestroyViewHolder(holder);\r
- Assert.AreEqual(true, destroyViewHolderFlag, "Should be equal");\r
- }\r
- }\r
-}\r
+++ /dev/null
-using NUnit.Framework;\r
-using NUnit.Framework.TUnit;\r
-using System;\r
-using Tizen.NUI;\r
-using Tizen.NUI.UIComponents;\r
-using Tizen.NUI.Components;\r
-using System.Runtime.InteropServices;\r
-using System.Threading.Tasks;\r
-using Tizen.NUI.Components.Test;\r
-\r
-namespace Tizen.NUI.Components.Tests\r
-{\r
- [TestFixture]\r
- [Description("Tizen.NUI.Components.DropDown.ItemClickEventArgs Tests")]\r
- public class DropDownItemClickEventArgsTests\r
- {\r
- private const string TAG = "Components";\r
-\r
- [SetUp]\r
- public void Init()\r
- {\r
- Tizen.Log.Info(TAG, "Init() is called!");\r
- App.MainTitleChangeText("DropDownItemClickEventArgsTests");\r
- App.MainTitleChangeBackgroundColor(null);\r
-\r
- }\r
-\r
- [TearDown]\r
- public void Destroy()\r
- {\r
- Tizen.Log.Info(TAG, "Destroy() is called!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ItemClickEventArgs empty constructor. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.ItemClickEventArgs.ItemClickEventArgs C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("COVPARAM", "")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ItemClickEventArgs_CHECK_VALUE()\r
- {\r
- /* TEST CODE */\r
- var itemClickEventArgs = new DropDown.ItemClickEventArgs();\r
- Assert.IsNotNull(itemClickEventArgs, "Should be not null!");\r
- Assert.IsInstanceOf<DropDown.ItemClickEventArgs>(itemClickEventArgs, "Should be equal!");\r
-\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test Index. Check whether Index is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.ItemClickEventArgs.Index A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void Index_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var itemClickEventArgs = new DropDown.ItemClickEventArgs();\r
- itemClickEventArgs.Index = 0;\r
- Assert.AreEqual(0, itemClickEventArgs.Index, "Should be equal");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ItemClickEventArgs.Text. Check whether Text is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.ItemClickEventArgs.Text A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ItemClickEventArgs_Text_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var itemClickEventArgs = new DropDown.ItemClickEventArgs();\r
- itemClickEventArgs.Text = "text";\r
- Assert.AreEqual("text", itemClickEventArgs.Text, "Should be equal");\r
- }\r
- }\r
-}\r
+++ /dev/null
-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;\r
-\r
-namespace Tizen.NUI.Components.Tests\r
-{\r
- [TestFixture]\r
- [Description("Tizen.NUI.Components.DropDown Tests")]\r
- public class DropDownTests\r
- {\r
- private const string TAG = "Components";\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
- private static bool _updateFlag = false;\r
-\r
- [SetUp]\r
- public void Init()
- {
- Tizen.Log.Info(TAG, "Init() is called!");
- App.MainTitleChangeText("CommonSwitchTests");
- App.MainTitleChangeBackgroundColor(null);
-
- }\r
-\r
- [TearDown]
- public void Destroy()
- {
- Tizen.Log.Info(TAG, "Destroy() is called!");
- }\r
-\r
- [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>(dropDown, "Should be equal!");\r
-\r
- }\r
-\r
- [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>(dropDown, "Should be equal!");\r
- }\r
-\r
- [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()
- {\r
- /* TEST CODE */\r
- var attrs = new DropDownAttributes\r
- {\r
- HeaderTextAttributes = new TextAttributes\r
- {\r
- Text = new StringSelector { All = "TitleArea" },\r
- PointSize = new FloatSelector { All = 28 },\r
- TextColor = new ColorSelector { All = new Color(0, 0, 0, 1) },\r
- FontFamily = "SamsungOneUI 500C",\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,\r
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
- WidthResizePolicy = ResizePolicyType.FillToParent,
- HeightResizePolicy = ResizePolicyType.FillToParent,
- HorizontalAlignment = HorizontalAlignment.Center,
- VerticalAlignment = VerticalAlignment.Center,\r
- },\r
-\r
- ButtonAttributes = new ButtonAttributes\r
- {\r
- TextAttributes = new TextAttributes\r
- {\r
- Text = new StringSelector { All = "DropDown Text" },\r
- PointSize = new FloatSelector { All = 20 },\r
- TextColor = new ColorSelector { All = new Color(0, 0, 0, 1) },\r
- FontFamily = "SamsungOneUI 500",\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,\r
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,\r
- WidthResizePolicy = ResizePolicyType.UseNaturalSize,\r
- HeightResizePolicy = ResizePolicyType.FillToParent,\r
- Position2D = new Position2D(0, 0),\r
- HorizontalAlignment = HorizontalAlignment.Begin,\r
- VerticalAlignment = VerticalAlignment.Center,\r
- },\r
- IconAttributes = new ImageAttributes\r
- {\r
- Size2D = new Size2D(48, 48),\r
- ResourceURL = new StringSelector { All = _image_path },\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.CenterRight,\r
- PivotPoint = Tizen.NUI.PivotPoint.CenterRight,\r
- },\r
- },\r
- ListBackgroundImageAttributes = new ImageAttributes\r
- {\r
- ResourceURL = new StringSelector { All = _image_path },\r
- Border = new RectangleSelector { All = new Rectangle(51, 51, 51, 51) },\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,\r
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,\r
- WidthResizePolicy = ResizePolicyType.FitToChildren,\r
- HeightResizePolicy = ResizePolicyType.FitToChildren,\r
- },\r
- Space = new Vector4(56, 0, 0, 0),\r
- SpaceBetweenButtonTextAndIcon = 8,\r
- ListMargin = new Vector4(20, 0, 20, 0),\r
- BackgroundColor = new ColorSelector { All = new Color(1, 1, 1, 1) },\r
- ListSize2D = new Size2D(360, 500),\r
- ListPadding = new Extents(4, 4, 4, 4),\r
- };
- var dropDown = new DropDown(attrs);
- Assert.IsNotNull(dropDown, "Should be not null!");
- Assert.IsInstanceOf<DropDown>(dropDown, "Should be equal!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test HeaderText. Check whether HeaderText is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.HeaderText A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void HeaderText_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- dropDown.HeaderText = "Test HeaderText";\r
- Assert.AreEqual("Test HeaderText", dropDown.HeaderText, "Should be equals to the set value of HeaderText");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test HeaderTextPointSize. Check whether HeaderTextPointSize is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.HeaderTextPointSize A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void HeaderTextPointSize_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- dropDown.HeaderTextPointSize = 10.0f;\r
- Assert.AreEqual(10.0f, dropDown.HeaderTextPointSize, "Should be equals to the set value of HeaderTextPointSize");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test HeaderTextFontFamily. Check whether HeaderTextFontFamily is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.HeaderTextFontFamily A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void HeaderTextFontFamily_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- dropDown.HeaderTextFontFamily = "SamsungOne 500";\r
- Assert.AreEqual("SamsungOne 500", dropDown.HeaderTextFontFamily, "Should be equals to the set value of HeaderTextFontFamily");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test HeaderTextColor. Check whether HeaderTextColor is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.HeaderTextColor A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void HeaderTextColor_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- var color = new Color(1.0f, 0.0f, 0.0f, 1.0f);\r
- dropDown.HeaderTextColor = color;\r
-\r
- 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");\r
-\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test HeaderTextColorSelector. Check whether HeaderTextColorSelector is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.HeaderTextColorSelector A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void HeaderTextColorSelector_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- var colorSelector = new ColorSelector\r
- {\r
- Normal = new Color(0.0f, 0.0f, 1.0f, 1.0f),\r
- Selected = new Color(0.0f, 1.0f, 0.0f, 1.0f),\r
- };\r
-\r
- dropDown.HeaderTextColorSelector = colorSelector;\r
- Assert.AreEqual(colorSelector.Normal.R, dropDown.HeaderTextColorSelector.Normal.R, "Should be equals to the set value of HeaderTextColorSelector Normal R");\r
- Assert.AreEqual(colorSelector.Normal.G, dropDown.HeaderTextColorSelector.Normal.G, "Should be equals to the set value of HeaderTextColorSelector Normal G");\r
- Assert.AreEqual(colorSelector.Normal.B, dropDown.HeaderTextColorSelector.Normal.B, "Should be equals to the set value of HeaderTextColorSelector Normal B");\r
- Assert.AreEqual(colorSelector.Normal.A, dropDown.HeaderTextColorSelector.Normal.A, "Should be equals to the set value of HeaderTextColorSelector Normal A");\r
-\r
- Assert.AreEqual(colorSelector.Selected.R, dropDown.HeaderTextColorSelector.Selected.R, "Should be equals to the set value of HeaderTextColorSelector Selected R");\r
- Assert.AreEqual(colorSelector.Selected.G, dropDown.HeaderTextColorSelector.Selected.G, "Should be equals to the set value of HeaderTextColorSelector Selected G");\r
- Assert.AreEqual(colorSelector.Selected.B, dropDown.HeaderTextColorSelector.Selected.B, "Should be equals to the set value of HeaderTextColorSelector Selected B");\r
- Assert.AreEqual(colorSelector.Selected.A, dropDown.HeaderTextColorSelector.Selected.A, "Should be equals to the set value of HeaderTextColorSelector Selected A");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ButtonText. Check whether ButtonText is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.ButtonText A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ButtonText_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- dropDown.ButtonText = "Test ButtonText";\r
- Assert.AreEqual("Test ButtonText", dropDown.ButtonText, "Should be equals to the set value of ButtonText");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ButtonTextPointSize. Check whether ButtonTextPointSize is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.ButtonTextPointSize A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ButtonTextPointSize_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- dropDown.ButtonTextPointSize = 10.0f;\r
- Assert.AreEqual(10.0f, dropDown.ButtonTextPointSize, "Should be equals to the set value of ButtonTextPointSize");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ButtonTextFontFamily. Check whether ButtonTextFontFamily is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.ButtonTextFontFamily A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ButtonTextFontFamily_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- dropDown.ButtonTextFontFamily = "SamsungOne 500";\r
- Assert.AreEqual("SamsungOne 500", dropDown.ButtonTextFontFamily, "Should be equals to the set value of HeaderTextFontFamily");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ButtonTextColor. Check whether ButtonTextColor is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.ButtonTextColor A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ButtonTextColor_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- var color = new Color(1.0f, 0.0f, 0.0f, 1.0f);\r
- dropDown.ButtonTextColor = color;\r
-\r
- 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");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ButtonTextColorSelector. Check whether ButtonTextColorSelector is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.ButtonTextColorSelector A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ButtonTextColorSelector_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- var colorSelector = new ColorSelector\r
- {\r
- Normal = new Color(0.0f, 0.0f, 1.0f, 1.0f),\r
- Selected = new Color(0.0f, 1.0f, 0.0f, 1.0f),\r
- };\r
-\r
- dropDown.ButtonTextColorSelector = colorSelector;\r
- Assert.AreEqual(colorSelector.Normal.R, dropDown.ButtonTextColorSelector.Normal.R, "Should be equals to the set value of ButtonTextColorSelector Normal R");\r
- Assert.AreEqual(colorSelector.Normal.G, dropDown.ButtonTextColorSelector.Normal.G, "Should be equals to the set value of ButtonTextColorSelector Normal G");\r
- Assert.AreEqual(colorSelector.Normal.B, dropDown.ButtonTextColorSelector.Normal.B, "Should be equals to the set value of ButtonTextColorSelector Normal B");\r
- Assert.AreEqual(colorSelector.Normal.A, dropDown.ButtonTextColorSelector.Normal.A, "Should be equals to the set value of ButtonTextColorSelector Normal A");\r
-\r
- Assert.AreEqual(colorSelector.Selected.R, dropDown.ButtonTextColorSelector.Selected.R, "Should be equals to the set value of ButtonTextColorSelector SelectedFocused R");\r
- Assert.AreEqual(colorSelector.Selected.G, dropDown.ButtonTextColorSelector.Selected.G, "Should be equals to the set value of ButtonTextColorSelector SelectedFocused G");\r
- Assert.AreEqual(colorSelector.Selected.B, dropDown.ButtonTextColorSelector.Selected.B, "Should be equals to the set value of ButtonTextColorSelector SelectedFocused B");\r
- Assert.AreEqual(colorSelector.Selected.A, dropDown.ButtonTextColorSelector.Selected.A, "Should be equals to the set value of ButtonTextColorSelector SelectedFocused A");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ButtonIconImageURL. Check whether ButtonIconImageURL is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.ButtonIconImageURL A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ButtonIconImageURL_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- dropDown.ButtonIconImageURL = _image_path;\r
- Assert.AreEqual(_image_path, dropDown.ButtonIconImageURL, "Should be equals to the set value of ButtonIconImageURL");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ButtonIconSize2D. Check whether ButtonIconSize2D is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.ButtonIconSize2D A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ButtonIconSize2D_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- dropDown.ButtonIconSize2D = new Size2D(10, 10);\r
- Assert.AreEqual(10, dropDown.ButtonIconSize2D.Width, "Should be equals to the set value of ButtonIconSize2D.Width");\r
- Assert.AreEqual(10, dropDown.ButtonIconSize2D.Height, "Should be equals to the set value of ButtonIconSize2D.Height");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test SpaceBetweenButtonTextAndIcon. Check whether SpaceBetweenButtonTextAndIcon is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.SpaceBetweenButtonTextAndIcon A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void SpaceBetweenButtonTextAndIcon_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- dropDown.SpaceBetweenButtonTextAndIcon = 10;\r
- Assert.AreEqual(10, dropDown.SpaceBetweenButtonTextAndIcon, "Should be equals to the set value of SpaceBetweenButtonTextAndIcon");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test LeftSpace. Check whether LeftSpace is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.LeftSpace A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void LeftSpace_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- dropDown.LeftSpace = 10;\r
- Assert.AreEqual(10, dropDown.LeftSpace, "Should be equals to the set value of LeftSpace");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test RightSpace. Check whether RightSpace is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.RightSpace A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void RightSpace_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- dropDown.RightSpace = 10;\r
- Assert.AreEqual(10, dropDown.RightSpace, "Should be equals to the set value of RightSpace");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ListBackgroundImageURL. Check whether ListBackgroundImageURL is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.ListBackgroundImageURL A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ListBackgroundImageURL_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- dropDown.ListBackgroundImageURL = _image_path;\r
- Assert.AreEqual(_image_path, dropDown.ListBackgroundImageURL, "Should be equals to the set value of ListBackgroundImageURL");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ListBackgroundImageBorder. Check whether ListBackgroundImageBorder is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.ListBackgroundImageBorder A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ListBackgroundImageBorder_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- dropDown.ListBackgroundImageBorder = new Rectangle(0, 0, 10, 10);\r
- Assert.AreEqual(0, dropDown.ListBackgroundImageBorder.X, "Retrieved ListBackgroundImageBorder should be equal to set value");\r
- Assert.AreEqual(0, dropDown.ListBackgroundImageBorder.Y, "Retrieved ListBackgroundImageBorder should be equal to set value");\r
- Assert.AreEqual(10, dropDown.ListBackgroundImageBorder.Width, "Retrieved ListBackgroundImageBorder should be equal to set value");\r
- Assert.AreEqual(10, dropDown.ListBackgroundImageBorder.Height, "Retrieved ListBackgroundImageBorder should be equal to set value");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ListRelativeOrientation. Check whether ListRelativeOrientation is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.ListRelativeOrientation A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ListRelativeOrientation_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- dropDown.ListRelativeOrientation = DropDown.ListOrientation.Left;\r
- Assert.AreEqual(DropDown.ListOrientation.Left, dropDown.ListRelativeOrientation, "Should be equals to the set value of ListRelativeOrientation");\r
- dropDown.ListRelativeOrientation = DropDown.ListOrientation.Right;\r
- Assert.AreEqual(DropDown.ListOrientation.Right, dropDown.ListRelativeOrientation, "Should be equals to the set value of ListRelativeOrientation");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ListLeftMargin. Check whether ListLeftMargin is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.ListLeftMargin A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ListLeftMargin_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- dropDown.ListLeftMargin = 10;\r
- Assert.AreEqual(10, dropDown.ListLeftMargin, "Should be equals to the set value of ListLeftMargin");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ListRigthMargin. Check whether ListRigthMargin is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.ListRigthMargin A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ListRigthMargin_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- dropDown.ListRigthMargin = 10;\r
- Assert.AreEqual(10, dropDown.ListRigthMargin, "Should be equals to the set value of ListRigthMargin");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ListTopMargin. Check whether ListTopMargin is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.ListTopMargin A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ListTopMargin_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- dropDown.ListTopMargin = 10;\r
- Assert.AreEqual(10, dropDown.ListTopMargin, "Should be equals to the set value of ListTopMargin");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test FocusedItemIndex. Check whether FocusedItemIndex is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.FocusedItemIndex A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void FocusedItemIndex_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- dropDown.FocusedItemIndex = 2;\r
- Assert.AreEqual(2, dropDown.FocusedItemIndex, "Should be equals to the set value of FocusedItemIndex");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test SelectedItemIndex. Check whether SelectedItemIndex is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.SelectedItemIndex A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void SelectedItemIndex_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- var dropDownItemData = new DropDown.DropDownItemData();
- dropDown.AddItem(dropDownItemData);\r
- var dropDownItemData1 = new DropDown.DropDownItemData();
- dropDown.AddItem(dropDownItemData1);\r
- dropDown.SelectedItemIndex = 1;\r
- Assert.AreEqual(1, dropDown.SelectedItemIndex, "Should be equals to the set value of SelectedItemIndex");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ListSize2D. Check whether ListSize2D is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.ListSize2D A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ListSize2D_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- dropDown.ListSize2D = new Size2D(10, 10);\r
- Assert.AreEqual(10, dropDown.ListSize2D.Width, "Should be equals to the set value of ListSize2D.Width");\r
- Assert.AreEqual(10, dropDown.ListSize2D.Height, "Should be equals to the set value of ListSize2D.Height");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ListPadding. Check whether ListPadding is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDown.ListPadding A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ListPadding_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDown = new DropDown();\r
- dropDown.ListPadding = new Extents(10, 10, 10, 10);\r
- Assert.AreEqual(10, dropDown.ListPadding.Start, "Should be equals to the set value of ListPadding.Start");\r
- Assert.AreEqual(10, dropDown.ListPadding.End, "Should be equals to the set value of ListPadding.End");\r
- Assert.AreEqual(10, dropDown.ListPadding.Top, "Should be equals to the set value of ListPadding.Top");\r
- Assert.AreEqual(10, dropDown.ListPadding.Bottom, "Should be equals to the set value of ListPadding.Bottom");\r
- }\r
-\r
- [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");
- }\r
-\r
- [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");
- }\r
-\r
- [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");
- }\r
-\r
- [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 */\r
- 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());
- }
- }\r
-\r
- [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 */\r
- 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());
- }
- }\r
-\r
- public class MyDropDown : DropDown\r
- {\r
- protected override void OnUpdate()\r
- {\r
- _updateFlag = true;\r
- base.OnUpdate();\r
- }\r
-\r
- protected override Attributes GetAttributes()\r
- {\r
- return base.GetAttributes();\r
- }\r
-\r
- public Attributes TestGetAttributes()\r
- {\r
- return GetAttributes();\r
- }\r
- }\r
-\r
- [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);\r
- myDropDown.BackgroundColor = Color.Red;\r
- Window.Instance.Add(myDropDown);\r
- myDropDown.BackgroundColor = Color.Cyan;\r
- await Task.Delay(500);\r
- Assert.AreEqual(true, _updateFlag, "OnUpdate trigger Check Fail.");\r
- Window.Instance.Remove(myDropDown);\r
- }\r
-\r
- [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<DropDownAttributes>(attr, "Should be equal!");\r
-\r
- }\r
-\r
- [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());
- }
- }\r
-\r
- public class ListSpinnerDropDownStyle : StyleBase\r
- {\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
- protected override Attributes GetAttributes()\r
- {\r
- DropDownAttributes attributes = new DropDownAttributes\r
- {\r
- HeaderTextAttributes = new TextAttributes\r
- {\r
- PointSize = new FloatSelector { All = 28 },\r
- TextColor = new ColorSelector { All = new Color(0, 0, 0, 1) },\r
- FontFamily = "SamsungOneUI 500C",\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,\r
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,\r
- WidthResizePolicy = ResizePolicyType.FillToParent,\r
- HeightResizePolicy = ResizePolicyType.FillToParent,\r
- HorizontalAlignment = HorizontalAlignment.Begin,\r
- VerticalAlignment = VerticalAlignment.Center,\r
- Position2D = new Position2D(56, 0),\r
- },\r
-\r
- ButtonAttributes = new ButtonAttributes\r
- {\r
- TextAttributes = new TextAttributes\r
- {\r
- PointSize = new FloatSelector { All = 20 },\r
- TextColor = new ColorSelector { All = new Color(0, 0, 0, 1) },\r
- FontFamily = "SamsungOneUI 500",\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,\r
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,\r
- WidthResizePolicy = ResizePolicyType.UseNaturalSize,\r
- HeightResizePolicy = ResizePolicyType.FillToParent,\r
- Position2D = new Position2D(0, 0),\r
- HorizontalAlignment = HorizontalAlignment.Begin,\r
- VerticalAlignment = VerticalAlignment.Center,\r
- },\r
- IconAttributes = new ImageAttributes\r
- {\r
- Size2D = new Size2D(48, 48),\r
- ResourceURL = new StringSelector { All = _image_path },\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.CenterRight,\r
- PivotPoint = Tizen.NUI.PivotPoint.CenterRight,\r
- },\r
- },\r
- ListBackgroundImageAttributes = new ImageAttributes\r
- {\r
- ResourceURL = new StringSelector { All = _image_path },\r
- Border = new RectangleSelector { All = new Rectangle(51, 51, 51, 51) },\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,\r
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,\r
- WidthResizePolicy = ResizePolicyType.FitToChildren,\r
- HeightResizePolicy = ResizePolicyType.FitToChildren,\r
- },\r
- Space = new Vector4(900, 0, 0, 0),\r
- SpaceBetweenButtonTextAndIcon = 8,\r
- ListMargin = new Vector4(0, 20, 20, 0),\r
- BackgroundColor = new ColorSelector { All = new Color(1, 1, 1, 1) },\r
- ListPadding = new Extents(4, 4, 4, 4),\r
- ListRelativeOrientation = DropDown.ListOrientation.Right,\r
- };\r
- return attributes;\r
- }\r
- }\r
- }\r
-}\r
+++ /dev/null
-using NUnit.Framework;\r
-using NUnit.Framework.TUnit;\r
-using System;\r
-using Tizen.NUI;\r
-using Tizen.NUI.UIComponents;\r
-using Tizen.NUI.Components;\r
-using System.Runtime.InteropServices;\r
-using System.Threading.Tasks;\r
-using Tizen.NUI.Components.Test;\r
-\r
-namespace Tizen.NUI.Components.Tests\r
-{\r
- [TestFixture]\r
- [Description("Tizen.NUI.Components.DropDownAttributes Tests")]\r
- public class DropDownAttributesTests\r
- {\r
- private const string TAG = "Components";\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
-\r
- [SetUp]\r
- public void Init()\r
- {\r
- Tizen.Log.Info(TAG, "Init() is called!");\r
- App.MainTitleChangeText("ButtonAttributesTests");\r
- App.MainTitleChangeBackgroundColor(null);\r
-\r
- }\r
-\r
- [TearDown]\r
- public void Destroy()\r
- {\r
- Tizen.Log.Info(TAG, "Destroy() is called!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test DropDownAttributes empty constructor. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.DropDownAttributes C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("COVPARAM", "")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void DropDownAttributes_CHECK_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownAttributes = new DropDownAttributes();\r
- Assert.IsNotNull(dropDownAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<DropDownAttributes>(dropDownAttributes, "Should be equal!");\r
-\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test DropDownAttributes copy constructor. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.DropDownAttributes C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("COVPARAM", "DropDownAttributes")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void DropDownAttributes_DropDownAttributes_CHECK_VALUE()\r
- {\r
- /* TEST CODE */\r
- var attrs = new DropDownAttributes\r
- {\r
- HeaderTextAttributes = new TextAttributes\r
- {\r
- Text = new StringSelector { All = "TitleArea" },\r
- PointSize = new FloatSelector { All = 28 },\r
- TextColor = new ColorSelector { All = new Color(0, 0, 0, 1) },\r
- FontFamily = "SamsungOneUI 500C",\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,\r
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,\r
- WidthResizePolicy = ResizePolicyType.FillToParent,\r
- HeightResizePolicy = ResizePolicyType.FillToParent,\r
- HorizontalAlignment = HorizontalAlignment.Center,\r
- VerticalAlignment = VerticalAlignment.Center,\r
- },\r
-\r
- ButtonAttributes = new ButtonAttributes\r
- {\r
- TextAttributes = new TextAttributes\r
- {\r
- Text = new StringSelector { All = "DropDown Text" },\r
- PointSize = new FloatSelector { All = 20 },\r
- TextColor = new ColorSelector { All = new Color(0, 0, 0, 1) },\r
- FontFamily = "SamsungOneUI 500",\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,\r
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,\r
- WidthResizePolicy = ResizePolicyType.UseNaturalSize,\r
- HeightResizePolicy = ResizePolicyType.FillToParent,\r
- Position2D = new Position2D(0, 0),\r
- HorizontalAlignment = HorizontalAlignment.Begin,\r
- VerticalAlignment = VerticalAlignment.Center,\r
- },\r
- IconAttributes = new ImageAttributes\r
- {\r
- Size2D = new Size2D(48, 48),\r
- ResourceURL = new StringSelector { All = _image_path },\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.CenterRight,\r
- PivotPoint = Tizen.NUI.PivotPoint.CenterRight,\r
- },\r
- },\r
- ListBackgroundImageAttributes = new ImageAttributes\r
- {\r
- ResourceURL = new StringSelector { All = _image_path },\r
- Border = new RectangleSelector { All = new Rectangle(51, 51, 51, 51) },\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,\r
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,\r
- WidthResizePolicy = ResizePolicyType.FitToChildren,\r
- HeightResizePolicy = ResizePolicyType.FitToChildren,\r
- },\r
- Space = new Vector4(56, 0, 0, 0),\r
- SpaceBetweenButtonTextAndIcon = 8,\r
- ListMargin = new Vector4(20, 0, 20, 0),\r
- BackgroundColor = new ColorSelector { All = new Color(1, 1, 1, 1) },\r
- ListSize2D = new Size2D(360, 500),\r
- ListPadding = new Extents(4, 4, 4, 4),\r
- };\r
- var dropDownAttributes = new DropDownAttributes(attrs);\r
- Assert.IsNotNull(dropDownAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<DropDownAttributes>(dropDownAttributes, "Should be equal!");\r
-\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ButtonAttributes. Check whether ButtonAttributes is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.ButtonAttributes A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ButtonAttributes_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownAttributes = new DropDownAttributes();\r
- dropDownAttributes.ButtonAttributes = new ButtonAttributes();\r
- Assert.IsNotNull(dropDownAttributes.ButtonAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<ButtonAttributes>(dropDownAttributes.ButtonAttributes, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test HeaderTextAttributes. Check whether HeaderTextAttributes is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.HeaderTextAttributes A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void HeaderTextAttributes_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownAttributes = new DropDownAttributes();\r
- dropDownAttributes.HeaderTextAttributes = new TextAttributes();\r
- Assert.IsNotNull(dropDownAttributes.HeaderTextAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<TextAttributes>(dropDownAttributes.HeaderTextAttributes, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test SpaceBetweenButtonTextAndIcon. Check whether SpaceBetweenButtonTextAndIcon is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.SpaceBetweenButtonTextAndIcon A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void SpaceBetweenButtonTextAndIcon_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownAttributes = new DropDownAttributes();\r
- dropDownAttributes.SpaceBetweenButtonTextAndIcon = 10;\r
-\r
- Assert.AreEqual(10, dropDownAttributes.SpaceBetweenButtonTextAndIcon, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ListBackgroundImageAttributes. Check whether ListBackgroundImageAttributes is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.ListBackgroundImageAttributes A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ListBackgroundImageAttributes_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownAttributes = new DropDownAttributes();\r
- dropDownAttributes.ListBackgroundImageAttributes = new ImageAttributes();\r
- Assert.IsNotNull(dropDownAttributes.ListBackgroundImageAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<ImageAttributes>(dropDownAttributes.ListBackgroundImageAttributes, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test Space. Check whether Space is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.Space A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void Space_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownAttributes = new DropDownAttributes();\r
- dropDownAttributes.Space = new Vector4(10, 10, 10, 10);\r
-\r
- Assert.AreEqual(10, dropDownAttributes.Space.X, "Should be equals!");\r
- Assert.AreEqual(10, dropDownAttributes.Space.Y, "Should be equals!");\r
- Assert.AreEqual(10, dropDownAttributes.Space.Z, "Should be equals!");\r
- Assert.AreEqual(10, dropDownAttributes.Space.W, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ListRelativeOrientation. Check whether ListRelativeOrientation is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.ListRelativeOrientation A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ListRelativeOrientation_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownAttributes = new DropDownAttributes();\r
- dropDownAttributes.ListRelativeOrientation = DropDown.ListOrientation.Left;\r
- Assert.AreEqual(DropDown.ListOrientation.Left, dropDownAttributes.ListRelativeOrientation, "Should be equals!");\r
-\r
- dropDownAttributes.ListRelativeOrientation = DropDown.ListOrientation.Right;\r
- Assert.AreEqual(DropDown.ListOrientation.Right, dropDownAttributes.ListRelativeOrientation, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ListMargin. Check whether ListMargin is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.ListMargin A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ListMargin_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownAttributes = new DropDownAttributes();\r
- dropDownAttributes.ListMargin = new Vector4(10, 10, 10, 10);\r
-\r
- Assert.AreEqual(10, dropDownAttributes.ListMargin.X, "Should be equals!");\r
- Assert.AreEqual(10, dropDownAttributes.ListMargin.Y, "Should be equals!");\r
- Assert.AreEqual(10, dropDownAttributes.ListMargin.Z, "Should be equals!");\r
- Assert.AreEqual(10, dropDownAttributes.ListMargin.W, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test FocusedItemIndex. Check whether FocusedItemIndex is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.FocusedItemIndex A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void FocusedItemIndex_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownAttributes = new DropDownAttributes();\r
- dropDownAttributes.FocusedItemIndex = 1;\r
-\r
- Assert.AreEqual(1, dropDownAttributes.FocusedItemIndex, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ListSize2D. Check whether ListSize2D is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.ListSize2D A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ListSize2D_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownAttributes = new DropDownAttributes();\r
- dropDownAttributes.ListSize2D = new Size2D(10, 10);\r
-\r
- Assert.AreEqual(10, dropDownAttributes.ListSize2D.Width, "Should be equals!");\r
- Assert.AreEqual(10, dropDownAttributes.ListSize2D.Height, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ListPadding. Check whether ListPadding is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.ListPadding A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ListPadding_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownAttributes = new DropDownAttributes();\r
- dropDownAttributes.ListPadding = new Extents(10, 10, 10, 10);\r
-\r
- Assert.AreEqual(10, dropDownAttributes.ListPadding.Start, "Should be equals!");\r
- Assert.AreEqual(10, dropDownAttributes.ListPadding.End, "Should be equals!");\r
- Assert.AreEqual(10, dropDownAttributes.ListPadding.Top, "Should be equals!");\r
- Assert.AreEqual(10, dropDownAttributes.ListPadding.Bottom, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test Clone. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownAttributes.Clone M")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "MR")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void Clone_CHECK_VALUE()\r
- {\r
- var dropDownAttributes = new DropDownAttributes();\r
- dropDownAttributes.SpaceBetweenButtonTextAndIcon = 10;\r
- var attr = dropDownAttributes.Clone() as DropDownAttributes;\r
- Assert.IsNotNull(attr, "Should be not null!");\r
- Assert.IsInstanceOf<DropDownAttributes>(attr, "Should be equals!");\r
- Assert.AreEqual(10, attr.SpaceBetweenButtonTextAndIcon, "Should be equal!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test DropDownItemAttributes empty constructor. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownItemAttributes.DropDownItemAttributes C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("COVPARAM", "")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void DropDownItemAttributes_CHECK_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownItemAttributes = new DropDownItemAttributes();\r
- Assert.IsNotNull(dropDownItemAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<DropDownItemAttributes>(dropDownItemAttributes, "Should be equal!");\r
-\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test DropDownItemAttributes copy constructor. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownItemAttributes.DropDownItemAttributes C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("COVPARAM", "DropDownItemAttributes")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void DropDownItemAttributes_DropDownItemAttributes_CHECK_VALUE()\r
- {\r
- /* TEST CODE */\r
- var itemAttrs = new DropDownItemAttributes\r
- {\r
- BackgroundColor = new ColorSelector\r
- {\r
- Pressed = new Color(0, 0, 0, 0.4f),\r
- Other = new Color(1, 1, 1, 0),\r
- },\r
- TextAttributes = new TextAttributes\r
- {\r
- PointSize = new FloatSelector { All = 18 },\r
- FontFamily = "SamsungOne 500",\r
- Position2D = new Position2D(28, 0),\r
- },\r
- CheckImageAttributes = new ImageAttributes\r
- {\r
- Size2D = new Size2D(40, 40),\r
- ResourceURL = new StringSelector { All = _image_path },\r
- },\r
- CheckImageRightSpace = 16,\r
- };\r
- var dropDownItemAttributes = new DropDownItemAttributes(itemAttrs);\r
- Assert.IsNotNull(dropDownItemAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<DropDownItemAttributes>(dropDownItemAttributes, "Should be equal!");\r
-\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test TextAttributes. Check whether TextAttributes is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownItemAttributes.TextAttributes A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void TextAttributes_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownItemAttributes = new DropDownItemAttributes();\r
- dropDownItemAttributes.TextAttributes = new TextAttributes();\r
- Assert.IsNotNull(dropDownItemAttributes.TextAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<TextAttributes>(dropDownItemAttributes.TextAttributes, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test IconAttributes. Check whether IconAttributes is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownItemAttributes.IconAttributes A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void IconAttributes_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownItemAttributes = new DropDownItemAttributes();\r
- dropDownItemAttributes.IconAttributes = new ImageAttributes();\r
- Assert.IsNotNull(dropDownItemAttributes.IconAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<ImageAttributes>(dropDownItemAttributes.IconAttributes, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckImageAttributes. Check whether CheckImageAttributes is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownItemAttributes.CheckImageAttributes A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckImageAttributes_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownItemAttributes = new DropDownItemAttributes();\r
- dropDownItemAttributes.CheckImageAttributes = new ImageAttributes();\r
- Assert.IsNotNull(dropDownItemAttributes.CheckImageAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<ImageAttributes>(dropDownItemAttributes.CheckImageAttributes, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckImageRightSpace. Check whether CheckImageRightSpace is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownItemAttributes.CheckImageRightSpace A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckImageRightSpace_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownItemAttributes = new DropDownItemAttributes();\r
- dropDownItemAttributes.CheckImageRightSpace = 10;\r
-\r
- Assert.AreEqual(10, dropDownItemAttributes.CheckImageRightSpace, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test IsSelected. Check whether IsSelected is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownItemAttributes.IsSelected A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void IsSelected_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var dropDownItemAttributes = new DropDownItemAttributes();\r
- dropDownItemAttributes.IsSelected = true;\r
- Assert.AreEqual(true, dropDownItemAttributes.IsSelected, "Should be equals!");\r
- dropDownItemAttributes.IsSelected = false;\r
- Assert.AreEqual(false, dropDownItemAttributes.IsSelected, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test Clone. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.DropDownItemAttributes.Clone M")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "MR")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void DropDownItemAttributes_Clone_CHECK_VALUE()\r
- {\r
-\r
- var dropDownItemAttributes = new DropDownItemAttributes();\r
- var attr = dropDownItemAttributes.Clone();\r
- Assert.IsNotNull(attr, "Should be not null!");\r
- Assert.IsInstanceOf<DropDownItemAttributes>(attr, "Should be equals!");\r
-\r
- }\r
-\r
- }\r
-}\r
+++ /dev/null
-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\r
-{\r
- [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);\r
-\r
- CreateFlexiableView();
-
- }
-
- public void CreateFlexiableView()\r
- {\r
- _flexibleView = new FlexibleView();\r
- _flexibleView.Name = "RecyclerView";\r
- _flexibleView.Position2D = new Position2D(500, 200);\r
- _flexibleView.Size2D = new Size2D(400, 450);\r
- _flexibleView.Padding = new Extents(10, 10, 10, 10);\r
- _flexibleView.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.4f);\r
- _flexibleView.Focusable = true;\r
-\r
- List<ListItemData> dataList = new List<ListItemData>();\r
- for (int i = 0; i < 132; ++i)\r
- {\r
- dataList.Add(new ListItemData(i));\r
- }\r
- _adapter = new ListBridge(dataList);\r
- _flexibleView.SetAdapter(_adapter);\r
- _layoutManager = new LinearLayoutManager(LinearLayoutManager.VERTICAL);\r
- _flexibleView.SetLayoutManager(_layoutManager);\r
-\r
- Window.Instance.Add(_flexibleView);\r
- FocusManager.Instance.SetCurrentFocusView(_flexibleView);\r
- _flexibleView.FocusedItemIndex = 0;\r
- }
-
- [TearDown]
- public void Destroy()
- {
- Tizen.Log.Info(TAG, "Destroy() is called!");
- Window.Instance.Remove(_flexibleView);
- _flexibleView.Dispose();
- _flexibleView = null;
- }\r
-
- [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<FlexibleView>(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)\r
- {\r
- Assert.AreEqual(1, _flexibleView.FocusedItemIndex, "Should be equals to the set value of FocusedItemIndex.");\r
- }
-
- [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();\r
- scrollBar1.Direction = ScrollBar.DirectionType.Vertical;\r
- scrollBar1.Position2D = new Position2D(394, 2);\r
- scrollBar1.Size2D = new Size2D(4, 446);\r
- scrollBar1.TrackColor = Color.Green;\r
- scrollBar1.ThumbSize = new Size2D(4, 30);\r
- scrollBar1.ThumbColor = Color.Yellow;\r
- scrollBar1.TrackImageURL = _trackImageUrl;
- try\r
- {\r
- _flexibleView.AttachScrollBar(scrollBar1);\r
- }
- 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\r
- {\r
- _flexibleView.DetachScrollBar();\r
- }
- 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\r
- {\r
- for (int i = 0; i < 20; i++)\r
- {\r
- _flexibleView.MoveFocus(FlexibleView.LayoutManager.Direction.Down);\r
- }\r
- _flexibleView.Relayout += FindViewHolderForAdapterPositionRelayout;\r
- _flexibleView.Relayout -= FindViewHolderForAdapterPositionRelayout;\r
- }
- catch (Exception e)
- {
- Assert.Fail("Caught Exception" + e.ToString());
- }
- }
-
- private void FindViewHolderForAdapterPositionRelayout(object sender, EventArgs args)\r
- {\r
- var viewHolder = _flexibleView.FindViewHolderForAdapterPosition(0);\r
- Assert.IsNotNull(viewHolder, "Can't get the viewHolder!");\r
- Assert.IsInstanceOf<FlexibleView.ViewHolder>(viewHolder, "Should be instance of FlexibleView.ViewHolder");\r
- }
-
- [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\r
- {\r
- for (int i = 0; i < 20; i++)\r
- {\r
- _flexibleView.MoveFocus(FlexibleView.LayoutManager.Direction.Down);\r
- }\r
- _flexibleView.Relayout += FindViewHolderForLayoutPositionRelayout;\r
- _flexibleView.Relayout -= FindViewHolderForLayoutPositionRelayout;\r
- }
- catch (Exception e)
- {
- Assert.Fail("Caught Exception" + e.ToString());
- }
- }
-
- private void FindViewHolderForLayoutPositionRelayout(object sender, EventArgs args)\r
- {\r
- var viewHolder = _flexibleView.FindViewHolderForLayoutPosition(0);\r
- Assert.IsNotNull(viewHolder, "Can't get the viewHolder!");\r
- Assert.IsInstanceOf<FlexibleView.ViewHolder>(viewHolder, "Should be instance of FlexibleView.ViewHolder");\r
- }
-
- [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\r
- {\r
- var adapter = _flexibleView.GetAdapter();\r
- Assert.IsNotNull(adapter, "Can't get the adapter!");\r
- Assert.IsInstanceOf<FlexibleView.Adapter>(adapter, "Should be instance of FlexibleView.Adapter");\r
- }
- 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\r
- {\r
- var recycler = _flexibleView.GetRecycler();\r
- Assert.IsNotNull(recycler, "Can't get the recycler!");\r
- Assert.IsInstanceOf<FlexibleView.Recycler>(recycler, "Should be instance of FlexibleView.Recycler");\r
- }
- 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\r
- {\r
- var layoutManager = _flexibleView.GetLayoutManager();\r
- Assert.IsNotNull(layoutManager, "Can't get the layoutManager!");\r
- Assert.IsInstanceOf<FlexibleView.LayoutManager>(layoutManager, "Should be instance of LayoutManager.Adapter");\r
- }
- 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\r
- {\r
- _flexibleView.MoveFocus(FlexibleView.LayoutManager.Direction.Down);\r
- _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\r
- {\r
- _flexibleView.ScrollToPositionWithOffset(2, 0);\r
- }
- 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\r
- {\r
- _flexibleView.SetAdapter(_adapter);\r
- }
- 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\r
- {\r
- var hLayoutManager = new LinearLayoutManager(LinearLayoutManager.HORIZONTAL);\r
- _flexibleView.SetLayoutManager(hLayoutManager);\r
- var vLayoutManager = new LinearLayoutManager(LinearLayoutManager.VERTICAL);\r
- _flexibleView.SetLayoutManager(vLayoutManager);\r
- }
- 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\r
- {\r
- var myFlexibleView = new MyFlexibleView();\r
- var attr = myFlexibleView.TestGetAttributes();\r
- Assert.IsNull(attr, "Should be null, because there is no attributes for FlexibleView!");\r
- }
- 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\r
- {\r
- _flexibleView.OnStyleChange(NUI.StyleManager.Instance, StyleChangeType.ThemeChange);\r
- }
- 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\r
- {\r
- _flexibleView.StyleChanged += StyleChange;\r
- _flexibleView.OnStyleChange(NUI.StyleManager.Instance, StyleChangeType.DefaultFontSizeChange);\r
- await Task.Delay(500);\r
- Assert.IsTrue(_styleChanged, "Should be true!");\r
- _flexibleView.StyleChanged -= StyleChange;\r
- }
- 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);\r
- 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)\r
- {\r
- _styleChanged = true;\r
- }
- }
-
- public class ListItemData\r
- {\r
- private string _str;\r
-\r
- public ListItemData(int i)\r
- {\r
- _str = "Text" + i.ToString();\r
- }\r
-\r
- public string TextString\r
- {\r
- get\r
- {\r
- return _str;\r
- }\r
- }\r
- }
-
- public class ListItemView : View\r
- {\r
- private TextLabel _mText;\r
-\r
- public ListItemView()\r
- {\r
- _mText = new TextLabel();\r
- _mText.WidthResizePolicy = ResizePolicyType.FillToParent;\r
- _mText.HeightResizePolicy = ResizePolicyType.FillToParent;\r
- _mText.PointSize = 22;\r
- _mText.HorizontalAlignment = HorizontalAlignment.Center;\r
- _mText.VerticalAlignment = VerticalAlignment.Center;\r
- Add(_mText);\r
- }\r
-\r
- public string MainText\r
- {\r
- get\r
- {\r
- return _mText.Text;\r
- }\r
- set\r
- {\r
- _mText.Text = value;\r
- }\r
- }\r
- }\r
-\r
- public class MyFlexibleView : FlexibleView\r
- {\r
- public bool _relayoutFlag = false;\r
-\r
- protected override Attributes GetAttributes()\r
- {\r
- return base.GetAttributes();\r
- }\r
-\r
- public Attributes TestGetAttributes()\r
- {\r
- return GetAttributes();\r
- }\r
-\r
- public override void OnRelayout(Vector2 size, RelayoutContainer container)
- {
- _relayoutFlag = true;
- base.OnRelayout(size, container);
- }\r
- }\r
-\r
- public class ListBridge : FlexibleView.Adapter\r
- {\r
- private List<ListItemData> _mDatas;\r
-\r
- public ListBridge(List<ListItemData> datas)\r
- {\r
- _mDatas = datas;\r
- }\r
-\r
- public void InsertData(int position)\r
- {\r
- _mDatas.Insert(position, new ListItemData(1000 + position));\r
- NotifyItemInserted(position);\r
- }\r
-\r
- public void RemoveData(int position)\r
- {\r
- _mDatas.RemoveAt(position);\r
- NotifyItemRemoved(position);\r
- }\r
-\r
- public override int GetItemViewType(int position)\r
- {\r
- return 1;\r
- }\r
-\r
- public override FlexibleView.ViewHolder OnCreateViewHolder(int viewType)\r
- {\r
- FlexibleView.ViewHolder viewHolder = new FlexibleView.ViewHolder(new ListItemView());\r
- //Console.WriteLine($"OnCreateViewHolder... viewType: {viewType} viewID: {viewHolder.ItemView.ID}");\r
-\r
- return viewHolder;\r
- }\r
-\r
- public override void OnAttachedToRecyclerView(FlexibleView flexibleView)\r
- {\r
-\r
- }\r
- public override void OnBindViewHolder(FlexibleView.ViewHolder holder, int position)\r
- {\r
- //Console.WriteLine($"OnBindItemView... position: {position}");\r
- ListItemData listItemData = _mDatas[position];\r
-\r
- ListItemView listItemView = holder.ItemView as ListItemView;\r
- listItemView.Name = "Item" + position;\r
- //Random rd = new Random();\r
- listItemView.SizeWidth = 150;\r
- listItemView.SizeHeight = 60;\r
- if (listItemView != null)\r
- {\r
- listItemView.MainText = String.Format("{0:D2}", position) + " : " + listItemData.TextString;\r
- }\r
- listItemView.Margin = new Extents(2, 2, 2, 2);\r
- if (position % 2 == 0)\r
- listItemView.BackgroundColor = Color.Cyan;\r
- else\r
- listItemView.BackgroundColor = Color.Yellow;\r
- }\r
-\r
- public override void OnDestroyViewHolder(FlexibleView.ViewHolder holder)\r
- {\r
- //Console.WriteLine($"OnDestroyViewHolder... viewID: {holder.ItemView?.ID}");\r
- if (holder.ItemView != null)\r
- {\r
- holder.ItemView.Dispose();\r
- }\r
- }\r
-\r
- public override void OnDetachedFromRecyclerView(FlexibleView flexibleView)\r
- {\r
-\r
- }\r
-\r
- public override int GetItemCount()\r
- {\r
- return _mDatas.Count;\r
- }\r
-\r
- public override void OnFocusChange(FlexibleView flexibleView, int previousFocus, int currentFocus)\r
- {\r
- FlexibleView.ViewHolder previousFocusView = flexibleView.FindViewHolderForAdapterPosition(previousFocus);\r
- if (previousFocusView != null)\r
- {\r
- //Console.WriteLine($"previousFocus {previousFocus.AdapterPosition}");\r
- if (previousFocusView.AdapterPosition % 2 == 0)\r
- previousFocusView.ItemView.BackgroundColor = Color.Cyan;\r
- else\r
- previousFocusView.ItemView.BackgroundColor = Color.Yellow;\r
- //previousFocus.SizeWidth = 150;\r
- //previousFocus.SizeHeight = 60;\r
- //NotifyItemChanged(previousFocus.AdapterPosition);\r
- }\r
- FlexibleView.ViewHolder currentFocusView = flexibleView.FindViewHolderForAdapterPosition(currentFocus);\r
- if (currentFocusView != null)\r
- {\r
- //Console.WriteLine($"currentFocus {currentFocus.AdapterPosition}");\r
- currentFocusView.ItemView.BackgroundColor = Color.Magenta;\r
- //currentFocus.SizeWidth = 200;\r
- //currentFocus.SizeHeight = 100;\r
- //NotifyItemChanged(currentFocus.AdapterPosition);\r
- }\r
- }\r
-\r
- public override void OnViewAttachedToWindow(FlexibleView.ViewHolder holder)\r
- {\r
- //Console.WriteLine($"+Attached: {holder.AdapterPosition}");\r
- }\r
-\r
- public override void OnViewDetachedFromWindow(FlexibleView.ViewHolder holder)\r
- {\r
- //Console.WriteLine($" --Detached: {holder.AdapterPosition}");\r
- }\r
-\r
- public override void OnViewRecycled(FlexibleView.ViewHolder holder)\r
- {\r
-\r
- }\r
-\r
- }
-}
+++ /dev/null
-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<ListItemData> dataList = new List<ListItemData>();
- 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<ListItemData> dataList = new List<ListItemData>();
- 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<FlexibleView.Adapter>(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<FlexibleView.ViewHolder>(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());
- }
- }
- }
-}
+++ /dev/null
-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<Components.FlexibleView.ItemClickEventArgs>(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<FlexibleView.ViewHolder>(itemClickEventArgs.ClickedView, "Should be an instance of itemClickEventArgs.ClickedView");
- }
- }
-}
+++ /dev/null
-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<Components.FlexibleView.ItemTouchEventArgs>(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<FlexibleView.ViewHolder>(itemTouchEventArgs.TouchedView, "Should be an instance of ItemTouchEventArgs.ClickedView");
- }
- }
-}
+++ /dev/null
-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<ListItemData> dataList = new List<ListItemData>();
- 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<LinearLayoutManager>(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<FlexibleView.ViewHolder>(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<FlexibleView.ViewHolder>(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;
- }
- }
-}
+++ /dev/null
-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<ListItemData> dataList = new List<ListItemData>();
- 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<FlexibleView.Recycler>(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<FlexibleView.ViewHolder>(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<FlexibleView.ViewHolder>(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());
- }
- }
- }
-}
+++ /dev/null
-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<ListItemData> dataList = new List<ListItemData>();
- 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<FlexibleView.ViewHolder>(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<FlexibleView.ViewHolder>(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.");
- }
- }
-}
+++ /dev/null
-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>(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);
- }
- }
-}
+++ /dev/null
-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<GridLayoutManager>(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;
- }
- }
-}
+++ /dev/null
-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>(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>(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<ImageAttributes>(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());
- }
- }
- }
-}
+++ /dev/null
-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>(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>(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>(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>(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>(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>(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;
- }
- }
-}
+++ /dev/null
-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>(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<InputFieldAttributes>(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");
- }
- }
-}
+++ /dev/null
-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>(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);
- }
- }
-}
+++ /dev/null
-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<ListItemData> dataList = new List<ListItemData>();
- 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<LinearLayoutManager>(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;
- }
- }
-}
Assert.IsInstanceOf<Loading>(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>(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>(loading, "Should be an instance of Loading type.");
- }
-
[Test]
[Category("P1")]
[Description("Test ImageArray. Check whether ImageArray works or not.")]
try
{
var loading = new Loading();
+ Assert.IsNotNull(loading, "Can't create success object Loading");
Assert.IsInstanceOf<Loading>(loading, "Should be an instance of Loading type");
loading.ImageArray = new string[] {"aaa", "bbb"};
string[] imageArray = loading.ImageArray;
[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>(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>(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]
try
{
Loading loading = new Loading();
+ Assert.IsNotNull(loading, "Can't create success object Loading");
+ Assert.IsInstanceOf<Loading>(loading, "Should be an instance of Loading type");
loading.Dispose();
}
catch (Exception e)
}
}
- 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;
- }
- }
}
+++ /dev/null
-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>(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<LoadingAttributes>(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");
- }
- }
-}
+++ /dev/null
-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\r
-{\r
- [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";\r
- private bool _styleRegiesterFlag = false;
-
- [SetUp]
- public void Init()
- {
- Tizen.Log.Info(TAG, "Init() is called!");
- App.MainTitleChangeText("PaginationTests");
- App.MainTitleChangeBackgroundColor(null);
- if (!_styleRegiesterFlag)\r
- {\r
- StyleManager.Instance.RegisterStyle("DefaultPagination", null, typeof(Tizen.NUI.Components.Tests.DefaultPaginationStyle));\r
- _styleRegiesterFlag = true;\r
- }
- }
-
- [TearDown]
- public void Destroy()
- {
- Tizen.Log.Info(TAG, "Destroy() is called!");
- }\r
-
- [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>(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>(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>(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()
- {\r
- /* TEST CODE */\r
- 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.");\r
- }
-
- [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();\r
- Assert.IsNotNull(myPagination.TestGetAttributes(), "Should be not null");\r
- Assert.IsInstanceOf<PaginationAttributes>(myPagination.TestGetAttributes(), "Should be an instance of PaginationAttributes");\r
- }
-
- [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\r
- {\r
- URL = _indicatorBackgroundURL,\r
- Size = new Size2D(36, 36)\r
- };\r
- indicator.Position = new Position2D(0, 0);\r
- 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\r
- {\r
- URL = _indicatorBackgroundURL,\r
- Size = new Size2D(36, 36)\r
- };\r
- indicator.Position = new Position2D(0, 0);\r
- 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()\r
- {\r
- PaginationAttributes attrs = new PaginationAttributes();
- attrs.IndicatorSize = new Size2D(15, 15);
- attrs.IndicatorBackgroundURL = _indicatorBackgroundURL;
- attrs.IndicatorSelectURL = _indicatorSelectURL;
- attrs.IndicatorSpacing = 14;
-\r
- MyPagination pagination = new MyPagination(attrs);\r
- 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);\r
- return pagination;\r
- }
- }
-
- public class MyPagination:Pagination\r
- {\r
- public bool updateFlag = false;\r
-\r
- public MyPagination():base()\r
- {\r
-\r
- }\r
- public MyPagination(PaginationAttributes attributes):base(attributes)\r
- {\r
-\r
- }\r
-\r
- public Attributes TestGetAttributes()\r
- {\r
- return GetAttributes();\r
- }\r
- protected override Attributes GetAttributes()\r
- {\r
- return base.GetAttributes();\r
- }\r
-\r
- protected override void OnUpdate()\r
- {\r
- updateFlag = true;\r
- base.OnUpdate();\r
- }\r
-\r
- protected override void SelectIn(VisualMap selectInIndicator)\r
- {\r
- base.SelectIn(selectInIndicator);\r
- }\r
-\r
- protected override void SelectOut(VisualMap selectOutIndicator)\r
- {\r
- base.SelectIn(selectOutIndicator);\r
- }\r
-\r
- public void TestSelectIn(VisualMap selectInIndicator)\r
- {\r
- SelectIn(selectInIndicator);\r
- }\r
-\r
- public void TestSelectOut(VisualMap selectOutIndicator)\r
- {\r
- SelectOut(selectOutIndicator);\r
- }\r
- }
-
- public class DefaultPaginationStyle : StyleBase
- {
- private string _indicatorBackgroundURL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "pagination_ic_nor.png";\r
- private string _indicatorSelectURL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "pagination_ic_sel.png";\r
- 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;
- }
- }
-}
+++ /dev/null
-using NUnit.Framework;\r
-using NUnit.Framework.TUnit;\r
-using System;\r
-using Tizen.NUI;\r
-using Tizen.NUI.BaseComponents;\r
-using Tizen.NUI.Components;\r
-using Tizen.NUI.Components.Test;\r
-using System.Threading.Tasks;\r
-\r
-namespace Tizen.NUI.Components.Tests\r
-{\r
- [TestFixture]\r
- [Description("Tizen.NUI.Components.PaginationAttributes Tests")]\r
- public class PaginationAttributesTests\r
- {\r
- private const string TAG = "NUI.Components";\r
- private string _imagePath = "";\r
-\r
- [SetUp]\r
- public void Init()\r
- {\r
- Tizen.Log.Info(TAG, "Init() is called!");\r
- App.MainTitleChangeText("PaginationAttributesTests");\r
- App.MainTitleChangeBackgroundColor(null);\r
- }\r
-\r
- [TearDown]\r
- public void Destroy()\r
- {\r
- Tizen.Log.Info(TAG, "Destroy() is called!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Create a PaginationAttributes object. Check whether object is successfully created or not.")]\r
- [Property("SPEC", "Tizen.NUI.Components.PaginationAttributes.PaginationAttributes C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("COVPARAM", "")]\r
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]\r
- public void PaginationAttributes_INIT()\r
- {\r
- /* TEST CODE */\r
- var paginationAttributes = new PaginationAttributes();\r
- Assert.IsNotNull(paginationAttributes, "Can't create success object PaginationAttributes");\r
- Assert.IsInstanceOf<PaginationAttributes>(paginationAttributes, "Should be an instance of PaginationAttributes type.");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Create a PaginationAttributes object. Check whether object is successfully created or not.")]\r
- [Property("SPEC", "Tizen.NUI.Components.PaginationAttributes.PaginationAttributes C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("COVPARAM", "PaginationAttributes")]\r
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]\r
- public void PaginationAttributes_INIT_WITH_PAGINATIONATTRIBUTES()\r
- {\r
- /* TEST CODE */\r
- var paginationAttributes1 = new PaginationAttributes();\r
- var paginationAttributes = new PaginationAttributes(paginationAttributes1);\r
- Assert.IsNotNull(paginationAttributes, "Can't create success object PaginationAttributes");\r
- Assert.IsInstanceOf<PaginationAttributes>(paginationAttributes, "Should be an instance of PaginationAttributes type.");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test IndicatorBackgroundURL.Check whether IndicatorBackgroundURL is readable ahd writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.PaginationAttributes.IndicatorBackgroundURL A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]\r
- public void IndicatorBackgroundURL_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var paginationAttributes = new PaginationAttributes();\r
- paginationAttributes.IndicatorBackgroundURL = _imagePath;\r
- Assert.AreEqual(_imagePath, paginationAttributes.IndicatorBackgroundURL, "Should be equal!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test IndicatorSelectURL.Check whether IndicatorSelectURL is readable ahd writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.PaginationAttributes.IndicatorSelectURL A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]\r
- public void IndicatorSelectURL_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var paginationAttributes = new PaginationAttributes();\r
- paginationAttributes.IndicatorSelectURL = _imagePath;\r
- Assert.AreEqual(_imagePath, paginationAttributes.IndicatorSelectURL, "Should be equal!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test IndicatorSpacing.Check whether IndicatorSpacing is readable ahd writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.PaginationAttributes.IndicatorSpacing A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]\r
- public void IndicatorSpacing_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var paginationAttributes = new PaginationAttributes();\r
- paginationAttributes.IndicatorSpacing = 10;\r
- Assert.AreEqual(10, paginationAttributes.IndicatorSpacing, "Should be equal!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test IndicatorSize.Check whether IndicatorSize is readable ahd writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.PaginationAttributes.IndicatorSize A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]\r
- public void IndicatorSize_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var paginationAttributes = new PaginationAttributes();\r
- paginationAttributes.IndicatorSize = new Size2D(32, 32);\r
- Assert.AreEqual(32, paginationAttributes.IndicatorSize.Width, "Should be equal!");\r
- Assert.AreEqual(32, paginationAttributes.IndicatorSize.Height, "Should be equal!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test Clone. Check Whether Clone works or not")]\r
- [Property("SPEC", "Tizen.NUI.Components.PaginationAttributes.Clone M")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "MR")]\r
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]\r
- public void Clone_TEST()\r
- {\r
- /* TEST CODE */\r
- try\r
- {\r
- var paginationAttributes = new PaginationAttributes();\r
- paginationAttributes.IndicatorSpacing = 10;\r
- var attributes = paginationAttributes.Clone() as PaginationAttributes;\r
- Assert.IsNotNull(attributes, "Should be not null");\r
- Assert.IsInstanceOf<PaginationAttributes>(attributes, "Should be an instance of PaginationAttributes type.");\r
- Assert.AreEqual(10, attributes.IndicatorSpacing, "Should be equal!");\r
- }\r
- catch (Exception e)\r
- {\r
- Assert.Fail("Caught Exception" + e.ToString());\r
- }\r
- }\r
- }\r
-}\r
{\r
/* TEST CODE */\r
var buttonClickEventArgs = new Components.Popup.ButtonClickEventArgs();\r
+ Assert.IsNotNull(buttonClickEventArgs, "Should be not null!");\r
+ Assert.IsInstanceOf<Components.Popup.ButtonClickEventArgs>(buttonClickEventArgs, "Should be equal!");\r
+\r
buttonClickEventArgs.ButtonIndex = 0;\r
Assert.AreEqual(0, buttonClickEventArgs.ButtonIndex, "Should be equal");\r
}\r
\r
[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<Components.Popup>(popup, "Should be equal!");\r
- }\r
-\r
- [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()
- {\r
- /* TEST CODE */\r
- var attrs = new PopupAttributes\r
- {\r
- MinimumSize = new Size2D(1032, 184),\r
- ShadowOffset = new Vector4(24, 24, 24, 24),\r
- TitleTextAttributes = new TextAttributes\r
- {\r
- PointSize = new FloatSelector { All = 25 },\r
- TextColor = new ColorSelector { All = Color.Black },\r
- Size2D = new Size2D(0, 68),\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,\r
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,\r
- HorizontalAlignment = HorizontalAlignment.Begin,\r
- VerticalAlignment = VerticalAlignment.Bottom,\r
- Position2D = new Position2D(64, 52),\r
- Text = new StringSelector { All = "Popup Title" },\r
- },\r
- BackgroundImageAttributes = new ImageAttributes\r
- {\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,\r
- PivotPoint = Tizen.NUI.PivotPoint.Center,\r
- WidthResizePolicy = ResizePolicyType.FillToParent,\r
- HeightResizePolicy = ResizePolicyType.FillToParent,\r
- ResourceURL = new StringSelector { All = _image_path },\r
- Border = new RectangleSelector { All = new Rectangle(0, 0, 81, 81) },\r
- },\r
- ButtonAttributes = new ButtonAttributes\r
- {\r
- Size2D = new Size2D(0, 132),\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,\r
- PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,\r
- BackgroundImageAttributes = new ImageAttributes\r
- {\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,\r
- PivotPoint = Tizen.NUI.PivotPoint.Center,\r
- WidthResizePolicy = ResizePolicyType.FillToParent,\r
- HeightResizePolicy = ResizePolicyType.FillToParent,\r
- ResourceURL = new StringSelector { All = _image_path },\r
- Border = new RectangleSelector { All = new Rectangle(5, 5, 5, 5) },\r
- },\r
- OverlayImageAttributes = new ImageAttributes\r
- {\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,\r
- PivotPoint = Tizen.NUI.PivotPoint.Center,\r
- WidthResizePolicy = ResizePolicyType.FillToParent,\r
- HeightResizePolicy = ResizePolicyType.FillToParent,\r
- BackgroundColor = new ColorSelector\r
- {\r
- Normal = new Color(1.0f, 1.0f, 1.0f, 1.0f),\r
- Pressed = new Color(0.0f, 0.0f, 0.0f, 0.1f),\r
- Selected = new Color(1.0f, 1.0f, 1.0f, 1.0f),\r
- },\r
- },\r
- TextAttributes = new TextAttributes\r
- {\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,\r
- PivotPoint = Tizen.NUI.PivotPoint.Center,\r
- HorizontalAlignment = HorizontalAlignment.Center,\r
- VerticalAlignment = VerticalAlignment.Center,\r
- TextColor = new ColorSelector { All = Color.Cyan },\r
- },\r
- },\r
- };
- var popup = new Components.Popup(attrs);
- Assert.IsNotNull(popup, "Should be not Null!");
- Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
[Description("Test TitleText. Check whether TitleText is readable and writable.")]\r
[Property("SPEC", "Tizen.NUI.Components.Popup.TitleText A")]\r
[Property("SPEC_URL", "-")]\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
+ Assert.IsNotNull(popup, "Should be not Null!");
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
+
popup.TitleText = "Test TitleText";\r
Assert.AreEqual("Test TitleText", popup.TitleText, "Should be equals to the set value of TitleText");\r
}\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
+ Assert.IsNotNull(popup, "Should be not Null!");
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
+
popup.ButtonCount = 2;\r
Assert.AreEqual(2, popup.ButtonCount, "Should be equals to the set value of ButtonCount");\r
}\r
Assert.IsInstanceOf<BaseComponents.View>(popup.ContentView, "Should be an instance of view!");\r
}\r
\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ShadowImageURL. Check whether ShadowImageURL is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Popup.ShadowImageURL A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ShadowImageURL_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var popup = new Components.Popup();\r
- popup.ShadowImageURL = _image_path;\r
- Assert.AreEqual(_image_path, popup.ShadowImageURL, "Should be equals to the set value of ShadowImageURL");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ShadowImageBorder. Check whether ShadowImageBorder is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Popup.ShadowImageBorder A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ShadowImageBorder_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var popup = new Components.Popup();\r
- popup.ShadowImageBorder = new Rectangle(0, 0, 10, 10);\r
- Assert.AreEqual(0, popup.ShadowImageBorder.X, "Retrieved ShadowImageBorder should be equal to set value");\r
- Assert.AreEqual(0, popup.ShadowImageBorder.Y, "Retrieved ShadowImageBorder should be equal to set value");\r
- Assert.AreEqual(10, popup.ShadowImageBorder.Width, "Retrieved ShadowImageBorder should be equal to set value");\r
- Assert.AreEqual(10, popup.ShadowImageBorder.Height, "Retrieved ShadowImageBorder should be equal to set value");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test BackgroundImageURL. Check whether BackgroundImageURL is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Popup.BackgroundImageURL A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void BackgroundImageURL_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var popup = new Components.Popup();\r
- popup.BackgroundImageURL = _image_path;\r
- Assert.AreEqual(_image_path, popup.BackgroundImageURL, "Should be equals to the set value of BackgroundImageURL");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test BackgroundImageBorder. Check whether BackgroundImageBorder is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Popup.BackgroundImageBorder A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void BackgroundImageBorder_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var popup = new Components.Popup();\r
- popup.BackgroundImageBorder = new Rectangle(0, 0, 10, 10);\r
- Assert.AreEqual(0, popup.BackgroundImageBorder.X, "Retrieved BackgroundImageBorder should be equal to set value");\r
- Assert.AreEqual(0, popup.BackgroundImageBorder.Y, "Retrieved BackgroundImageBorder should be equal to set value");\r
- Assert.AreEqual(10, popup.BackgroundImageBorder.Width, "Retrieved BackgroundImageBorder should be equal to set value");\r
- Assert.AreEqual(10, popup.BackgroundImageBorder.Height, "Retrieved BackgroundImageBorder should be equal to set value");\r
- }\r
-\r
[Test]\r
[Category("P1")]\r
[Description("Test TitlePointSize. Check whether TitlePointSize is readable and writable.")]\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
+ Assert.IsNotNull(popup, "Should be not Null!");
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
+
popup.TitlePointSize = 10.0f;\r
Assert.AreEqual(10.0f, popup.TitlePointSize, "Should be equals to the set value of TitlePointSize");\r
}\r
\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test TitleFontFamily. Check whether TitleFontFamily is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Popup.TitleFontFamily A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void TitleFontFamily_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var popup = new Components.Popup();\r
- popup.TitleFontFamily = "SamsungOne 500";\r
- Assert.AreEqual("SamsungOne 500", popup.TitleFontFamily, "Should be equals to the set value of TitleFontFamily");\r
- }\r
-\r
[Test]\r
[Category("P1")]\r
[Description("Test TitleTextColor. Check whether TitleTextColor is readable and writable.")]\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
+ Assert.IsNotNull(popup, "Should be not Null!");
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
+
var color = new Color(1.0f, 0.0f, 0.0f, 1.0f);\r
+ Assert.IsNotNull(color, "Should be not Null!");
+ Assert.IsInstanceOf<Color>(color, "Should be equal!");
popup.TitleTextColor = color;\r
\r
Assert.AreEqual(color.R, popup.TitleTextColor.R, "Should be equals to the color.R set");
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
+ Assert.IsNotNull(popup, "Should be not Null!");
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
+
popup.TitleTextHorizontalAlignment = HorizontalAlignment.Begin;\r
Assert.AreEqual(HorizontalAlignment.Begin, popup.TitleTextHorizontalAlignment, "Should be equals to the set value of TitleTextHorizontalAlignment");\r
}\r
\r
[Test]\r
[Category("P1")]\r
- [Description("Test TitleTextPosition2D. Check whether TitleTextPosition2D is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Popup.TitleTextPosition2D A")]\r
+ [Description("Test TitleTextPosition. Check whether TitleTextPosition is readable and writable.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Popup.TitleTextPosition A")]\r
[Property("SPEC_URL", "-")]\r
[Property("CRITERIA", "PRW")]
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void TitleTextPosition2D_SET_GET_VALUE()\r
+ public void TitleTextPosition_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
- popup.TitleTextPosition2D = new Position2D(10, 10);\r
+ Assert.IsNotNull(popup, "Should be not Null!");
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
+
+ popup.TitleTextPosition = new Position(10, 10);\r
\r
- Assert.AreEqual(10, popup.TitleTextPosition2D.X, "Should be equal");\r
- Assert.AreEqual(10, popup.TitleTextPosition2D.Y, "Should be equal");\r
+ Assert.AreEqual(10, popup.TitleTextPosition.X, "Should be equal");\r
+ Assert.AreEqual(10, popup.TitleTextPosition.Y, "Should be equal");\r
}\r
\r
[Test]\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
+ Assert.IsNotNull(popup, "Should be not Null!");
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
+
popup.TitleHeight = 10;\r
Assert.AreEqual(10, popup.TitleHeight, "Should be equals to the set value of TitleHeight");\r
}\r
\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ShadowOffset. Check whether ShadowOffset is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Popup.ShadowOffset A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ShadowOffset_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var popup = new Components.Popup();\r
- popup.ShadowOffset = new Vector4(10, 10, 10, 10);\r
-\r
- Assert.AreEqual(10, popup.ShadowOffset.X, "Should be equals!");\r
- Assert.AreEqual(10, popup.ShadowOffset.Y, "Should be equals!");\r
- Assert.AreEqual(10, popup.ShadowOffset.Z, "Should be equals!");\r
- Assert.AreEqual(10, popup.ShadowOffset.W, "Should be equals!");\r
- }\r
-\r
[Test]\r
[Category("P1")]\r
[Description("Test ButtonHeight. Check whether ButtonHeight is readable and writable.")]\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
+ Assert.IsNotNull(popup, "Should be not Null!");
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
+
popup.ButtonHeight = 10;\r
Assert.AreEqual(10, popup.ButtonHeight, "Should be equals to the set value of ButtonHeight");\r
}\r
\r
[Test]\r
[Category("P1")]\r
- [Description("Test ButtonPointSize. Check whether ButtonPointSize is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Popup.ButtonPointSize A")]\r
+ [Description("Test ButtonTextPointSize. Check whether ButtonTextPointSize is readable and writable.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Popup.ButtonTextPointSize A")]\r
[Property("SPEC_URL", "-")]\r
[Property("CRITERIA", "PRW")]
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ButtonPointSize_SET_GET_VALUE()\r
+ public void ButtonTextPointSize_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
- popup.ButtonPointSize = 10.0f;\r
- Assert.AreEqual(10.0f, popup.ButtonPointSize, "Should be equals to the set value of ButtonPointSize");\r
+ Assert.IsNotNull(popup, "Should be not Null!");
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
+
+ popup.ButtonTextPointSize = 10.0f;\r
+ Assert.AreEqual(10.0f, popup.ButtonTextPointSize, "Should be equals to the set value of ButtonTextPointSize");\r
}\r
\r
[Test]\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
+ Assert.IsNotNull(popup, "Should be not Null!");
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
+
popup.ButtonFontFamily = "SamsungOne 500";\r
Assert.AreEqual("SamsungOne 500", popup.ButtonFontFamily, "Should be equals to the set value of ButtonFontFamily");\r
}\r
\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ButtonOverLayBackgroundColorSelector. Check whether ButtonOverLayBackgroundColorSelector is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Popup.ButtonOverLayBackgroundColorSelector A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ButtonOverLayBackgroundColorSelector_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var popup = new Components.Popup();\r
- var colorSelector = new ColorSelector\r
- {\r
- Normal = new Color(0.0f, 0.0f, 1.0f, 1.0f),\r
- Selected = new Color(0.0f, 1.0f, 0.0f, 1.0f),\r
- };\r
-\r
- popup.ButtonOverLayBackgroundColorSelector = colorSelector;\r
- Assert.AreEqual(colorSelector.Normal.R, popup.ButtonOverLayBackgroundColorSelector.Normal.R, "Should be equals to the set value of ButtonOverLayBackgroundColorSelector Normal R");\r
- Assert.AreEqual(colorSelector.Normal.G, popup.ButtonOverLayBackgroundColorSelector.Normal.G, "Should be equals to the set value of ButtonOverLayBackgroundColorSelector Normal G");\r
- Assert.AreEqual(colorSelector.Normal.B, popup.ButtonOverLayBackgroundColorSelector.Normal.B, "Should be equals to the set value of ButtonOverLayBackgroundColorSelector Normal B");\r
- Assert.AreEqual(colorSelector.Normal.A, popup.ButtonOverLayBackgroundColorSelector.Normal.A, "Should be equals to the set value of ButtonOverLayBackgroundColorSelector Normal A");\r
-\r
- Assert.AreEqual(colorSelector.Selected.R, popup.ButtonOverLayBackgroundColorSelector.Selected.R, "Should be equals to the set value of ButtonOverLayBackgroundColorSelector Selected R");\r
- Assert.AreEqual(colorSelector.Selected.G, popup.ButtonOverLayBackgroundColorSelector.Selected.G, "Should be equals to the set value of ButtonOverLayBackgroundColorSelector Selected G");\r
- Assert.AreEqual(colorSelector.Selected.B, popup.ButtonOverLayBackgroundColorSelector.Selected.B, "Should be equals to the set value of ButtonOverLayBackgroundColorSelector Selected B");\r
- Assert.AreEqual(colorSelector.Selected.A, popup.ButtonOverLayBackgroundColorSelector.Selected.A, "Should be equals to the set value of ButtonOverLayBackgroundColorSelector Selected A");\r
- }\r
-\r
[Test]\r
[Category("P1")]\r
[Description("Test ButtonTextAlignment. Check whether ButtonTextAlignment is readable and writable.")]\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
+ Assert.IsNotNull(popup, "Should be not Null!");
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
+
popup.ButtonTextAlignment = HorizontalAlignment.Begin;\r
Assert.AreEqual(HorizontalAlignment.Begin, popup.ButtonTextAlignment, "Should be equal");\r
}\r
{\r
/* TEST CODE */\r
var popup = new Components.Popup();\r
+ Assert.IsNotNull(popup, "Should be not Null!");
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
+
var textColor = new Color(0.0f, 0.0f, 1.0f, 0.0f);\r
+ Assert.IsNotNull(textColor, "Should be not Null!");
+ Assert.IsInstanceOf<Color>(textColor, "Should be equal!");
popup.ButtonTextColor = textColor;\r
\r
Assert.AreEqual(textColor.R, popup.ButtonTextColor.R, "Should be equal");\r
\r
[Test]\r
[Category("P1")]\r
- [Description("Test ButtonBackgroundImageURL. Check whether ButtonBackgroundImageURL is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Popup.ButtonBackgroundImageURL A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ButtonBackgroundImageURL_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var popup = new Components.Popup();\r
- popup.ButtonBackgroundImageURL = _image_path;\r
- Assert.AreEqual(_image_path, popup.ButtonBackgroundImageURL, "Should be equals to the set value of ButtonBackgroundImageURL");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ButtonBackgroundImageBorder. Check whether ButtonBackgroundImageBorder is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Popup.ButtonBackgroundImageBorder A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ButtonBackgroundImageBorder_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var popup = new Components.Popup();\r
- popup.ButtonBackgroundImageBorder = new Rectangle(0, 0, 10, 10);\r
- Assert.AreEqual(0, popup.ButtonBackgroundImageBorder.X, "Retrieved ButtonBackgroundImageBorder should be equal to set value");\r
- Assert.AreEqual(0, popup.ButtonBackgroundImageBorder.Y, "Retrieved ButtonBackgroundImageBorder should be equal to set value");\r
- Assert.AreEqual(10, popup.ButtonBackgroundImageBorder.Width, "Retrieved ButtonBackgroundImageBorder should be equal to set value");\r
- Assert.AreEqual(10, popup.ButtonBackgroundImageBorder.Height, "Retrieved ButtonBackgroundImageBorder should be equal to set value");\r
- }\r
-\r
- public class MyPopup : Components.Popup\r
- {\r
- public override void OnFocusGained()\r
- {\r
- _focusGainedFlag = true;\r
- base.OnFocusGained();\r
- }\r
-\r
- public override void OnFocusLost()\r
- {\r
- _focusLostFlag = true;\r
- base.OnFocusLost();\r
- }\r
-\r
- protected override Attributes GetAttributes()\r
- {\r
- return base.GetAttributes();\r
- }\r
-\r
- public Attributes TestGetAttributes()\r
- {\r
- return GetAttributes();\r
- }\r
-\r
- protected override void OnUpdate()\r
- {\r
- _updateFlag = true;\r
- base.OnUpdate();\r
- }\r
-\r
- protected override void LayoutChild()\r
- {\r
- _layoutChildFlag = true;\r
- base.LayoutChild();\r
- }\r
-\r
- protected override void OnThemeChangedEvent(object sender, Components.StyleManager.ThemeChangeEventArgs e)\r
- {\r
- _themeFlag = true;\r
- base.OnThemeChangedEvent(sender, e);\r
- }\r
- }\r
-\r
- [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;\r
- Window.Instance.Add(myPopup);
- FocusManager.Instance.SetCurrentFocusView(myPopup);
- Assert.AreEqual(true, _focusGainedFlag, "Should be equal!");\r
-\r
- }\r
-\r
- [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;\r
- Window.Instance.Add(myPopup);
- Window.Instance.Add(view);
- FocusManager.Instance.SetCurrentFocusView(myPopup);
- FocusManager.Instance.SetCurrentFocusView(view);
- Assert.AreEqual(true, _focusLostFlag, "Should be equal!");\r
-\r
- }\r
-\r
- [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<PopupAttributes>(attr, "Should be equal!");\r
-\r
- }\r
-\r
- [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!");\r
-\r
- }\r
-\r
- [Test]
- [Category("P1")]
[Description("Test SetButtonText. Check it has been triggered")]
[Property("SPEC", "Tizen.NUI.Components.Popup.SetButtonText M")]
[Property("SPEC_URL", "-")]
try
{
Popup popup = new Popup();
+ Assert.IsNotNull(popup, "Should be not Null!");
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
popup.SetButtonText(0, "YES");
}
catch (Exception e)
\r
}\r
\r
- [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()
- {\r
- /* TEST CODE */\r
- _layoutChildFlag = false;
- var myPopup = CreatePopup();
- await Task.Delay(500);
- Assert.AreEqual(true, _layoutChildFlag, "Should be equal!");\r
-\r
- }\r
-\r
- [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")]\r
- public async Task OnThemeChangedEvent_CHECK_VALUE()\r
- {\r
- _themeFlag = false;\r
- Tizen.NUI.Components.StyleManager.Instance.Theme = "Utility";\r
- var myPopup = new MyPopup();\r
- Window window = Window.Instance;\r
- window.Add(myPopup);\r
- Tizen.NUI.Components.StyleManager.Instance.Theme = "Food";\r
- await Task.Delay(500);\r
- Assert.AreEqual(true, _themeFlag, "OnThemeChangedEvent trigger Check Fail.");\r
- window.Remove(myPopup);\r
- }\r
-\r
[Test]
[Category("P1")]
[Description("Test Dispose, try to dispose the Popup.")]
try
{
Popup popup = new Popup();
+ Assert.IsNotNull(popup, "Should be not Null!");
+ Assert.IsInstanceOf<Components.Popup>(popup, "Should be equal!");
popup.Dispose();
}
catch (Exception e)
Assert.Fail("Caught Exception" + e.ToString());
}
}
-\r
- private MyPopup CreatePopup()\r
- {\r
- MyPopup popup = new MyPopup();\r
- popup.MinimumSize = new Size2D(1032, 184);\r
- popup.Size2D = new Size2D(1032, 400);\r
- popup.Position2D = new Position2D(200, 100);\r
-\r
- popup.TitlePointSize = 25;\r
- popup.TitleTextColor = Color.Black;\r
- popup.TitleHeight = 68;\r
- popup.TitleTextHorizontalAlignment = HorizontalAlignment.Begin;\r
- popup.TitleTextPosition2D = new Position2D(64, 52);\r
- popup.TitleText = "Popup Title";\r
-\r
- popup.ShadowImageURL = _path + "11. Popup/popup_background_shadow.png";\r
- popup.ShadowImageBorder = new Rectangle(0, 0, 105, 105);\r
- popup.ShadowOffset = new Vector4(24, 24, 24, 24);\r
- popup.BackgroundImageURL = _path + "11. Popup/popup_background.png";\r
- popup.BackgroundImageBorder = new Rectangle(0, 0, 81, 81);\r
-\r
- popup.ButtonBackgroundImageURL = _path + "3. Button/rectangle_btn_normal.png";
- popup.ButtonBackgroundImageBorder = new Rectangle(5, 5, 5, 5);\r
- 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),
- };\r
- popup.ButtonTextColor = Color.Red;\r
- popup.ButtonHeight = 132;\r
- popup.ButtonCount = 2;\r
- popup.SetButtonText(0, "Yes");\r
- popup.SetButtonText(1, "Exit");
-\r
- Window.Instance.Add(popup);\r
-\r
- TextLabel contentText = new TextLabel();\r
- contentText.Size2D = new Size2D(904, 100);\r
- contentText.PointSize = 20;\r
- contentText.HorizontalAlignment = HorizontalAlignment.Begin;\r
- contentText.VerticalAlignment = VerticalAlignment.Center;\r
- contentText.Text = "Popup ButtonStyle is ";\r
- popup.ContentView.Add(contentText);\r
-\r
- return popup;\r
- }\r
-\r
- }\r
-\r
- public class PopupStyle : StyleBase\r
- {\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
- protected override Attributes GetAttributes()\r
- {\r
- PopupAttributes attributes = new PopupAttributes\r
- {\r
- MinimumSize = new Size2D(1032, 184),\r
- ShadowOffset = new Vector4(24, 24, 24, 24),\r
- TitleTextAttributes = new TextAttributes\r
- {\r
- PointSize = new FloatSelector { All = 25 },\r
- TextColor = new ColorSelector { All = Color.Black },\r
- Size2D = new Size2D(0, 68),\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,\r
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,\r
- HorizontalAlignment = HorizontalAlignment.Begin,\r
- VerticalAlignment = VerticalAlignment.Bottom,\r
- Position2D = new Position2D(64, 52),\r
- },\r
- BackgroundImageAttributes = new ImageAttributes\r
- {\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,\r
- PivotPoint = Tizen.NUI.PivotPoint.Center,\r
- WidthResizePolicy = ResizePolicyType.FillToParent,\r
- HeightResizePolicy = ResizePolicyType.FillToParent,\r
- ResourceURL = new StringSelector { All = _image_path},\r
- Border = new RectangleSelector { All = new Rectangle(0, 0, 81, 81) },\r
- },\r
- ButtonAttributes = new ButtonAttributes\r
- {\r
- Size2D = new Size2D(0, 132),\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,\r
- PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,\r
- BackgroundImageAttributes = new ImageAttributes\r
- {\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,\r
- PivotPoint = Tizen.NUI.PivotPoint.Center,\r
- WidthResizePolicy = ResizePolicyType.FillToParent,\r
- HeightResizePolicy = ResizePolicyType.FillToParent,\r
- ResourceURL = new StringSelector { All = _image_path },\r
- Border = new RectangleSelector { All = new Rectangle(5, 5, 5, 5) },\r
- },\r
- OverlayImageAttributes = new ImageAttributes\r
- {\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,\r
- PivotPoint = Tizen.NUI.PivotPoint.Center,\r
- WidthResizePolicy = ResizePolicyType.FillToParent,\r
- HeightResizePolicy = ResizePolicyType.FillToParent,\r
- BackgroundColor = new ColorSelector\r
- {\r
- Normal = new Color(1.0f, 1.0f, 1.0f, 1.0f),\r
- Pressed = new Color(0.0f, 0.0f, 0.0f, 0.1f),\r
- Selected = new Color(1.0f, 1.0f, 1.0f, 1.0f),\r
- },\r
- }\r
- },\r
- };\r
- return attributes;\r
- }\r
}\r
}\r
+++ /dev/null
-using NUnit.Framework;\r
-using NUnit.Framework.TUnit;\r
-using System;\r
-using Tizen.NUI;\r
-using Tizen.NUI.UIComponents;\r
-using Tizen.NUI.Components;\r
-using System.Runtime.InteropServices;\r
-using System.Threading.Tasks;\r
-using Tizen.NUI.Components.Test;\r
-\r
-namespace Tizen.NUI.Components.Tests\r
-{\r
- [TestFixture]\r
- [Description("Tizen.NUI.Components.PopupAttributes Tests")]\r
- public class PopupAttributesTests\r
- {\r
- private const string TAG = "Components";\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
-\r
- [SetUp]\r
- public void Init()\r
- {\r
- Tizen.Log.Info(TAG, "Init() is called!");\r
- App.MainTitleChangeText("PopupAttributesTests");\r
- App.MainTitleChangeBackgroundColor(null);\r
-\r
- }\r
-\r
- [TearDown]\r
- public void Destroy()\r
- {\r
- Tizen.Log.Info(TAG, "Destroy() is called!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test PopupAttributes empty constructor. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.PopupAttributes.PopupAttributes C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("COVPARAM", "")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void PopupAttributes_CHECK_VALUE()\r
- {\r
- /* TEST CODE */\r
- var popupAttributes = new PopupAttributes();\r
- Assert.IsNotNull(popupAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<PopupAttributes>(popupAttributes, "Should be equal!");\r
-\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test PopupAttributes copy constructor. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.PopupAttributes.PopupAttributes C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("COVPARAM", "PopupAttributes")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void PopupAttributes_PopupAttributes_CHECK_VALUE()\r
- {\r
- /* TEST CODE */\r
- var attrs = new PopupAttributes\r
- {\r
- MinimumSize = new Size2D(1032, 184),\r
- ShadowOffset = new Vector4(24, 24, 24, 24),\r
- TitleTextAttributes = new TextAttributes\r
- {\r
- PointSize = new FloatSelector { All = 25 },\r
- TextColor = new ColorSelector { All = Color.Black },\r
- Size2D = new Size2D(0, 68),\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,\r
- PivotPoint = Tizen.NUI.PivotPoint.TopLeft,\r
- HorizontalAlignment = HorizontalAlignment.Begin,\r
- VerticalAlignment = VerticalAlignment.Bottom,\r
- Position2D = new Position2D(64, 52),\r
- Text = new StringSelector { All = "Popup Title" },\r
- },\r
- BackgroundImageAttributes = new ImageAttributes\r
- {\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,\r
- PivotPoint = Tizen.NUI.PivotPoint.Center,\r
- WidthResizePolicy = ResizePolicyType.FillToParent,\r
- HeightResizePolicy = ResizePolicyType.FillToParent,\r
- ResourceURL = new StringSelector { All = _image_path },\r
- Border = new RectangleSelector { All = new Rectangle(0, 0, 81, 81) },\r
- },\r
- ButtonAttributes = new ButtonAttributes\r
- {\r
- Size2D = new Size2D(0, 132),\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,\r
- PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,\r
- BackgroundImageAttributes = new ImageAttributes\r
- {\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,\r
- PivotPoint = Tizen.NUI.PivotPoint.Center,\r
- WidthResizePolicy = ResizePolicyType.FillToParent,\r
- HeightResizePolicy = ResizePolicyType.FillToParent,\r
- ResourceURL = new StringSelector { All = _image_path },\r
- Border = new RectangleSelector { All = new Rectangle(5, 5, 5, 5) },\r
- },\r
- OverlayImageAttributes = new ImageAttributes\r
- {\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,\r
- PivotPoint = Tizen.NUI.PivotPoint.Center,\r
- WidthResizePolicy = ResizePolicyType.FillToParent,\r
- HeightResizePolicy = ResizePolicyType.FillToParent,\r
- BackgroundColor = new ColorSelector\r
- {\r
- Normal = new Color(1.0f, 1.0f, 1.0f, 1.0f),\r
- Pressed = new Color(0.0f, 0.0f, 0.0f, 0.1f),\r
- Selected = new Color(1.0f, 1.0f, 1.0f, 1.0f),\r
- },\r
- },\r
- TextAttributes = new TextAttributes\r
- {\r
- PositionUsesPivotPoint = true,\r
- ParentOrigin = Tizen.NUI.ParentOrigin.Center,\r
- PivotPoint = Tizen.NUI.PivotPoint.Center,\r
- HorizontalAlignment = HorizontalAlignment.Center,\r
- VerticalAlignment = VerticalAlignment.Center,\r
- TextColor = new ColorSelector { All = Color.Cyan },\r
- },\r
- },\r
- };\r
- var popupAttributes = new PopupAttributes(attrs);\r
- Assert.IsNotNull(popupAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<PopupAttributes>(popupAttributes, "Should be equal!");\r
-\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ShadowImageAttributes. Check whether ShadowImageAttributes is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.PopupAttributes.ShadowImageAttributes A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ShadowImageAttributes_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var popupAttributes = new PopupAttributes();\r
- popupAttributes.ShadowImageAttributes = new ImageAttributes();\r
- Assert.IsNotNull(popupAttributes.ShadowImageAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<ImageAttributes>(popupAttributes.ShadowImageAttributes, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test BackgroundImageAttributes. Check whether BackgroundImageAttributes is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.PopupAttributes.BackgroundImageAttributes A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void BackgroundImageAttributes_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var popupAttributes = new PopupAttributes();\r
- popupAttributes.BackgroundImageAttributes = new ImageAttributes();\r
- Assert.IsNotNull(popupAttributes.BackgroundImageAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<ImageAttributes>(popupAttributes.BackgroundImageAttributes, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test TitleTextAttributes. Check whether TitleTextAttributes is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.PopupAttributes.TitleTextAttributes A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void TitleTextAttributes_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var popupAttributes = new PopupAttributes();\r
- popupAttributes.TitleTextAttributes = new TextAttributes();\r
- Assert.IsNotNull(popupAttributes.TitleTextAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<TextAttributes>(popupAttributes.TitleTextAttributes, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ShadowOffset. Check whether ShadowOffset is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.PopupAttributes.ShadowOffset A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ShadowOffset_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var popupAttributes = new PopupAttributes();\r
- popupAttributes.ShadowOffset = new Vector4(10, 10, 10, 10);\r
-\r
- Assert.AreEqual(10, popupAttributes.ShadowOffset.X, "Should be equals!");\r
- Assert.AreEqual(10, popupAttributes.ShadowOffset.Y, "Should be equals!");\r
- Assert.AreEqual(10, popupAttributes.ShadowOffset.Z, "Should be equals!");\r
- Assert.AreEqual(10, popupAttributes.ShadowOffset.W, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ButtonAttributes. Check whether ButtonAttributes is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.PopupAttributes.ButtonAttributes A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ButtonAttributes_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var popupAttributes = new PopupAttributes();\r
- popupAttributes.ButtonAttributes = new ButtonAttributes();\r
- Assert.IsNotNull(popupAttributes.ButtonAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<ButtonAttributes>(popupAttributes.ButtonAttributes, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test Clone. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.PopupAttributes.Clone M")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "MR")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void Clone_CHECK_VALUE()\r
- {\r
- var popupAttributes = new PopupAttributes();\r
- popupAttributes.ShadowOffset = new Vector4(1, 1, 1, 1);\r
- popupAttributes.ButtonAttributes = new ButtonAttributes();\r
- var attr = popupAttributes.Clone() as PopupAttributes;\r
- Assert.IsNotNull(attr, "Should be not null!");\r
- Assert.IsInstanceOf<PopupAttributes>(attr, "Should be an instance of PopupAttributes!");\r
- Assert.AreEqual(1, attr.ShadowOffset.X, "Should be equal!");\r
- }\r
-\r
- }\r
-}\r
Assert.IsInstanceOf<Progress>(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<Progress>(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<Progress>(tab, "Should be an instance of Progress type.");
- }
-
[Test]
[Category("P1")]
[Description("Test TrackImageURL. Check whether TrackImageURL works or not.")]
{
/* TEST CODE */
var progress = new Progress();
+ Assert.IsNotNull(progress, "Should be not null!");
+ Assert.IsInstanceOf<Progress>(progress, "Progress Contruct Fail");
+
progress.TrackImageURL = "progressurl";
Assert.AreEqual("progressurl", progress.TrackImageURL, "Retrieved TrackImageURL should be equal to set value");
}
{
/* TEST CODE */
var progress = new Progress();
+ Assert.IsNotNull(progress, "Should be not null!");
+ Assert.IsInstanceOf<Progress>(progress, "Progress Contruct Fail");
+
progress.ProgressImageURL = "progressurl";
Assert.AreEqual("progressurl", progress.ProgressImageURL, "Retrieved ProgressImageURL should be equal to set value");
}
{
/* TEST CODE */
var progress = new Progress();
+ Assert.IsNotNull(progress, "Should be not null!");
+ Assert.IsInstanceOf<Progress>(progress, "Progress Contruct Fail");
+
progress.BufferImageURL = "progressurl";
Assert.AreEqual("progressurl", progress.BufferImageURL, "Retrieved BufferImageURL should be equal to set value");
}
{
/* TEST CODE */
var progress = new Progress();
- Color color = Color.Red;
+ Assert.IsNotNull(progress, "Should be not null!");
+ Assert.IsInstanceOf<Progress>(progress, "Progress Contruct Fail");
+
+ var color = Color.Red;
+ Assert.IsNotNull(color, "Should be not null!");
+ Assert.IsInstanceOf<Color>(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");
{
/* TEST CODE */
var progress = new Progress();
- Color color = Color.Red;
+ Assert.IsNotNull(progress, "Should be not null!");
+ Assert.IsInstanceOf<Progress>(progress, "Progress Contruct Fail");
+
+ var color = Color.Red;
+ Assert.IsNotNull(color, "Should be not null!");
+ Assert.IsInstanceOf<Color>(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");
{
/* TEST CODE */
var progress = new Progress();
- Color color = Color.Red;
+ Assert.IsNotNull(progress, "Should be not null!");
+ Assert.IsInstanceOf<Progress>(progress, "Progress Contruct Fail");
+
+ var color = Color.Red;
+ Assert.IsNotNull(color, "Should be not null!");
+ Assert.IsInstanceOf<Color>(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");
public void MaxValue_SET_GET_VALUE()
{
var progress = new Progress();
+ Assert.IsNotNull(progress, "Should be not null!");
+ Assert.IsInstanceOf<Progress>(progress, "Progress Contruct Fail");
+
progress.MaxValue = 30;
Assert.AreEqual(30f, progress.MaxValue, "Retrieved MaxValue should be equal to set value");
}
public void MinValue_SET_GET_VALUE()
{
var progress = new Progress();
+ Assert.IsNotNull(progress, "Should be not null!");
+ Assert.IsInstanceOf<Progress>(progress, "Progress Contruct Fail");
+
progress.MinValue = 5;
Assert.AreEqual(5, progress.MinValue, "Retrieved MinValue should be equal to set value");
}
{
/* TEST CODE */
var progress = new Progress();
+ Assert.IsNotNull(progress, "Should be not null!");
+ Assert.IsInstanceOf<Progress>(progress, "Progress Contruct Fail");
+
progress.CurrentValue = 20;
Assert.AreEqual(20, progress.CurrentValue, "Retrieved CurrentValue should be equal to set value");
}
{
/* TEST CODE */
var progress = new Progress();
+ Assert.IsNotNull(progress, "Should be not null!");
+ Assert.IsInstanceOf<Progress>(progress, "Progress Contruct Fail");
+
progress.BufferValue = 20;
Assert.AreEqual(20, progress.BufferValue, "Retrieved BufferValue should be equal to set value");
}
public void ProgressState_SET_GET_VALUE()
{
var progress = new Progress();
+ Assert.IsNotNull(progress, "Should be not null!");
+ Assert.IsInstanceOf<Progress>(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;
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.")]
try
{
var myProgress = new MyProgress();
+ Assert.IsNotNull(myProgress, "Should be not null!");
+ Assert.IsInstanceOf<MyProgress>(myProgress, "MyProgress Contruct Fail");
+
myProgress._ChangeImageState(Progress.ProgressStatusType.Buffering);
}
catch (Exception e)
try
{
Progress progressBar = new Progress();
+ Assert.IsNotNull(progressBar, "Should be not null!");
+ Assert.IsInstanceOf<Progress>(progressBar, "Progress Contruct Fail");
+
progressBar.Dispose();
}
catch (Exception e)
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;
- }
- }
}
+++ /dev/null
-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>(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<ProgressAttributes>(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");
- }
- }
-}
+++ /dev/null
-using NUnit.Framework;\r
-using NUnit.Framework.TUnit;\r
-using System;\r
-using Tizen.NUI;\r
-using Tizen.NUI.UIComponents;\r
-using Tizen.NUI.Components;\r
-using System.Runtime.InteropServices;\r
-using System.Threading.Tasks;\r
-using Tizen.NUI.Components.Test;\r
-\r
-namespace Tizen.NUI.Components.Tests\r
-{\r
- [TestFixture]\r
- [Description("Tizen.NUI.Components.RadioButton Tests")]\r
- public class RadioButtonTests\r
- {\r
- private const string TAG = "Components";\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
-\r
- [SetUp]\r
- public void Init()\r
- {\r
- Tizen.Log.Info(TAG, "Init() is called!");\r
- App.MainTitleChangeText("CommonRadioButtonTests");\r
- App.MainTitleChangeBackgroundColor(null);\r
-\r
- }\r
-\r
- [TearDown]\r
- public void Destroy()\r
- {\r
- Tizen.Log.Info(TAG, "Destroy() is called!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test RadioButton empty constructor. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.RadioButton.RadioButton C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("COVPARAM", "")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void RadioButton_CHECK_VALUE()\r
- {\r
- /* TEST CODE */\r
- var radioButton = new Components.RadioButton();\r
- Assert.IsNotNull(radioButton, "Should be not null!");\r
- Assert.IsInstanceOf<Components.RadioButton>(radioButton, "Should be equal!");\r
-\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test RadioButton style constructor. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.RadioButton.RadioButton C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("COVPARAM", "string")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void RadioButton_Style_CHECK_VALUE()\r
- {\r
- /* TEST CODE */\r
- StyleManager.Instance.RegisterStyle("RadioButtonStyle", null, typeof(RadioButtonStyle));\r
- var radioButton = new Components.RadioButton("RadioButtonStyle");\r
- Assert.IsNotNull(radioButton, "Should be not null!");\r
- Assert.IsInstanceOf<Components.RadioButton>(radioButton, "Should be equal!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test RadioButton SelectButtonAttributes constructor. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.RadioButton.RadioButton C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("COVPARAM", "SelectButtonAttributes")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void RadioButton_SelectButtonAttributes_CHECK_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButtonAttributes = new SelectButtonAttributes\r
- {\r
- CheckImageAttributes = new ImageAttributes\r
- {\r
- Size2D = new Size2D(48, 48),\r
- ResourceURL = new StringSelector\r
- {\r
- All = _image_path,\r
- },\r
- Opacity = new FloatSelector\r
- {\r
- Normal = 1.0f,\r
- Selected = 1.0f,\r
- Disabled = 0.4f,\r
- DisabledSelected = 0.4f\r
- },\r
- },\r
- };\r
- var radioButton = new Components.RadioButton(selectButtonAttributes);\r
- Assert.IsNotNull(radioButton, "Should be not null!");\r
- Assert.IsInstanceOf<Components.RadioButton>(radioButton, "Should be equal!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test ItemGroup. Check whether ItemGroup is readable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.RadioButton.ItemGroup A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void ItemGroup_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var radioButtonGroup = new RadioButtonGroup();\r
- var radioButton = new Components.RadioButton();\r
- var radioButton2 = new Components.RadioButton();\r
- radioButtonGroup.Add(radioButton);\r
- radioButtonGroup.Add(radioButton2);\r
- Assert.IsNotNull(radioButton.ItemGroup, "Should be equal!");\r
- Assert.AreEqual(2, radioButton.ItemGroup.Count, "Should be equal!");\r
- }\r
- }\r
-\r
- public class RadioButtonStyle : StyleBase\r
- {\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
- protected override Attributes GetAttributes()\r
- {\r
- SelectButtonAttributes attributes = new SelectButtonAttributes\r
- {\r
- CheckImageAttributes = new ImageAttributes\r
- {\r
- Size2D = new Size2D(48, 48),\r
- Position2D = new Position2D(0, 0),\r
- ResourceURL = new StringSelector\r
- {\r
- Normal = _image_path,\r
- Selected = _image_path,\r
- Disabled = _image_path,\r
- DisabledSelected = _image_path,\r
- },\r
- Opacity = new FloatSelector\r
- {\r
- Normal = 1.0f,\r
- Selected = 1.0f,\r
- Disabled = 0.4f,\r
- DisabledSelected = 0.4f\r
- },\r
- },\r
- };\r
-\r
- return attributes;\r
- }\r
- }\r
-}\r
+++ /dev/null
-using NUnit.Framework;\r
-using NUnit.Framework.TUnit;\r
-using System;\r
-using Tizen.NUI;\r
-using Tizen.NUI.UIComponents;\r
-using Tizen.NUI.Components;\r
-using System.Runtime.InteropServices;\r
-using System.Threading.Tasks;\r
-using Tizen.NUI.Components.Test;\r
-\r
-namespace Tizen.NUI.Components.Tests\r
-{\r
- [TestFixture]\r
- [Description("Tizen.NUI.Components.RadioButtonGroup Tests")]\r
- public class RadioButtonGroupTests\r
- {\r
- private const string TAG = "Components";\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
-\r
- [SetUp]\r
- public void Init()\r
- {\r
- Tizen.Log.Info(TAG, "Init() is called!");\r
- App.MainTitleChangeText("RadioButtonGroupTests");\r
- App.MainTitleChangeBackgroundColor(null);\r
-\r
- }\r
-\r
- [TearDown]\r
- public void Destroy()\r
- {\r
- Tizen.Log.Info(TAG, "Destroy() is called!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test RadioButtonGroup. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.RadioButtonGroup.RadioButtonGroup C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void RadioButtonGroup_CHECK_VALUE()\r
- {\r
- var radioButtonGroup = new RadioButtonGroup();\r
- Assert.IsNotNull(radioButtonGroup, "Should be not null!");\r
- Assert.IsInstanceOf<RadioButtonGroup>(radioButtonGroup, "Should be equal!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test Add. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.RadioButtonGroup.Add M")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "MCST")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void Add_CHECK_VALUE()\r
- {\r
- var radioButton1 = new Components.RadioButton();\r
- radioButton1.Name = "radioButton1";\r
-\r
- var radioButtonGroup = new RadioButtonGroup();\r
- radioButtonGroup.Add(radioButton1);\r
-\r
- string radiobuttonName1 = radioButtonGroup.GetItemByIndex(0).Name;\r
-\r
- Assert.AreEqual("radioButton1", radiobuttonName1, "Should be equals to the name of RadioButton");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test Remove. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.RadioButtonGroup.Remove M")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "MCST")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void Remove_CHECK_VALUE()\r
- {\r
- var radioButton1 = new Components.RadioButton();\r
- radioButton1.Name = "radioButton1";\r
- var radioButton2 = new Components.RadioButton();\r
- radioButton2.Name = "radioButton2";\r
-\r
- var radioButtonGroup = new RadioButtonGroup();\r
- radioButtonGroup.Add(radioButton1);\r
- radioButtonGroup.Add(radioButton2);\r
-\r
- radioButtonGroup.Remove(radioButton1);\r
-\r
- string radiobuttonName1 = radioButtonGroup.GetItemByIndex(0).Name;\r
-\r
- Assert.AreEqual("radioButton2", radiobuttonName1, "Should be equals to the name of RadioButton");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test GetItemByIndex. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.RadioButtonGroup.GetItemByIndex M")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "MR")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void GetItemByIndex_CHECK_VALUE()\r
- {\r
- var radioButton1 = new Components.RadioButton();\r
- radioButton1.Name = "radioButton1";\r
- var radioButton2 = new Components.RadioButton();\r
- radioButton2.Name = "radioButton2";\r
-\r
- var radioButtonGroup = new RadioButtonGroup();\r
- radioButtonGroup.Add(radioButton1);\r
- radioButtonGroup.Add(radioButton2);\r
-\r
- string radiobuttonName1 = radioButtonGroup.GetItemByIndex(0).Name;\r
- string radiobuttonName2 = radioButtonGroup.GetItemByIndex(1).Name;\r
-\r
- Assert.AreEqual("radioButton1", radiobuttonName1, "Should be equals to the name of RadioButton");\r
- Assert.AreEqual("radioButton2", radiobuttonName2, "Should be equals to the name of RadioButton");\r
- }\r
- }\r
-}\r
+++ /dev/null
-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>(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!");
- }
- }
-}
private const string TAG = "NUI.Components";\r
private string _style = "";\r
private string _trackImageUrl = "";\r
- private bool _styleRegiesterFlag = false;\r
\r
[SetUp]\r
public void Init()\r
Tizen.Log.Info(TAG, "Init() is called!");\r
App.MainTitleChangeText("ScrollBarTests");\r
App.MainTitleChangeBackgroundColor(null);\r
- if (!_styleRegiesterFlag)\r
- {\r
- StyleManager.Instance.RegisterStyle("DAScrollbar", null, typeof(Tizen.NUI.Components.Tests.DAScrollBarStyle));\r
- _styleRegiesterFlag = true;\r
- }\r
}\r
\r
[TearDown]\r
Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar type.");\r
}\r
\r
- [Test]\r
- [Category("P1")]\r
- [Description("Create a ScrollBar object. Check whether ScrollBar object which set style is successfully created or not.")]\r
- [Property("SPEC", "Tizen.NUI.Components.ScrollBar.ScrollBar C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("COVPARAM", "string")]\r
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]\r
- public void ScrollBar_INIT_WITH_STYLE()\r
- {\r
- /* TEST CODE */\r
- var scrollBar = new ScrollBar("DAScrollbar");\r
- Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar");\r
- Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar type.");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Create a ScrollBar object. Check whether ScrollBar object which set attributes is successfully created or not.")]\r
- [Property("SPEC", "Tizen.NUI.Components.ScrollBar.ScrollBar C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("COVPARAM", "ScrollBarAttributes")]\r
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]\r
- public void ScrollBar_INIT_WITH_ATTRIBUTES()\r
- {\r
- /* TEST CODE */\r
- ScrollBarAttributes attr = new ScrollBarAttributes\r
- {\r
- TrackImageAttributes = new ImageAttributes\r
- {\r
- BackgroundColor = new ColorSelector\r
- {\r
- All = new Color(0.43f, 0.43f, 0.43f, 0.1f),\r
- }\r
- },\r
- ThumbImageAttributes = new ImageAttributes\r
- {\r
- BackgroundColor = new ColorSelector\r
- {\r
- All = new Color(0.0f, 0.0f, 0.0f, 0.2f),\r
- }\r
- },\r
-\r
- };\r
- var scrollBar = new ScrollBar(attr);\r
- Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar");\r
- Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar type.");\r
- }\r
-\r
[Test]\r
[Category("P1")]\r
[Description("Test MinValue.Check whether MinValue is readable ahd writeable.")]\r
{\r
/* TEST CODE */\r
var scrollBar = new ScrollBar();\r
+ Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar");\r
+ Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar type.");\r
+\r
scrollBar.MinValue = 0;\r
Assert.AreEqual(0, scrollBar.MinValue, "Should be equals to the set value of MinValue.");\r
}\r
{\r
/* TEST CODE */\r
var scrollBar = new ScrollBar();\r
+ Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar");\r
+ Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar type.");\r
+\r
scrollBar.MaxValue = 100;\r
Assert.AreEqual(100, scrollBar.MaxValue, "Should be equals to the set value of MaxValue.");\r
}\r
{\r
/* TEST CODE */\r
var scrollBar = new ScrollBar();\r
+ Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar");\r
+ Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar type.");\r
+\r
scrollBar.CurrentValue = 50;\r
Assert.AreEqual(50, scrollBar.CurrentValue, "Should be equals to the set value of CurrentValue.");\r
}\r
{\r
/* TEST CODE */\r
var scrollBar = new ScrollBar();\r
+ Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar");\r
+ Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar type.");\r
+\r
scrollBar.ThumbColor = Color.Red;\r
Assert.AreEqual(Color.Red.R, scrollBar.ThumbColor.R, "Should be equals to the set value.");\r
Assert.AreEqual(Color.Red.G, scrollBar.ThumbColor.G, "Should be equals to the set value.");\r
{\r
/* TEST CODE */\r
var scrollBar = new ScrollBar();\r
+ Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar");\r
+ Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar type.");\r
+\r
scrollBar.TrackColor = Color.Green;\r
Assert.AreEqual(Color.Green.R, scrollBar.TrackColor.R, "Should be equals to the set value.");\r
Assert.AreEqual(Color.Green.G, scrollBar.TrackColor.G, "Should be equals to the set value.");\r
{\r
/* TEST CODE */\r
var scrollBar = new ScrollBar();\r
+ Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar");\r
+ Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar type.");\r
+\r
scrollBar.TrackImageURL = _trackImageUrl;\r
Assert.AreEqual(_trackImageUrl, scrollBar.TrackImageURL, "Should be equals to the set value of TrackImageURL.");\r
}\r
{\r
/* TEST CODE */\r
var scrollBar = new ScrollBar();\r
+ Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar");\r
+ Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar type.");\r
+\r
scrollBar.Direction = ScrollBar.DirectionType.Vertical;\r
Assert.AreEqual(ScrollBar.DirectionType.Vertical, scrollBar.Direction, "Should be equals to the set value of Direction.");\r
scrollBar.Direction = ScrollBar.DirectionType.Horizontal;\r
{\r
/* TEST CODE */\r
var scrollBar = new ScrollBar();\r
+ Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar");\r
+ Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar type.");\r
+\r
scrollBar.Duration = 100;\r
Assert.AreEqual(100, scrollBar.Duration, "Should be equals to the set value of Duration.");\r
}\r
{\r
/* TEST CODE */\r
var scrollBar = new ScrollBar();\r
- scrollBar.ThumbSize = new Size2D(50, 50);\r
+ Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar");\r
+ Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar type.");\r
+\r
+ scrollBar.ThumbSize = new Size(50, 50);\r
Assert.AreEqual(50, scrollBar.ThumbSize.Width, "Should be equals to the set value.");\r
Assert.AreEqual(50, scrollBar.ThumbSize.Height, "Should be equals to the set value.");\r
}\r
{\r
/* TEST CODE */\r
var scrollBar = new ScrollBar();\r
+ Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar");\r
+ Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar type.");\r
+\r
scrollBar.MinValue = 0;\r
scrollBar.MaxValue = 100;\r
scrollBar.SetCurrentValue(50);\r
Assert.AreEqual(50, scrollBar.CurrentValue, "Should be equals to the set value of CurrentValue.");\r
}\r
\r
- [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();\r
- Assert.IsNotNull(myScrollBar.TestGetAttributes(), "Should be not null");\r
- Assert.IsInstanceOf<ScrollBarAttributes>(myScrollBar.TestGetAttributes(), "Should be an instance of PaginationAttributes");
- }
-\r
-\r
- [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());
- }
- }\r
-\r
[Test]
[Category("P1")]
[Description("Test Dispose, try to dispose the ScrollBar.")]
/* TEST CODE */
try
{
- ScrollBar scrollBar = new ScrollBar();
+ var scrollBar = new ScrollBar();
+ Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar");\r
+ Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar type.");\r
+\r
scrollBar.Dispose();
}
catch (Exception e)
}
}\r
}\r
-\r
- public class MyScrollBar : ScrollBar\r
- {\r
- public bool updateFlag = false;\r
- public bool themeChanged = false;\r
-\r
- public Attributes TestGetAttributes()\r
- {\r
- return GetAttributes();\r
- }\r
- protected override Attributes GetAttributes()\r
- {\r
- return base.GetAttributes();\r
- }\r
-\r
- protected override void OnUpdate()\r
- {\r
- updateFlag = true;\r
- base.OnUpdate();\r
- }\r
-\r
- protected override void OnThemeChangedEvent(object sender, Tizen.NUI.Components.StyleManager.ThemeChangeEventArgs e)\r
- {\r
- themeChanged = true;\r
- base.OnThemeChangedEvent(sender, e);\r
- }\r
- }\r
-\r
- 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;
- }
- }\r
}\r
+++ /dev/null
-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<ScrollBarAttributes>(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>(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<ImageAttributes>(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<ImageAttributes>(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<ViewAttributes>(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());
- }
- }
- }
-}
+++ /dev/null
-using NUnit.Framework;\r
-using NUnit.Framework.TUnit;\r
-using System;\r
-using Tizen.NUI;\r
-using Tizen.NUI.UIComponents;\r
-using Tizen.NUI.Components;\r
-using System.Runtime.InteropServices;\r
-using System.Threading.Tasks;\r
-using Tizen.NUI.Components.Test;\r
-\r
-namespace Tizen.NUI.Components.Tests\r
-{\r
- [TestFixture]\r
- [Description("Tizen.NUI.Components.SelectButton.SelectEventArgs Tests")]\r
- public class SelectButtonSelectEventArgsTests\r
- {\r
- private const string TAG = "Components";\r
-\r
- [SetUp]\r
- public void Init()\r
- {\r
- Tizen.Log.Info(TAG, "Init() is called!");\r
- App.MainTitleChangeText("SelectButtonSelectEventArgsTests");\r
- App.MainTitleChangeBackgroundColor(null);\r
-\r
- }\r
-\r
- [TearDown]\r
- public void Destroy()\r
- {\r
- Tizen.Log.Info(TAG, "Destroy() is called!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test SelectEventArgs empty constructor. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButton.SelectEventArgs.SelectEventArgs C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("COVPARAM", "")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void SelectEventArgs_CHECK_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectEventArgs = new SelectButton.SelectEventArgs();\r
- Assert.IsNotNull(selectEventArgs, "Should be not null!");\r
- Assert.IsInstanceOf<SelectButton.SelectEventArgs>(selectEventArgs, "Should be equal!");\r
-\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test IsSelected. Check whether IsSelected is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButton.SelectEventArgs.IsSelected A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void IsSelected_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectEventArgs = new SelectButton.SelectEventArgs();\r
- selectEventArgs.IsSelected = true;\r
- Assert.AreEqual(true, selectEventArgs.IsSelected, "Should be equal");\r
- selectEventArgs.IsSelected = false;\r
- Assert.AreEqual(false, selectEventArgs.IsSelected, "Should be equal");\r
- }\r
- }\r
-}\r
+++ /dev/null
-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;\r
-\r
-namespace Tizen.NUI.Components.Tests\r
-{\r
- [TestFixture]\r
- [Description("Tizen.NUI.Components.SelectButton Tests")]\r
- public class SelectButtonTests\r
- {\r
- private const string TAG = "Components";\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
-\r
- [SetUp]\r
- public void Init()
- {
- Tizen.Log.Info(TAG, "Init() is called!");
- App.MainTitleChangeText("CommonSelectButtonTests");
- App.MainTitleChangeBackgroundColor(null);
-
- }\r
-\r
- [TearDown]
- public void Destroy()
- {
- Tizen.Log.Info(TAG, "Destroy() is called!");
- }\r
-\r
- [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>(selectButton, "Should be equal!");\r
-\r
- }\r
-\r
- [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>(selectButton, "Should be equal!");\r
- }\r
-\r
- [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\r
- {\r
- CheckImageAttributes = new ImageAttributes\r
- {\r
- Size2D = new Size2D(48, 48),\r
- ResourceURL = new StringSelector\r
- {\r
- All = _image_path,\r
- },\r
- Opacity = new FloatSelector\r
- {\r
- Normal = 1.0f,\r
- Selected = 1.0f,\r
- Disabled = 0.4f,\r
- DisabledSelected = 0.4f\r
- },\r
- },\r
- };
- var selectButton = new SelectButton(selectButtonAttributes);
- Assert.IsNotNull(selectButton, "Should be not null!");
- Assert.IsInstanceOf<SelectButton>(selectButton, "Should be equal!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test Index. Check whether Index is readable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButton.Index A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRO")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void Index_CHECK_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButton = new SelectButton();\r
- Assert.AreEqual(-1, selectButton.Index, "Should be equals to default value");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckImageURL. Check whether CheckImageURL is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckImageURL A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckImageURL_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButton = new SelectButton();\r
- selectButton.CheckImageURL = _image_path;\r
- Assert.AreEqual(_image_path, selectButton.CheckImageURL, "Should be equals to the set value of CheckImageURL");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckImageURLSelector. Check whether CheckImageURLSelector is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckImageURLSelector A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckImageURLSelector_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButton = new SelectButton();\r
- var stringSelector = new StringSelector\r
- {\r
- Normal = _image_path,\r
- Selected = _image_path,\r
- };\r
- selectButton.CheckImageURLSelector = stringSelector;\r
- Assert.AreEqual(stringSelector.Normal, selectButton.CheckImageURLSelector.Normal, "Should be equals to the set value of CheckImageURLSelector Normal");\r
- Assert.AreEqual(stringSelector.Selected, selectButton.CheckImageURLSelector.Selected, "Should be equals to the set value of CheckImageURLSelector Selected");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckImageOpacity. Check whether CheckImageOpacity is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckImageOpacity A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckImageOpacity_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButton = new SelectButton();\r
- selectButton.CheckImageOpacity = 1.0f;\r
- Assert.AreEqual(1.0f, selectButton.CheckImageOpacity, "Should be equals to the set value of CheckImageOpacity");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckImageOpacitySelector. Check whether CheckImageOpacitySelector is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckImageOpacitySelector A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckImageOpacitySelector_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButton = new SelectButton();\r
- var floatSelector = new FloatSelector\r
- {\r
- Normal = 0.5f,\r
- Selected = 1.0f,\r
- };\r
- selectButton.CheckImageOpacitySelector = floatSelector;\r
- Assert.AreEqual(floatSelector.Normal, selectButton.CheckImageOpacitySelector.Normal, "Should be equals to the set value of CheckImageOpacitySelector Normal");\r
- Assert.AreEqual(floatSelector.Selected, selectButton.CheckImageOpacitySelector.Selected, "Should be equals to the set value of CheckImageOpacitySelector Selected");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckImageSize2D. Check whether CheckImageSize2D is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckImageSize2D A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckImageSize2D_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButton = new SelectButton();\r
- selectButton.CheckImageSize2D = new Size2D(10, 10);\r
- Assert.AreEqual(10, selectButton.CheckImageSize2D.Width, "Should be equals to the set value of CheckImageSize2D.Width");\r
- Assert.AreEqual(10, selectButton.CheckImageSize2D.Height, "Should be equals to the set value of CheckImageSize2D.Height");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckBackgroundImageURL. Check whether CheckBackgroundImageURL is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckBackgroundImageURL A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckBackgroundImageURL_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButton = new SelectButton();\r
- selectButton.CheckBackgroundImageURL = _image_path;\r
- Assert.AreEqual(_image_path, selectButton.CheckBackgroundImageURL, "Should be equals to the set value of CheckBackgroundImageURL");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckBackgroundImageURLSelector. Check whether CheckBackgroundImageURLSelector is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckBackgroundImageURLSelector A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckBackgroundImageURLSelector_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButton = new SelectButton();\r
- var stringSelector = new StringSelector\r
- {\r
- Normal = _image_path,\r
- Selected = _image_path,\r
- };\r
- selectButton.CheckBackgroundImageURLSelector = stringSelector;\r
- Assert.AreEqual(stringSelector.Normal, selectButton.CheckBackgroundImageURLSelector.Normal, "Should be equals to the set value of CheckBackgroundImageURLSelector Normal");\r
- Assert.AreEqual(stringSelector.Selected, selectButton.CheckBackgroundImageURLSelector.Selected, "Should be equals to the set value of CheckBackgroundImageURLSelector Selected");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckBackgroundImageOpacity. Check whether CheckBackgroundImageOpacity is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckBackgroundImageOpacity A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckBackgroundImageOpacity_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButton = new SelectButton();\r
- selectButton.CheckBackgroundImageOpacity = 1.0f;\r
- Assert.AreEqual(1.0f, selectButton.CheckBackgroundImageOpacity, "Should be equals to the set value of CheckBackgroundImageOpacity");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckBackgroundImageOpacitySelector. Check whether CheckBackgroundImageOpacitySelector is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckBackgroundImageOpacitySelector A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckBackgroundImageOpacitySelector_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButton = new SelectButton();\r
- var floatSelector = new FloatSelector\r
- {\r
- Normal = 0.5f,\r
- Selected = 1.0f,\r
- };\r
- selectButton.CheckBackgroundImageOpacitySelector = floatSelector;\r
- Assert.AreEqual(floatSelector.Normal, selectButton.CheckBackgroundImageOpacitySelector.Normal, "Should be equals to the set value of CheckBackgroundImageOpacitySelector Normal");\r
- Assert.AreEqual(floatSelector.Selected, selectButton.CheckBackgroundImageOpacitySelector.Selected, "Should be equals to the set value of CheckBackgroundImageOpacitySelector Selected");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckShadowImageURL. Check whether CheckShadowImageURL is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckShadowImageURL A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckShadowImageURL_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButton = new SelectButton();\r
- selectButton.CheckShadowImageURL = _image_path;\r
- Assert.AreEqual(_image_path, selectButton.CheckShadowImageURL, "Should be equals to the set value of CheckShadowImageURL");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckShadowImageURLSelector. Check whether CheckShadowImageURLSelector is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckShadowImageURLSelector A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckShadowImageURLSelector_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButton = new SelectButton();\r
- var stringSelector = new StringSelector\r
- {\r
- Normal = _image_path,\r
- Selected = _image_path,\r
- };\r
- selectButton.CheckShadowImageURLSelector = stringSelector;\r
- Assert.AreEqual(stringSelector.Normal, selectButton.CheckShadowImageURLSelector.Normal, "Should be equals to the set value of CheckShadowImageURLSelector Normal");\r
- Assert.AreEqual(stringSelector.Selected, selectButton.CheckShadowImageURLSelector.Selected, "Should be equals to the set value of CheckShadowImageURLSelector Selected");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckShadowImageOpacity. Check whether CheckShadowImageOpacity is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckShadowImageOpacity A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckShadowImageOpacity_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButton = new SelectButton();\r
- selectButton.CheckShadowImageOpacity = 1.0f;\r
- Assert.AreEqual(1.0f, selectButton.CheckShadowImageOpacity, "Should be equals to the set value of CheckShadowImageOpacity");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckShadowImageOpacitySelector. Check whether CheckShadowImageOpacitySelector is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckShadowImageOpacitySelector A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckShadowImageOpacitySelector_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButton = new SelectButton();\r
- var floatSelector = new FloatSelector\r
- {\r
- Normal = 0.5f,\r
- Selected = 1.0f,\r
- };\r
- selectButton.CheckShadowImageOpacitySelector = floatSelector;\r
- Assert.AreEqual(floatSelector.Normal, selectButton.CheckShadowImageOpacitySelector.Normal, "Should be equals to the set value of CheckShadowImageOpacitySelector Normal");\r
- Assert.AreEqual(floatSelector.Selected, selectButton.CheckShadowImageOpacitySelector.Selected, "Should be equals to the set value of CheckShadowImageOpacitySelector Selected");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckImagePaddingLeft. Check whether CheckImagePaddingLeft is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckImagePaddingLeft A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckImagePaddingLeft_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButton = new SelectButton();\r
- selectButton.CheckImagePaddingLeft = 10;\r
- Assert.AreEqual(10, selectButton.CheckImagePaddingLeft, "Should be equals to the set value of CheckImagePaddingLeft");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckImagePaddingRight. Check whether CheckImagePaddingRight is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckImagePaddingRight A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckImagePaddingRight_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButton = new SelectButton();\r
- selectButton.CheckImagePaddingRight = 10;\r
- Assert.AreEqual(10, selectButton.CheckImagePaddingRight, "Should be equals to the set value of CheckImagePaddingRight");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckImagePaddingTop. Check whether CheckImagePaddingTop is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckImagePaddingTop A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckImagePaddingTop_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButton = new SelectButton();\r
- selectButton.CheckImagePaddingTop = 10;\r
- Assert.AreEqual(10, selectButton.CheckImagePaddingTop, "Should be equals to the set value of CheckImagePaddingTop");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckImagePaddingBottom. Check whether CheckImagePaddingBottom is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButton.CheckImagePaddingBottom A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckImagePaddingBottom_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButton = new SelectButton();\r
- selectButton.CheckImagePaddingBottom = 10;\r
- Assert.AreEqual(10, selectButton.CheckImagePaddingBottom, "Should be equals to the set value of CheckImagePaddingBottom");\r
- }\r
-\r
- [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")]\r
- public void OnKey_CHECK_RETURN_VALUE()\r
- {\r
- /* TEST CODE */\r
- 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());
- }\r
- }\r
-\r
- public class MySelectButton : SelectButton\r
- {\r
- public bool updateFlag = false;\r
- public bool themeFlag = false;\r
-\r
- protected override void OnUpdate()\r
- {\r
- updateFlag = true;\r
- base.OnUpdate();\r
- }\r
-\r
- protected override Attributes GetAttributes()\r
- {\r
- return base.GetAttributes();\r
- }\r
-\r
- public Attributes TestGetAttributes()\r
- {\r
- return GetAttributes();\r
- }\r
-\r
- protected override void OnThemeChangedEvent(object sender, Components.StyleManager.ThemeChangeEventArgs e)\r
- {\r
- themeFlag = true;\r
- base.OnThemeChangedEvent(sender, e);\r
- }\r
-\r
- }\r
-\r
- [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")]\r
- public async Task OnUpdate_CHECK_VALUE()\r
- {\r
- var mySelectButton = new MySelectButton();\r
- mySelectButton.BackgroundColor = Color.Red;\r
- mySelectButton.Size2D = new Size2D(200, 200);\r
- Window.Instance.Add(mySelectButton);\r
- await Task.Delay(500);\r
- Assert.AreEqual(true, mySelectButton.updateFlag, "Should be equal");\r
- }\r
-\r
- [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<SelectButtonAttributes>(attr, "Should be equal!");\r
-\r
- }\r
-\r
- [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")]\r
- public async Task OnThemeChangedEvent_CHECK_VALUE()\r
- {\r
- Tizen.NUI.Components.StyleManager.Instance.Theme = "Utility";\r
- var mySelectButton = new MySelectButton();\r
- Window window = Window.Instance;\r
- window.Add(mySelectButton);\r
- Tizen.NUI.Components.StyleManager.Instance.Theme = "Food";\r
- await Task.Delay(500);\r
- Assert.AreEqual(true, mySelectButton.themeFlag, "OnThemeChangedEvent trigger Check Fail.");\r
- window.Remove(mySelectButton);\r
- }\r
-\r
- [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());
- }
- }
- }\r
-\r
- public class SelectButtonStyle : StyleBase\r
- {\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
- protected override Attributes GetAttributes()\r
- {\r
- SelectButtonAttributes attributes = new SelectButtonAttributes\r
- {\r
- CheckImageAttributes = new ImageAttributes\r
- {\r
- Size2D = new Size2D(48, 48),\r
- Position2D = new Position2D(0, 0),\r
- ResourceURL = new StringSelector\r
- {\r
- Normal = _image_path,\r
- Selected = _image_path,\r
- Disabled = _image_path,\r
- DisabledSelected = _image_path,\r
- },\r
- Opacity = new FloatSelector\r
- {\r
- Normal = 1.0f,\r
- Selected = 1.0f,\r
- Disabled = 0.4f,\r
- DisabledSelected = 0.4f\r
- },\r
- },\r
- };\r
-\r
- return attributes;\r
- }\r
- }\r
-}\r
+++ /dev/null
-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;\r
-\r
-namespace Tizen.NUI.Components.Tests\r
-{\r
- [TestFixture]\r
- [Description("Tizen.NUI.Components.SelectButtonAttributes Tests")]\r
- public class SelectButtonAttributesTests\r
- {\r
- private const string TAG = "Components";\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
-\r
- [SetUp]\r
- public void Init()
- {
- Tizen.Log.Info(TAG, "Init() is called!");
- App.MainTitleChangeText("SelectButtonAttributesTests");
- App.MainTitleChangeBackgroundColor(null);
-
- }\r
-\r
- [TearDown]
- public void Destroy()
- {
- Tizen.Log.Info(TAG, "Destroy() is called!");
- }\r
-\r
- [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>(selectButtonAttributes, "Should be equal!");\r
-\r
- }\r
-\r
- [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()
- {\r
- /* TEST CODE */\r
- var attrs = new SelectButtonAttributes\r
- {\r
- CheckImageAttributes = new ImageAttributes\r
- {\r
- Size2D = new Size2D(48, 48),\r
- ResourceURL = new StringSelector\r
- {\r
- All = _image_path,\r
- },\r
- Opacity = new FloatSelector\r
- {\r
- Normal = 1.0f,\r
- Selected = 1.0f,\r
- Disabled = 0.4f,\r
- DisabledSelected = 0.4f\r
- },\r
- },\r
- };
- var selectButtonAttributes = new SelectButtonAttributes(attrs);
- Assert.IsNotNull(selectButtonAttributes, "Should be not null!");
- Assert.IsInstanceOf<SelectButtonAttributes>(selectButtonAttributes, "Should be equal!");\r
-\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckImageAttributes. Check whether CheckImageAttributes is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButtonAttributes.CheckImageAttributes A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckImageAttributes_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButtonAttributes = new SelectButtonAttributes();\r
- selectButtonAttributes.CheckImageAttributes = new ImageAttributes();\r
- Assert.IsNotNull(selectButtonAttributes.CheckImageAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<ImageAttributes>(selectButtonAttributes.CheckImageAttributes, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckBackgroundImageAttributes. Check whether CheckBackgroundImageAttributes is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButtonAttributes.CheckBackgroundImageAttributes A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckBackgroundImageAttributes_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButtonAttributes = new SelectButtonAttributes();\r
- selectButtonAttributes.CheckBackgroundImageAttributes = new ImageAttributes();\r
- Assert.IsNotNull(selectButtonAttributes.CheckBackgroundImageAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<ImageAttributes>(selectButtonAttributes.CheckBackgroundImageAttributes, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test CheckShadowImageAttributes. Check whether CheckShadowImageAttributes is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectButtonAttributes.CheckShadowImageAttributes A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void CheckShadowImageAttributes_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectButtonAttributes = new SelectButtonAttributes();\r
- selectButtonAttributes.CheckShadowImageAttributes = new ImageAttributes();\r
- Assert.IsNotNull(selectButtonAttributes.CheckShadowImageAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<ImageAttributes>(selectButtonAttributes.CheckShadowImageAttributes, "Should be equals!");\r
- }\r
-\r
- [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")]\r
- public void Clone_CHECK_VALUE()\r
- {\r
- var selectButtonAttributes = new SelectButtonAttributes();\r
- selectButtonAttributes.IsSelectable = true;\r
- var attr = selectButtonAttributes.Clone() as SelectButtonAttributes;\r
- Assert.IsNotNull(attr, "Should be not null!");\r
- Assert.IsInstanceOf<SelectButtonAttributes>(attr, "Should be an instance of SelectButtonAttributes!");\r
- Assert.AreEqual(true, attr.IsSelectable, "Should be equal!");\r
- }\r
-\r
- }\r
-}\r
+++ /dev/null
-using NUnit.Framework;\r
-using NUnit.Framework.TUnit;\r
-using System;\r
-using Tizen.NUI;\r
-using Tizen.NUI.UIComponents;\r
-using Tizen.NUI.Components;\r
-using System.Runtime.InteropServices;\r
-using System.Threading.Tasks;\r
-using Tizen.NUI.Components.Test;\r
-\r
-namespace Tizen.NUI.Components.Tests\r
-{\r
- [TestFixture]\r
- [Description("Tizen.NUI.Components.SelectGroup.SelectGroupEventArgs Tests")]\r
- public class SelectGroupEventArgsTests\r
- {\r
- private const string TAG = "Components";\r
-\r
- [SetUp]\r
- public void Init()\r
- {\r
- Tizen.Log.Info(TAG, "Init() is called!");\r
- App.MainTitleChangeText("SelectGroupEventArgsTests");\r
- App.MainTitleChangeBackgroundColor(null);\r
-\r
- }\r
-\r
- [TearDown]\r
- public void Destroy()\r
- {\r
- Tizen.Log.Info(TAG, "Destroy() is called!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test SelectGroupEventArgs empty constructor. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectGroup.SelectGroupEventArgs.SelectGroupEventArgs C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("COVPARAM", "")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void SelectGroupEventArgs_CHECK_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectGroupEventArgs = new SelectGroup.SelectGroupEventArgs();\r
- Assert.IsNotNull(selectGroupEventArgs, "Should be not null!");\r
- Assert.IsInstanceOf<SelectGroup.SelectGroupEventArgs>(selectGroupEventArgs, "Should be equal!");\r
-\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test SelectedIndex. Check whether SelectedIndex is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectGroup.SelectGroupEventArgs.SelectedIndex A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void SelectedIndex_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var selectGroupEventArgs = new Components.SelectGroup.SelectGroupEventArgs();\r
- selectGroupEventArgs.SelectedIndex = 1;\r
- Assert.AreEqual(1, selectGroupEventArgs.SelectedIndex, "Should be equal");\r
- }\r
- }\r
-}\r
+++ /dev/null
-using NUnit.Framework;\r
-using NUnit.Framework.TUnit;\r
-using System;\r
-using Tizen.NUI;\r
-using Tizen.NUI.UIComponents;\r
-using Tizen.NUI.Components;\r
-using System.Runtime.InteropServices;\r
-using System.Threading.Tasks;\r
-using Tizen.NUI.Components.Test;\r
-\r
-namespace Tizen.NUI.Components.Tests\r
-{\r
- [TestFixture]\r
- [Description("Tizen.NUI.Components.SelectGroup Tests")]\r
- public class SelectGroupTests\r
- {\r
- private const string TAG = "Components";\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
-\r
- [SetUp]\r
- public void Init()\r
- {\r
- Tizen.Log.Info(TAG, "Init() is called!");\r
- App.MainTitleChangeText("CommonSelectGroupTests");\r
- App.MainTitleChangeBackgroundColor(null);\r
-\r
- }\r
-\r
- [TearDown]\r
- public void Destroy()\r
- {\r
- Tizen.Log.Info(TAG, "Destroy() is called!");\r
- }\r
-\r
- public class MySelectGroup : SelectGroup\r
- {\r
- public MySelectGroup() : base() { }\r
-\r
- public void TestAddSelection(SelectButton selectButton)\r
- {\r
- base.AddSelection(selectButton);\r
- }\r
-\r
- public void TestRemoveSelection(SelectButton selectButton)\r
- {\r
- base.RemoveSelection(selectButton);\r
-\r
- }\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test SelectGroup. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectGroup.SelectGroup C")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "CONSTR")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void SelectGroup_CHECK_VALUE()\r
- {\r
- var checkBoxGroup = new CheckBoxGroup();\r
- Assert.IsNotNull(checkBoxGroup, "Should be not null!");\r
- Assert.IsInstanceOf<SelectGroup>(checkBoxGroup, "Should be equal!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test Count. Check whether Count is readable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectGroup.Count A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRO")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void Count_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var checkBox1 = new CheckBox();\r
- checkBox1.Name = "checkbox1";\r
-\r
- var checkBoxGroup = new CheckBoxGroup();\r
- checkBoxGroup.Add(checkBox1);\r
-\r
- Assert.AreEqual(1, checkBoxGroup.Count, "Should be equals to checkBoxGroup.Count");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test SelectedIndex. Check whether SelectedIndex is readable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectGroup.SelectedIndex A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRO")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void SelectedIndex_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var checkBox1 = new CheckBox();\r
- checkBox1.Name = "checkbox1";\r
-\r
- var checkBoxGroup = new CheckBoxGroup();\r
- checkBoxGroup.Add(checkBox1);\r
-\r
- Assert.AreEqual(0, checkBoxGroup.SelectedIndex, "Should be equal!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test Contains. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectGroup.Contains M")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "MR")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void Contains_CHECK_VALUE()\r
- {\r
- var checkBox1 = new CheckBox();\r
- checkBox1.Name = "checkbox1";\r
-\r
- var checkBoxGroup = new CheckBoxGroup();\r
- checkBoxGroup.Add(checkBox1);\r
-\r
- bool flag = checkBoxGroup.Contains(checkBox1);\r
-\r
- Assert.AreEqual(true, flag, "Should be true");\r
-\r
- var checkBox2 = new CheckBox();\r
- checkBox2.Name = "checkbox2";\r
- flag = checkBoxGroup.Contains(checkBox2);\r
-\r
- Assert.AreEqual(false, flag, "Should be false!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test GetIndex. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectGroup.GetIndex M")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "MR")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void GetIndex_CHECK_VALUE()\r
- {\r
- var checkBox1 = new CheckBox();\r
- checkBox1.Name = "checkbox1";\r
-\r
- var checkBoxGroup = new CheckBoxGroup();\r
- checkBoxGroup.Add(checkBox1);\r
-\r
- int index = checkBoxGroup.GetIndex(checkBox1);\r
-\r
- Assert.AreEqual(0, index, "Should be same with index");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test AddSelection. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectGroup.AddSelection M")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "MCST")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void AddSelection_CHECK_VALUE()\r
- {\r
- var mySelectGroup = new MySelectGroup();\r
- var selectButton = new SelectButton();\r
- mySelectGroup.TestAddSelection(selectButton);\r
-\r
- bool flag = mySelectGroup.Contains(selectButton);\r
-\r
- Assert.AreEqual(true, flag, "Should be equal");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test RemoveSelection. Check it has been triggered")]\r
- [Property("SPEC", "Tizen.NUI.Components.SelectGroup.RemoveSelection M")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "MCST")]\r
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void RemoveSelection_CHECK_VALUE()\r
- {\r
- var mySelectGroup = new MySelectGroup();\r
- var selectButton = new SelectButton();\r
- mySelectGroup.TestAddSelection(selectButton);\r
- mySelectGroup.TestRemoveSelection(selectButton);\r
-\r
- bool flag = mySelectGroup.Contains(selectButton);\r
-\r
- Assert.AreEqual(false, flag, "Should be equal");\r
- }\r
- }\r
-}\r
+++ /dev/null
-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\r
-{\r
- [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!");
- }\r
-
- [Test]
- [Category("P1")]
- [Description("Create a Selector object. Check whether object is successfully created or not.")]
- [Property("SPEC", "Tizen.NUI.Components.Selector<T>.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<int?>();
- Assert.IsNotNull(selector, "Can't create success object Selector");
- Assert.IsInstanceOf<Selector<int?>>(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<T>.All A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void All_GET_SET_VALUE()
- {\r
- /* TEST CODE */\r
- var selector = new Selector<int?>();\r
- selector.All = 1;\r
- 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<T>.Normal A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void Normal_GET_SET_VALUE()
- {\r
- /* TEST CODE */\r
- var selector = new Selector<int?>();\r
- selector.Normal = 1;\r
- 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<T>.Pressed A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void Pressed_GET_SET_VALUE()
- {\r
- /* TEST CODE */\r
- var selector = new Selector<int?>();\r
- selector.Pressed = 1;\r
- 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<T>.Focused A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void Focused_GET_SET_VALUE()
- {\r
- /* TEST CODE */\r
- var selector = new Selector<int?>();\r
- selector.Focused = 1;\r
- 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<T>.Selected A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void Selected_GET_SET_VALUE()
- {\r
- /* TEST CODE */\r
- var selector = new Selector<int?>();\r
- selector.Selected = 1;\r
- 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<T>.Disabled A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void Disabled_GET_SET_VALUE()
- {\r
- /* TEST CODE */\r
- var selector = new Selector<int?>();\r
- selector.Disabled = 1;\r
- 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<T>.DisabledFocused A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void DisabledFocused_GET_SET_VALUE()
- {\r
- /* TEST CODE */\r
- var selector = new Selector<int?>();\r
- selector.DisabledFocused = 1;\r
- 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<T>.SelectedFocused A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void SelectedFocused_GET_SET_VALUE()
- {\r
- /* TEST CODE */\r
- var selector = new Selector<int?>();\r
- selector.SelectedFocused = 1;\r
- 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<T>.DisabledSelected A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void DisabledSelected_GET_SET_VALUE()
- {\r
- /* TEST CODE */\r
- var selector = new Selector<int?>();\r
- selector.DisabledSelected = 1;\r
- 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<T>.Other A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void Other_GET_SET_VALUE()
- {\r
- /* TEST CODE */\r
- var selector = new Selector<int?>();\r
- selector.Other = 1;\r
- 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<T>.GetValue M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void GetValue_GET_SET_VALUE()
- {\r
- /* TEST CODE */\r
- var selector = new Selector<int?>();\r
- selector.Focused = 1;\r
- 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<T>.Clone M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void Clone_GET_SET_VALUE()
- {\r
- /* TEST CODE */\r
- var selector = new Selector<int?>();\r
- selector.Focused = 1;\r
- var selector2 = new Selector<int?>();\r
- selector2.Clone(selector);\r
- Assert.AreEqual(1, selector2.Focused, "Should be equal!");
- }
-
- }
-}
public void CurrentValue_SET_GET_VALUE()
{
var eventArgs = new Slider.SlidingFinishedArgs();
+ Assert.IsNotNull(eventArgs, "Should be not null!");
+ Assert.IsInstanceOf<Slider.SlidingFinishedArgs>(eventArgs, "Should return SlidingFinishedArgs instance.");
+
eventArgs.CurrentValue = 100.0f;
Assert.AreEqual(100.0f, eventArgs.CurrentValue, "Retrieved CurrentValue should be equal to set value.");
}
public void CurrentState_SET_GET_VALUE()
{
var eventArgs = new Slider.StateChangedArgs();
+ Assert.IsNotNull(eventArgs, "Should be not null!");
+ Assert.IsInstanceOf<Slider.StateChangedArgs>(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;
public void CurrentValue_SET_GET_VALUE()
{
var eventArgs = new Slider.ValueChangedArgs();
+ Assert.IsNotNull(eventArgs, "Should be not null!");
+ Assert.IsInstanceOf<Slider.ValueChangedArgs>(eventArgs, "Should return ValueChangedArgs instance.");
+
eventArgs.CurrentValue = 100.0f;
Assert.AreEqual(100.0f, eventArgs.CurrentValue, "Retrieved CurrentValue should be equal to set value.");
}
{
var slider = new Slider();
Assert.IsNotNull(slider, "Can't create success object Slider");
- Assert.IsInstanceOf<Slider>(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>(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>(slider, "Should be an instance of Slider type.");
+ Assert.IsInstanceOf<Slider>(slider, "Costruct Slider Fail");
}
[Test]
public void Direction_SET_GET_VALUE()
{
var slider = new Slider();
+ Assert.IsNotNull(slider, "Can't create success object Slider");
+ Assert.IsInstanceOf<Slider>(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;
public void Indicator_SET_GET_VALUE()
{
var slider = new Slider();
+ Assert.IsNotNull(slider, "Can't create success object Slider");
+ Assert.IsInstanceOf<Slider>(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;
public void MinValue_SET_GET_VALUE()
{
var slider = new Slider();
+ Assert.IsNotNull(slider, "Can't create success object Slider");
+ Assert.IsInstanceOf<Slider>(slider, "Costruct Slider Fail");
+
slider.MinValue = 1;
Assert.AreEqual(1, slider.MinValue, "Retrieved MinValue should be equal to set value.");
}
public void MaxValue_SET_GET_VALUE()
{
var slider = new Slider();
+ Assert.IsNotNull(slider, "Can't create success object Slider");
+ Assert.IsInstanceOf<Slider>(slider, "Costruct Slider Fail");
+
slider.MaxValue = 100;
Assert.AreEqual(100, slider.MaxValue, "Retrieved MaxValue should be equal to set value.");
}
public void CurrentValue_SET_GET_VALUE()
{
var slider = new Slider();
+ Assert.IsNotNull(slider, "Can't create success object Slider");
+ Assert.IsInstanceOf<Slider>(slider, "Costruct Slider Fail");
+
slider.CurrentValue = 50;
Assert.AreEqual(50, slider.CurrentValue, "Retrieved CurrentValue should be equal to set value.");
}
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>(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.")]
{
/* TEST CODE */
var slider = new Slider();
+ Assert.IsNotNull(slider, "Can't create success object Slider");
+ Assert.IsInstanceOf<Slider>(slider, "Costruct Slider Fail");
+
slider.ThumbImageURL = "sliderurl";
Assert.AreEqual("sliderurl", slider.ThumbImageURL, "Retrieved ThumbImageURL should be equal to set value");
}
public void ThumbImageURLSelector_SET_GET_VALUE()
{
var slider = new Slider();
+ Assert.IsNotNull(slider, "Can't create success object Slider");
+ Assert.IsInstanceOf<Slider>(slider, "Costruct Slider Fail");
+
slider.ThumbImageURLSelector = new StringSelector(){All="background"};
Assert.AreEqual("background", slider.ThumbImageURLSelector.All, "Retrieved ThumbImageURLSelector should be equal to set value.");
}
{
/* TEST CODE */
var slider = new Slider();
- Color color = Color.Red;
+ Assert.IsNotNull(slider, "Can't create success object Slider");
+ Assert.IsInstanceOf<Slider>(slider, "Costruct Slider Fail");
+
+ var color = Color.Red;
+ Assert.IsNotNull(color, "Should be not null!");
+ Assert.IsInstanceOf<Color>(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");
{
/* TEST CODE */
var slider = new Slider();
- Color color = Color.Red;
+ Assert.IsNotNull(slider, "Can't create success object Slider");
+ Assert.IsInstanceOf<Slider>(slider, "Costruct Slider Fail");
+
+ var color = Color.Red;
+ Assert.IsNotNull(color, "Should be not null!");
+ Assert.IsInstanceOf<Color>(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");
{
/* TEST CODE */
var slider = new Slider();
+ Assert.IsNotNull(slider, "Can't create success object Slider");
+ Assert.IsInstanceOf<Slider>(slider, "Costruct Slider Fail");
+
slider.TrackThickness = 20;
Assert.AreEqual(20, slider.TrackThickness, "Retrieved TrackThickness should be equal to set value");
}
{
/* TEST CODE */
var slider = new Slider();
+ Assert.IsNotNull(slider, "Can't create success object Slider");
+ Assert.IsInstanceOf<Slider>(slider, "Costruct Slider Fail");
+
slider.LowIndicatorImageURL = "sliderurl";
Assert.AreEqual("sliderurl", slider.LowIndicatorImageURL, "Retrieved LowIndicatorImageURL should be equal to set value");
}
{
/* TEST CODE */
var slider = new Slider();
+ Assert.IsNotNull(slider, "Can't create success object Slider");
+ Assert.IsInstanceOf<Slider>(slider, "Costruct Slider Fail");
+
slider.HighIndicatorImageURL = "sliderurl";
Assert.AreEqual("sliderurl", slider.HighIndicatorImageURL, "Retrieved HighIndicatorImageURL should be equal to set value");
}
{
/* TEST CODE */
var slider = new Slider();
+ Assert.IsNotNull(slider, "Can't create success object Slider");
Assert.IsInstanceOf<Slider>(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");
{
/* TEST CODE */
var slider = new Slider();
+ Assert.IsNotNull(slider, "Can't create success object Slider");
Assert.IsInstanceOf<Slider>(slider, "Should be an instance of Slider type");
slider.HighIndicatorTextContent = "hinttext";
Assert.AreEqual("hinttext", slider.HighIndicatorTextContent, "Retrieved HighIndicatorTextContent should be equal to set value");
{
/* TEST CODE */
var slider = new Slider();
+ Assert.IsNotNull(slider, "Can't create success object Slider");
Assert.IsInstanceOf<Slider>(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");
}
{
/* TEST CODE */
var slider = new Slider();
+ Assert.IsNotNull(slider, "Can't create success object Slider");
Assert.IsInstanceOf<Slider>(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");
}
{
/* TEST CODE */
var slider = new Slider();
+ Assert.IsNotNull(slider, "Can't create success object Slider");
+ Assert.IsInstanceOf<Slider>(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.")]
/* TEST CODE */
try
{
- Slider slider = new Slider();
+ var slider = new Slider();
+ Assert.IsNotNull(slider, "Can't create success object Slider");
+ Assert.IsInstanceOf<Slider>(slider, "Should be an instance of Slider type");
+
slider.Dispose();
}
catch (Exception e)
}
}
}
-
- 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;
- }
- }
}
+++ /dev/null
-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>(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<SliderAttributes>(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");
- }
- }
-}
+++ /dev/null
-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>(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);
- }
- }
-}
+++ /dev/null
-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>(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<Attributes>(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();
- }
- }
-}
+++ /dev/null
-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<Components.StyleManager.ThemeChangeEventArgs>(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!");
- }
- }
-}
+++ /dev/null
-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<Components.StyleManager>(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>(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;
- }
- }
-}
{\r
/* TEST CODE */\r
var selectEventArgs = new Switch.SelectEventArgs();\r
+ Assert.IsNotNull(selectEventArgs, "Should be not null!");\r
+ Assert.IsInstanceOf<Switch.SelectEventArgs>(selectEventArgs, "Should be equal!");\r
+\r
selectEventArgs.IsSelected = true;\r
Assert.AreEqual(true, selectEventArgs.IsSelected, "Should be equal");\r
selectEventArgs.IsSelected = false;\r
\r
[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>(_switch, "Should be equal!");\r
- }\r
-\r
- [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()
- {\r
- /* TEST CODE */\r
- var attrs = new SwitchAttributes\r
- {\r
- IsSelectable = true,\r
- SwitchBackgroundImageAttributes = new ImageAttributes\r
- {\r
- ResourceURL = new StringSelector\r
- {\r
- All = _image_path\r
- },\r
- },\r
- SwitchHandlerImageAttributes = new ImageAttributes\r
- {\r
- Size2D = new Size2D(60, 60),\r
- ResourceURL = new StringSelector\r
- {\r
- All = _image_path\r
- },\r
- },\r
- };
- var _switch = new Switch(attrs);
- Assert.IsNotNull(_switch, "Should be not null!");
- Assert.IsInstanceOf<Switch>(_switch, "Should be equal!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test SwitchBackgroundImageURL. Check whether SwitchBackgroundImageURL is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Switch.SwitchBackgroundImageURL A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void SwitchBackgroundImageURL_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var _switch = new Switch();\r
- _switch.SwitchBackgroundImageURL = _image_path;\r
- Assert.AreEqual(_image_path, _switch.SwitchBackgroundImageURL, "Should be equals to the set value of SwitchBackgroundImageURL");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
[Description("Test SwitchBackgroundImageURLSelector. Check whether SwitchBackgroundImageURLSelector is readable and writable.")]\r
[Property("SPEC", "Tizen.NUI.Components.Switch.SwitchBackgroundImageURLSelector A")]\r
[Property("SPEC_URL", "-")]\r
{\r
/* TEST CODE */\r
var _switch = new Switch();\r
+ Assert.IsNotNull(_switch, "Should be not null!");
+ Assert.IsInstanceOf<Switch>(_switch, "Should be equal!");
+
StringSelector stringSelector = new StringSelector\r
{\r
Normal = _image_path,\r
Selected = _image_path,\r
};\r
+ Assert.IsNotNull(stringSelector, "Should be not null!");
+ Assert.IsInstanceOf<StringSelector>(stringSelector, "Should be equal!");
+
_switch.SwitchBackgroundImageURLSelector = stringSelector;\r
Assert.AreEqual(stringSelector.Normal, _switch.SwitchBackgroundImageURLSelector.Normal, "Should be equals to the set value of SwitchBackgroundImageURLSelector Normal");\r
Assert.AreEqual(stringSelector.Selected, _switch.SwitchBackgroundImageURLSelector.Selected, "Should be equals to the set value of SwitchBackgroundImageURLSelector Selected");\r
{\r
/* TEST CODE */\r
var _switch = new Switch();\r
+ Assert.IsNotNull(_switch, "Should be not null!");
+ Assert.IsInstanceOf<Switch>(_switch, "Should be equal!");
+
_switch.SwitchHandlerImageURL = _image_path;\r
Assert.AreEqual(_image_path, _switch.SwitchHandlerImageURL, "Should be equals to the set value of SwitchHandlerImageURL");\r
}\r
{\r
/* TEST CODE */\r
var _switch = new Switch();\r
+ Assert.IsNotNull(_switch, "Should be not null!");
+ Assert.IsInstanceOf<Switch>(_switch, "Should be equal!");
+
StringSelector stringSelector = new StringSelector\r
{\r
Normal = _image_path,\r
Selected = _image_path,\r
};\r
+ Assert.IsNotNull(stringSelector, "Should be not null!");
+ Assert.IsInstanceOf<StringSelector>(stringSelector, "Should be equal!");
+
_switch.SwitchHandlerImageURLSelector = stringSelector;\r
Assert.AreEqual(stringSelector.Normal, _switch.SwitchHandlerImageURLSelector.Normal, "Should be equals to the set value of SwitchHandlerImageURLSelector Normal");\r
Assert.AreEqual(stringSelector.Selected, _switch.SwitchHandlerImageURLSelector.Selected, "Should be equals to the set value of SwitchHandlerImageURLSelector Selected");\r
\r
[Test]\r
[Category("P1")]\r
- [Description("Test SwitchHandlerImageSize2D. Check whether SwitchHandlerImageSize2D is readable and writable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.Switch.SwitchHandlerImageSize2D A")]\r
+ [Description("Test SwitchHandlerImageSize. Check whether SwitchHandlerImageSize is readable and writable.")]\r
+ [Property("SPEC", "Tizen.NUI.Components.Switch.SwitchHandlerImageSize A")]\r
[Property("SPEC_URL", "-")]\r
[Property("CRITERIA", "PRW")]
[Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void SwitchHandlerImageSize2D_SET_GET_VALUE()\r
+ public void SwitchHandlerImageSize_SET_GET_VALUE()\r
{\r
/* TEST CODE */\r
var _switch = new Switch();\r
- _switch.SwitchHandlerImageSize2D = new Size2D(10, 10);\r
- Assert.AreEqual(10, _switch.SwitchHandlerImageSize2D.Width, "Should be equals to the set value of SwitchHandlerImageSize2D.Width");\r
- Assert.AreEqual(10, _switch.SwitchHandlerImageSize2D.Height, "Should be equals to the set value of SwitchHandlerImageSize2D.Height");\r
- }\r
-\r
- [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")]\r
- public void OnKey_CHECK_RETURN_VALUE()\r
- {\r
- /* TEST CODE */\r
- 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());
- }\r
- }\r
-\r
- [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")]\r
- public async Task OnThemeChangedEvent_CHECK_VALUE()\r
- {\r
- Tizen.NUI.Components.StyleManager.Instance.Theme = "Utility";\r
- var mySwitch = new MySwitch();\r
- Window window = Window.Instance;\r
- window.Add(mySwitch);\r
- Tizen.NUI.Components.StyleManager.Instance.Theme = "Food";\r
- await Task.Delay(500);\r
- Assert.AreEqual(true, mySwitch.ThemeChangeFlag, "OnThemeChangedEvent trigger Check Fail.");\r
- window.Remove(mySwitch);\r
- }\r
-\r
- public class MySwitch : Switch\r
- {\r
- public bool UpdateFlag = false;\r
- public bool ThemeChangeFlag = false;\r
-\r
- protected override void OnUpdate()\r
- {\r
- UpdateFlag = true;\r
- }\r
-\r
- protected override void OnThemeChangedEvent(object sender, Components.StyleManager.ThemeChangeEventArgs e)\r
- {\r
- ThemeChangeFlag = true;\r
- base.OnThemeChangedEvent(sender, e);\r
- }\r
-\r
- protected override Attributes GetAttributes()\r
- {\r
- return base.GetAttributes();\r
- }\r
-\r
- public Attributes TestGetAttributes()\r
- {\r
- return GetAttributes();\r
- }\r
- }\r
-\r
- [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;\r
- mySwitch.Size2D = new Size2D(200, 200);\r
- Window.Instance.Add(mySwitch);\r
- await Task.Delay(500);
- Assert.AreEqual(true, mySwitch.UpdateFlag, "Should be equal!");\r
-\r
- }\r
-\r
- [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<SwitchAttributes>(attr, "Should be equal!");\r
-\r
+ Assert.IsNotNull(_switch, "Should be not null!");
+ Assert.IsInstanceOf<Switch>(_switch, "Should be equal!");
+
+ _switch.SwitchHandlerImageSize = new Size(10, 10);\r
+ Assert.AreEqual(10, _switch.SwitchHandlerImageSize.Width, "Should be equals to the set value of SwitchHandlerImageSize2D.Width");\r
+ Assert.AreEqual(10, _switch.SwitchHandlerImageSize.Height, "Should be equals to the set value of SwitchHandlerImageSize2D.Height");\r
}\r
\r
[Test]
/* TEST CODE */
try
{
- Switch mySwitch = new Switch();
+ var mySwitch = new Switch();
+ Assert.IsNotNull(mySwitch, "Should be not null!");
+ Assert.IsInstanceOf<Switch>(mySwitch, "Should be equal!");
+
mySwitch.Dispose();
}
catch (Exception e)
}
}\r
}\r
-\r
- public class SwitchStyle : StyleBase\r
- {\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
- protected override Attributes GetAttributes()\r
- {\r
- SwitchAttributes attributes = new SwitchAttributes\r
- {\r
- IsSelectable = true,\r
- SwitchBackgroundImageAttributes = new ImageAttributes\r
- {\r
- Size2D = new Size2D(96, 60),\r
- ResourceURL = new StringSelector\r
- {\r
- All = _image_path\r
- },\r
- },\r
- SwitchHandlerImageAttributes = new ImageAttributes\r
- {\r
- Size2D = new Size2D(60, 60),\r
- ResourceURL = new StringSelector\r
- {\r
- All = _image_path\r
- },\r
- },\r
- };\r
-\r
- return attributes;\r
- }\r
- }\r
}\r
+++ /dev/null
-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;\r
-\r
-namespace Tizen.NUI.Components.Tests\r
-{\r
- [TestFixture]\r
- [Description("Tizen.NUI.Components.SwitchAttributes Tests")]\r
- public class SwitchAttributesTests\r
- {\r
- private const string TAG = "Components";\r
- private string _image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";\r
-\r
- [SetUp]\r
- public void Init()
- {
- Tizen.Log.Info(TAG, "Init() is called!");
- App.MainTitleChangeText("SwitchAttributesTests");
- App.MainTitleChangeBackgroundColor(null);
-
- }\r
-\r
- [TearDown]
- public void Destroy()
- {
- Tizen.Log.Info(TAG, "Destroy() is called!");
- }\r
-\r
- [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>(switchAttributes, "Should be equal!");\r
-\r
- }\r
-\r
- [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()
- {\r
- /* TEST CODE */\r
- var attrs = new SwitchAttributes\r
- {\r
- IsSelectable = true,\r
- SwitchBackgroundImageAttributes = new ImageAttributes\r
- {\r
- ResourceURL = new StringSelector\r
- {\r
- All = _image_path\r
- },\r
- },\r
- SwitchHandlerImageAttributes = new ImageAttributes\r
- {\r
- Size2D = new Size2D(60, 60),\r
- ResourceURL = new StringSelector\r
- {\r
- All = _image_path\r
- },\r
- },\r
- };
- var switchAttributes = new SwitchAttributes(attrs);
- Assert.IsNotNull(switchAttributes, "Should be not null!");
- Assert.IsInstanceOf<SwitchAttributes>(switchAttributes, "Should be equal!");\r
-\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test SwitchHandlerImageAttributes. Check whether SwitchHandlerImageAttributes is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SwitchAttributes.SwitchHandlerImageAttributes A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void SwitchHandlerImageAttributes_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var switchAttributes = new SwitchAttributes();\r
- switchAttributes.SwitchHandlerImageAttributes = new ImageAttributes();\r
- Assert.IsNotNull(switchAttributes.SwitchHandlerImageAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<ImageAttributes>(switchAttributes.SwitchHandlerImageAttributes, "Should be equals!");\r
- }\r
-\r
- [Test]\r
- [Category("P1")]\r
- [Description("Test SwitchBackgroundImageAttributes. Check whether SwitchBackgroundImageAttributes is readable and writeable.")]\r
- [Property("SPEC", "Tizen.NUI.Components.SwitchAttributes.SwitchBackgroundImageAttributes A")]\r
- [Property("SPEC_URL", "-")]\r
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Ma Junqing, junqing.ma@samsung.com")]\r
- public void SwitchBackgroundImageAttributes_SET_GET_VALUE()\r
- {\r
- /* TEST CODE */\r
- var switchAttributes = new SwitchAttributes();\r
- switchAttributes.SwitchBackgroundImageAttributes = new ImageAttributes();\r
- Assert.IsNotNull(switchAttributes.SwitchBackgroundImageAttributes, "Should be not null!");\r
- Assert.IsInstanceOf<ImageAttributes>(switchAttributes.SwitchBackgroundImageAttributes, "Should be equals!");\r
- }\r
-\r
- [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")]\r
- public void Clone_CHECK_VALUE()\r
- {\r
- SwitchAttributes switchAttributes = new SwitchAttributes\r
- {\r
- IsSelectable = true,\r
- SwitchBackgroundImageAttributes = new ImageAttributes\r
- {\r
- ResourceURL = new StringSelector\r
- {\r
- All = _image_path\r
- },\r
- },\r
- SwitchHandlerImageAttributes = new ImageAttributes\r
- {\r
- Size2D = new Size2D(60, 60),\r
- ResourceURL = new StringSelector\r
- {\r
- All = _image_path\r
- },\r
- },\r
- };\r
- var attr = switchAttributes.Clone() as SwitchAttributes;\r
- Assert.IsNotNull(attr, "Should be not null!");\r
- Assert.IsInstanceOf<SwitchAttributes>(attr, "Should be equals!");\r
- Assert.AreEqual(_image_path, attr.SwitchHandlerImageAttributes.ResourceURL.All, "Should be equals!");\r
-\r
- }\r
- }\r
-}\r
+++ /dev/null
-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<Tab.ItemChangeEventArgs>(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.");
- }
- }
-}
--- /dev/null
+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<Tab.ItemChangedEventArgs>(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<Tab.ItemChangedEventArgs>(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<Tab.ItemChangedEventArgs>(eventArgs, "Should return ItemChangedEventArgs instance.");
+
+ eventArgs.CurrentIndex = 2;
+ Assert.AreEqual(2, eventArgs.CurrentIndex, "Retrieved CurrentIndex should be equal to set value.");
+ }
+ }
+}
public void Text_SET_GET_VALUE()
{
var tabItemData = new Tab.TabItemData();
+ Assert.IsNotNull(tabItemData, "Can't create success object TabItemData");
+ Assert.IsInstanceOf<Tab.TabItemData>(tabItemData, "Should be an instance of TabItemData type.");
+
tabItemData.Text = "Main";
Assert.AreEqual("Main", tabItemData.Text, "Retrieved Text should be equal to set value");
}
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;
}
[Property("COVPARAM", "")]
public void Tab_INIT()
{
- var temp_view = new Tab();
- Assert.IsNotNull(temp_view, "Should be not null!");
- Assert.IsInstanceOf<Tab>(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>(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>(tab, "Should be an instance of Tab type.");
+ var tab = new Tab();
+ Assert.IsNotNull(tab, "Should be not null!");
+ Assert.IsInstanceOf<Tab>(tab, "Should return Tab instance.");
}
[Test]
{
/* TEST CODE */
var tab = new Tab();
+ Assert.IsNotNull(tab, "Should be not null!");
+ Assert.IsInstanceOf<Tab>(tab, "Should return Tab instance.");
+
tab.SelectedItemIndex = 0;
Assert.AreEqual(0, tab.SelectedItemIndex, "Retrieved SelectedItemIndex should be equal to set value");
}
[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>(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>(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>(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>(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>(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>(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>(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]
{
/* TEST CODE */
var tab = new Tab();
- Color color = Color.Red;
+ Assert.IsNotNull(tab, "Should be not null!");
+ Assert.IsInstanceOf<Tab>(tab, "Should be an instance of Tab type");
+
+ var color = Color.Red;
+ Assert.IsNotNull(color, "Should be not null!");
+ Assert.IsInstanceOf<Color>(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");
{
/* TEST CODE */
var tab = new Tab();
+ Assert.IsNotNull(tab, "Should be not null!");
+ Assert.IsInstanceOf<Tab>(tab, "Should be an instance of Tab type");
+
tab.PointSize = 38;
Assert.AreEqual(38, tab.PointSize, "Should be equal!");
{
/* TEST CODE */
var tab = new Tab();
+ Assert.IsNotNull(tab, "Should be not null!");
+ Assert.IsInstanceOf<Tab>(tab, "Should be an instance of Tab type");
+
tab.FontFamily = "FontFamily";
Assert.AreEqual("FontFamily", tab.FontFamily, "Should be equal!");
}
{
/* TEST CODE */
var tab = new Tab();
- Color color = Color.Red;
+ Assert.IsNotNull(tab, "Should be not null!");
+ Assert.IsInstanceOf<Tab>(tab, "Should be an instance of Tab type");
+
+ var color = Color.Red;
+ Assert.IsNotNull(color, "Should be not null!");
+ Assert.IsInstanceOf<Color>(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");
{
/* TEST CODE */
var tab = new Tab();
- Color color = Color.Red;
+ Assert.IsNotNull(tab, "Should be not null!");
+ Assert.IsInstanceOf<Tab>(tab, "Should be an instance of Tab type");
+
+ var color = Color.Red;
+ Assert.IsNotNull(color, "Should be not null!");
+ Assert.IsInstanceOf<Color>(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");
try
{
var tab = new Tab();\r
+ Assert.IsNotNull(tab, "Should be not null!");
+ Assert.IsInstanceOf<Tab>(tab, "Should be an instance of Tab type");
+
var temActor = new View();\r
+ Assert.IsNotNull(temActor, "Should be not null!");
+ Assert.IsInstanceOf<View>(temActor, "Should be an instance of View type");
+
temActor.Name = "ChildActor";\r
tab.AddItem(new Tab.TabItemData() { Text = "Main" });
}
{
try
{
- var testView = new Tab();\r
+ var tab = new Tab();\r
+ Assert.IsNotNull(tab, "Should be not null!");
+ Assert.IsInstanceOf<Tab>(tab, "Should be an instance of Tab type");
+
var temActor = new View();\r
+ Assert.IsNotNull(temActor, "Should be not null!");
+ Assert.IsInstanceOf<View>(temActor, "Should be an instance of View type");
+
temActor.Name = "ChildActor";\r
- testView.InsertItem(new Tab.TabItemData() { Text = "" }, 0);
+ tab.InsertItem(new Tab.TabItemData() { Text = "" }, 0);
}
catch (Exception e)
{
{
try
{
- var testView = new Tab();\r
- var temActor = new View();\r
- temActor.Name = "ChildActor";\r
- 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();\r
+ Assert.IsNotNull(tab, "Should be not null!");
+ Assert.IsInstanceOf<Tab>(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();\r
+ Assert.IsNotNull(temActor, "Should be not null!");
+ Assert.IsInstanceOf<View>(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";\r
+ 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]
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
try
{
var tab = new Tab();
+ Assert.IsNotNull(tab, "Should be not null!");
+ Assert.IsInstanceOf<Tab>(tab, "Should be an instance of Tab type");
+
tab.Dispose();
}
catch (Exception e)
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,
+++ /dev/null
-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>(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<TabAttributes>(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");
- }
- }
-}
+++ /dev/null
-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>(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>(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<TextAttributes>(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());
- }
- }
- }
-}
+++ /dev/null
-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>(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<TextFieldAttributes>(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");
- }
- }
-}
Assert.IsInstanceOf<Toast>(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>(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>(toast, "Should be an instance of Toast type.");
- }
-
[Test]
[Category("P1")]
[Description("Test TextArray. Check whether TextArray works or not.")]
{
/* TEST CODE */
var toast = new Toast();
+ Assert.IsNotNull(toast, "Should be not null!");
+ Assert.IsInstanceOf<Toast>(toast, "Should return Toast instance.");
+
string[] textArraySet = new string[] { "aaa", "bbb", "ccc" };
toast.TextArray = textArraySet;
string[] textArrayGet = toast.TextArray;
{
/* TEST CODE */
var toast = new Toast();
+ Assert.IsNotNull(toast, "Should be not null!");
Assert.IsInstanceOf<Toast>(toast, "Should be an instance of Toast type");
toast.PointSize = 10;
Assert.AreEqual(10, toast.PointSize, "Retrieved PointSize should be equal to set value");
{
/* TEST CODE */
var toast = new Toast();
+ Assert.IsNotNull(toast, "Should be not null!");
Assert.IsInstanceOf<Toast>(toast, "Should be an instance of Toast type");
toast.FontFamily = "Test";
Assert.AreEqual("Test", toast.FontFamily, "Retrieved FontFamily should be equal to set value");
{
/* TEST CODE */
var toast = new Toast();
+ Assert.IsNotNull(toast, "Should be not null!");
Assert.IsInstanceOf<Toast>(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<Color>(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");
{
/* TEST CODE */
var toast = new Toast();
+ Assert.IsNotNull(toast, "Should be not null!");
Assert.IsInstanceOf<Toast>(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");
[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>(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>(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>(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]
{
/* TEST CODE */
var toast = new Toast();
+ Assert.IsNotNull(toast, "Should be not null!");
+ Assert.IsInstanceOf<Toast>(toast, "Should be an instance of Toast type");
toast.TextLineHeight = 50;
Assert.AreEqual(50, toast.TextLineHeight, "Retrieved TextLineHeight should be equal to set value");
}
{
/* TEST CODE */
var toast = new Toast();
+ Assert.IsNotNull(toast, "Should be not null!");
+ Assert.IsInstanceOf<Toast>(toast, "Should be an instance of Toast type");
toast.TextLineSpace = 30;
Assert.AreEqual(30, toast.TextLineSpace, "Retrieved TextLineSpace should be equal to set value");
}
{
/* TEST CODE */
var toast = new Toast();
+ Assert.IsNotNull(toast, "Should be not null!");
+ Assert.IsInstanceOf<Toast>(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.")]
/* TEST CODE */
try
{
- Toast toast = new Toast();
+ var toast = new Toast();
+ Assert.IsNotNull(toast, "Should be not null!");
+ Assert.IsInstanceOf<Toast>(toast, "Should be an instance of Toast type");
+
toast.Dispose();
}
catch (Exception e)
}
}
}
-
- 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
+++ /dev/null
-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>(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<ToastAttributes>(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");
- }
- }
-}
+++ /dev/null
-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>(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!");
- }
- }
-}
+++ /dev/null
-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>(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>(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<ViewAttributes>(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());
- }
- }
- }
-}