--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using System.Threading.Tasks;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components.Test;
+
+namespace Tizen.NUI.Components.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.Components.AppBar Tests")]
+ public class AppBarTests
+ {
+ private const string TAG = "Components";
+
+ public AppBarTests()
+ {
+ }
+
+ ~AppBarTests()
+ {
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Create a AppBar object. Check whether AppBar is successfully created or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.AppBar.AppBar C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void AppBar_INIT()
+ {
+ /* TEST CODE */
+ var appBar = new AppBar();
+ Assert.IsNotNull(appBar, "Can't create success object AppBar");
+ Assert.IsInstanceOf<AppBar>(appBar, "Costruct AppBar Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test AppBar constructor using style. Check whether AppBar is successfully created or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.AppBar.AppBar C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "string")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void AppBar_INIT_WITH_STRING()
+ {
+ /* PRECONDITION */
+ StyleManager.Instance.Theme = "default";
+ StyleManager.Instance.RegisterStyle("defaultAppBar", "default", typeof(DefaultAppBarStyle));
+
+ /* TEST CODE */
+ var appBar = new AppBar("defaultAppBar");
+ Assert.IsNotNull(appBar, "Can't create success object AppBar");
+ Assert.IsInstanceOf<AppBar>(appBar, "Costruct AppBar with style Fail");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check exception when constructing a AppBar with null string style.")]
+ [Property("SPEC", "Tizen.NUI.Components.AppBar.AppBar C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("COVPARAM", "string")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void AppBar_INIT_WITH_NULL_STRING_Exception()
+ {
+ /* TEST CODE */
+ try
+ {
+ var appBar = new AppBar("");
+ Assert.Fail("Should throw the Exception: There is null string style!");
+ }
+ catch (InvalidOperationException e)
+ {
+ Assert.Pass("InvalidOperationException: passed!");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test AppBar constructor using style. Check whether AppBar is successfully created or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.AppBar.AppBar C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "AppBarStyle")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void AppBar_INIT_WITH_STYLE()
+ {
+ /* PRECONDITION */
+ var style = new AppBarStyle();
+ Assert.IsNotNull(style, "Can't create success object AppBarStyle");
+ Assert.IsInstanceOf<AppBarStyle>(style, "Costruct AppBarStyle Fail");
+
+ /* TEST CODE */
+ var appBar = new AppBar(style);
+ Assert.IsNotNull(appBar, "Can't create success object AppBar");
+ Assert.IsInstanceOf<AppBar>(appBar, "Costruct AppBar with style Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test AutoNavigationContent. Check whether AutoNavigationContent is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.AppBar.AutoNavigationContent A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void AutoNavigationContent_CHECK_SET_GET_VALUE()
+ {
+ /* PRECONDITION */
+ var appBar = new AppBar();
+ Assert.IsNotNull(appBar, "Can't create success object AppBar");
+ Assert.IsInstanceOf<AppBar>(appBar, "Construct AppBar Fail");
+
+ /* TEST CODE */
+ Assert.AreEqual(true, appBar.AutoNavigationContent, "Retrieved AutoNavigationContent should be equal to 1.");
+
+ bool autoNavigationContent = false;
+ appBar.AutoNavigationContent = autoNavigationContent;
+ Assert.AreEqual(autoNavigationContent, appBar.AutoNavigationContent, "Retrieved AutoNavigationContent should be the same with the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Title. Check whether Title is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.AppBar.Title A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void Title_CHECK_SET_GET_VALUE()
+ {
+ /* PRECONDITION */
+ var appBar = new AppBar();
+ Assert.IsNotNull(appBar, "Can't create success object AppBar");
+ Assert.IsInstanceOf<AppBar>(appBar, "Construct AppBar Fail");
+
+ /* TEST CODE */
+ string title = "NewTitle";
+ appBar.Title = title;
+ Assert.AreEqual(title, appBar.Title, "Retrieved Title should be the same with the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Actions. Check whether Actions is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.AppBar.Actions A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void Actions_CHECK_SET_GET_VALUE()
+ {
+ /* PRECONDITION */
+ var appBar = new AppBar();
+ Assert.IsNotNull(appBar, "Can't create success object AppBar");
+ Assert.IsInstanceOf<AppBar>(appBar, "Construct AppBar Fail");
+
+ /* TEST CODE */
+ View[] actions = new View[] { new View(), new View() };
+ Assert.IsNotNull(actions, "Should not be null");
+
+ appBar.Actions = actions;
+
+ int i = 0;
+ foreach (var action in appBar.Actions)
+ {
+ Assert.AreSame(actions[i], action, "Retrieved Actions should be the same with the set value.");
+ i++;
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test NavigationContent. Check whether NavigationContent is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.AppBar.NavigationContent A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void NavigationContent_CHECK_SET_GET_VALUE()
+ {
+ /* PRECONDITION */
+ var appBar = new AppBar();
+ Assert.IsNotNull(appBar, "Can't create success object AppBar");
+ Assert.IsInstanceOf<AppBar>(appBar, "Construct AppBar Fail");
+
+ /* TEST CODE */
+ View view = new View();
+ Assert.IsNotNull(view, "Should not be null");
+
+ appBar.NavigationContent = view;;
+ Assert.AreEqual(view, appBar.NavigationContent, "Retrieved NavigationContent should be the same with the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test TitleContent. Check whether TitleContent is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.AppBar.TitleContent A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void TitleContent_CHECK_SET_GET_VALUE()
+ {
+ /* PRECONDITION */
+ var appBar = new AppBar();
+ Assert.IsNotNull(appBar, "Can't create success object AppBar");
+ Assert.IsInstanceOf<AppBar>(appBar, "Construct AppBar Fail");
+
+ /* TEST CODE */
+ View view = new View();
+ Assert.IsNotNull(view, "Should not be null");
+
+ appBar.TitleContent = view;;
+ Assert.AreEqual(view, appBar.TitleContent, "Retrieved TitleContent should be the same with the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ActionContent. Check whether ActionContent is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.AppBar.ActionContent A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void ActionContent_CHECK_SET_GET_VALUE()
+ {
+ /* PRECONDITION */
+ var appBar = new AppBar();
+ Assert.IsNotNull(appBar, "Can't create success object AppBar");
+ Assert.IsInstanceOf<AppBar>(appBar, "Construct AppBar Fail");
+
+ /* TEST CODE */
+ View view = new View();
+ Assert.IsNotNull(view, "Should not be null");
+
+ appBar.ActionContent = view;;
+ Assert.AreEqual(view, appBar.ActionContent, "Retrieved ActionContent should be the same with the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ApplyStyle. Check whether ApplyStyle works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.AppBar.ApplyStyle M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void ApplyStyle_CHECK()
+ {
+ try
+ {
+ var appBar = new AppBar();
+ Assert.IsNotNull(appBar, "Should not be null");
+
+ var style = new AppBarStyle();
+ Assert.IsNotNull(style, "Should not be null");
+
+ appBar.ApplyStyle(style);
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+
+ public class DefaultAppBarStyle : StyleBase
+ {
+ protected override ViewStyle GetViewStyle()
+ {
+ return new AppBarStyle();
+ }
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using System.Threading.Tasks;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components.Test;
+
+namespace Tizen.NUI.Components.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.Components.AppBarStyle Tests")]
+ public class AppBarStyleTests
+ {
+ private const string TAG = "Components";
+
+ public AppBarStyleTests()
+ {
+ }
+
+ ~AppBarStyleTests()
+ {
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Create a AppBarStyle object. Check whether AppBarStyle is successfully created or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.AppBarStyle.AppBarStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void AppBarStyle_INIT()
+ {
+ /* TEST CODE */
+ var style = new AppBarStyle();
+ Assert.IsNotNull(style, "Can't create success object AppBarStyle");
+ Assert.IsInstanceOf<AppBarStyle>(style, "Costruct AppBarStyle Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test AppBarStyle constructor using style. Check whether AppBarStyle is successfully created or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.AppBarStyle.AppBarStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "AppBarStyle")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void AppBarStyle_INIT_WITH_STYLE()
+ {
+ /* PRECONDITION */
+ var style1 = new AppBarStyle();
+ Assert.IsNotNull(style1, "Can't create success object AppBarStyle");
+ Assert.IsInstanceOf<AppBarStyle>(style1, "Costruct AppBarStyle Fail");
+
+ /* TEST CODE */
+ var style2 = new AppBarStyle(style1);
+ Assert.IsNotNull(style2, "Can't create success object AppBarStyle");
+ Assert.IsInstanceOf<AppBarStyle>(style2, "Costruct AppBarStyle with style Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test BackButton. Check whether BackButton is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.AppBarStyle.BackButton A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void BackButton_CHECK_SET_GET_VALUE()
+ {
+ /* PRECONDITION */
+ var style = new AppBarStyle();
+ Assert.IsNotNull(style, "Can't create success object AppBarStyle");
+ Assert.IsInstanceOf<AppBarStyle>(style, "Construct AppBarStyle Fail");
+
+ /* TEST CODE */
+ var backButton = new ButtonStyle();
+ Assert.IsNotNull(backButton, "Should not be null");
+
+ style.BackButton = backButton;
+ Assert.AreSame(backButton, style.BackButton, "Retrieved BackButton should be the same with the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test TitleTextLabel. Check whether TitleTextLabel is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.AppBarStyle.TitleTextLabel A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void TitleTextLabel_CHECK_SET_GET_VALUE()
+ {
+ /* PRECONDITION */
+ var style = new AppBarStyle();
+ Assert.IsNotNull(style, "Can't create success object AppBarStyle");
+ Assert.IsInstanceOf<AppBarStyle>(style, "Construct AppBarStyle Fail");
+
+ /* TEST CODE */
+ var titleTextLabel = new TextLabelStyle();
+ Assert.IsNotNull(titleTextLabel, "Should not be null");
+
+ style.TitleTextLabel = titleTextLabel;
+ Assert.AreSame(titleTextLabel, style.TitleTextLabel, "Retrieved TitleTextLabel should be the same with the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ActionView. Check whether ActionView is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.AppBarStyle.ActionView A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void ActionView_CHECK_SET_GET_VALUE()
+ {
+ /* PRECONDITION */
+ var style = new AppBarStyle();
+ Assert.IsNotNull(style, "Can't create success object AppBarStyle");
+ Assert.IsInstanceOf<AppBarStyle>(style, "Construct AppBarStyle Fail");
+
+ /* TEST CODE */
+ var actionView = new ViewStyle();
+ Assert.IsNotNull(actionView, "Should not be null");
+
+ style.ActionView = actionView;
+ Assert.AreSame(actionView, style.ActionView, "Retrieved ActionView should be the same with the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test ActionButton. Check whether ActionButton is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.AppBarStyle.ActionButton A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void ActionButton_CHECK_SET_GET_VALUE()
+ {
+ /* PRECONDITION */
+ var style = new AppBarStyle();
+ Assert.IsNotNull(style, "Can't create success object AppBarStyle");
+ Assert.IsInstanceOf<AppBarStyle>(style, "Construct AppBarStyle Fail");
+
+ /* TEST CODE */
+ var actionButton = new ButtonStyle();
+ Assert.IsNotNull(actionButton, "Should not be null");
+
+ style.ActionButton = actionButton;
+ Assert.AreSame(actionButton, style.ActionButton, "Retrieved ActionButton should be the same with the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test CopyFrom. Check whether CopyFrom works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.AppBarStyle.CopyFrom M")]
+ [Property("SPEC_URL", " - ")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void CopyFrom_CHECK()
+ {
+ try
+ {
+ var style1 = new AppBarStyle();
+ Assert.IsNotNull(style1, "Should not be null");
+
+ var style2 = new AppBarStyle();
+ Assert.IsNotNull(style2, "Should not be null");
+
+ style2.CopyFrom(style1);
+ }
+ 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.BaseComponents;
+using Tizen.NUI.Components.Test;
+
+namespace Tizen.NUI.Components.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.Components.ContentPage Tests")]
+ public class ContentPageTests
+ {
+ private const string TAG = "Components";
+
+ public ContentPageTests()
+ {
+ }
+
+ ~ContentPageTests()
+ {
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Create a ContentPage object. Check whether ContentPage is successfully created or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.ContentPage.ContentPage C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void ContentPage_INIT()
+ {
+ /* TEST CODE */
+ var page = new ContentPage();
+ Assert.IsNotNull(page, "Can't create success object ContentPage");
+ Assert.IsInstanceOf<ContentPage>(page, "Costruct ContentPage Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test AppBar. Check whether AppBar is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.ContentPage.AppBar A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void AppBar_CHECK_SET_GET_VALUE()
+ {
+ /* PRECONDITION */
+ var page = new ContentPage();
+ Assert.IsNotNull(page, "Can't create success object ContentPage");
+ Assert.IsInstanceOf<ContentPage>(page, "Costruct ContentPage Fail");
+
+ /* TEST CODE */
+ var appBar = new AppBar();
+ Assert.IsNotNull(appBar, "Can't create success object AppBar");
+ Assert.IsInstanceOf<AppBar>(appBar, "Construct AppBar Fail");
+
+ page.AppBar = appBar;
+ Assert.AreSame(appBar, page.AppBar, "Retrieved AppBar should be the same with the set value.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Content. Check whether Content is readable and writable.")]
+ [Property("SPEC", "Tizen.NUI.Components.ContentPage.Content A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void Content_CHECK_SET_GET_VALUE()
+ {
+ /* PRECONDITION */
+ var page = new ContentPage();
+ Assert.IsNotNull(page, "Can't create success object ContentPage");
+ Assert.IsInstanceOf<ContentPage>(page, "Costruct ContentPage Fail");
+
+ /* TEST CODE */
+ var view = new View();
+ Assert.IsNotNull(view, "Can't create success object View");
+ Assert.IsInstanceOf<View>(view, "Construct View Fail");
+
+ page.Content = view;
+ Assert.AreSame(view, page.Content, "Retrieved Content should be the same with the set value.");
+ }
+ }
+}