[NUI][ACR-327] Add new public TCs for Button/Slider/Switch/CheckBox/RadioButton 43/238343/8
authorzhouleonlei <zhouleon.lei@samsung.com>
Mon, 13 Jul 2020 03:21:49 +0000 (11:21 +0800)
committerzhouleonlei <zhouleon.lei@samsung.com>
Wed, 15 Jul 2020 12:16:26 +0000 (20:16 +0800)
Some TCs of Onxxx are added in this Patch such as OnFocusGained, OnFocusLost, OnTouch and so on...
They are all protected/public override callback function for the derived class. It is pointless to call these APIs directly.
So They are overrided in derived class such as MyButton, MySlider...
These callback functions are triggered by user actions such as pressing in remote-controls or touch screen.
There are no codes to call these APIs directly, but in the derived class(MyButton...) you can see the codes like below:
            public override bool OnTouch(Touch touch)
            {
                Tizen.Log.Fatal("NUI.Components", "Button OnTouch!!!!!!!!!!!!!!!!!!!!!");
                ManualTest.Confirm();
                return true;
            }

Change-Id: I620f437e8154a51fbb1c5f59ad01c889bb270ef3

tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSButton.cs
tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSlider.cs
tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSwitch.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSButton.cs [changed mode: 0644->0755]
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSCheckBox.cs [new file with mode: 0755]
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSRadioButton.cs [new file with mode: 0755]
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSSwitch.cs [changed mode: 0644->0755]

index 90e99c0..4aaa65e 100755 (executable)
@@ -20,7 +20,6 @@ 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
@@ -31,14 +30,20 @@ namespace Tizen.NUI.Components.Tests
     {
         private ManualTestComponents _testPage;
         private WearableManualTestNUI _wearTestPage;
-        private Components.Button _button;
-        private float _pointSize = 20.0f;
+        private View _view;
+        private Button _button;
+        private Button _button1;
+        private float _pointSize = 20.0f;\r
+        private bool _isMobile = false;
+        private bool _isWearable = false;
 
         [SetUp]
         public void Init()
         {
-            LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
-            if(ManualTest.IsWearable())
+            LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");\r
+            _isMobile = ManualTest.IsMobile();
+            _isWearable = ManualTest.IsWearable();
+            if (_isWearable)
             {
                 _pointSize = 2.0f;
                 _wearTestPage = WearableManualTestNUI.GetInstance();
@@ -47,34 +52,91 @@ namespace Tizen.NUI.Components.Tests
             {
                 _pointSize = ManualTest.GetPointSize();
                 _testPage = ManualTestComponents.GetInstance();
-            }
+            }\r
+\r
+            _view = new View();
+            _view.Focusable = true;
+            _view.Position = new Position(Window.Instance.Size.Width * 0.45f, Window.Instance.Size.Height * 0.5f);\r
+            _view.Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Horizontal };
         }
 
         [TearDown]
         public void Destroy()
         {
-            LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST");
-        }
-
-        private void CreateMyButton(string buttonText)
-        {
-            _button = new Button(new ButtonStyle());
-            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;
-            _button.Position = new Position(Window.Instance.Size.Width * 0.45f, Window.Instance.Size.Height * 0.5f);
-            _button.Size = new Size(Window.Instance.Size.Width * 0.1f, Window.Instance.Size.Height * 0.0462f);
-            _button.Focusable = true;
-            if (ManualTest.IsWearable())
+            LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST");\r
+            if (_button != null)\r
+            {
+                _button.FocusGained -= OnFocusGained;
+                _button.FocusLost -= OnFocusLost;
+            }\r
+\r
+            if (_button1 != null)\r
             {
-                _wearTestPage.ExecuteTC(_button);
+                _button1.FocusGained -= OnFocusGained;
+                _button1.FocusLost -= OnFocusLost;
             }
-            else
+        }\r
+\r
+        public class MyButton : Button
+        {
+            public MyButton(ButtonStyle st) : base(st) { }
+
+            protected override void OnClick(ClickEventArgs eventArgs)
+            {\r
+                Tizen.Log.Fatal("NUI.Components", "Button OnClick!!!!!!!!!!!!!!!!!!!!!");\r
+                ManualTest.Confirm();
+            }\r
+\r
+            public override void OnFocusGained()\r
+            {\r
+                Tizen.Log.Fatal("NUI.Components", "Button OnFocusGained!!!!!!!!!!!!!!!!!!!!!");\r
+                ManualTest.Confirm();\r
+            }
+        }\r
+\r
+        public class MyButton1 : Button
+        {
+            public MyButton1(ButtonStyle st) : base(st) { }\r
+\r
+            public override void OnFocusLost()\r
+            {\r
+                Tizen.Log.Fatal("NUI.Components", "Button OnFocusLost!!!!!!!!!!!!!!!!!!!!!");\r
+                ManualTest.Confirm();\r
+            }\r
+\r
+            public override bool OnTouch(Touch touch)\r
             {
-                _testPage.ExecuteTC(_button);
+                Tizen.Log.Fatal("NUI.Components", "Button OnTouch!!!!!!!!!!!!!!!!!!!!!");
+                ManualTest.Confirm();
+                return true;
             }
+        }\r
+
+        private void CreateMyButton(Button btn, string buttonText)
+        {
+            Assert.IsNotNull(btn, "Should be not null");
+            Assert.IsInstanceOf<Components.Button>(btn, "Should return Button instance");
+            btn.Focusable = true;
+            btn.Text = buttonText;
+            btn.PointSize = _pointSize;
+            btn.Size = new Size(Window.Instance.Size.Width * 0.1f, Window.Instance.Size.Height * 0.0462f);
+            btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png";\r
+            btn.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);\r
+            btn.FocusGained += OnFocusGained;
+            btn.FocusLost += OnFocusLost;
+            _view.Add(btn);
+        }\r
+\r
+        private void OnFocusGained(object sender, EventArgs e)\r
+        {
+            Button source = sender as Button;
+            source.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png";
+        }\r
+\r
+        private void OnFocusLost(object sender, EventArgs e)\r
+        {\r
+            Button source = sender as Button;\r
+            source.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png";\r
         }
 
         public void OnClicked(object sender, EventArgs e)
@@ -98,17 +160,131 @@ namespace Tizen.NUI.Components.Tests
         [Postcondition(1, "NA")]
         public async Task ClickEvent_CB()
         {
-            CreateMyButton("Click me!");
+            _button = new Button(new ButtonStyle());
+            CreateMyButton(_button, "Click me!");\r
+            if (_isWearable)
+            {
+                _wearTestPage.ExecuteTC(_view);
+            }
+            else
+            {
+                _testPage.ExecuteTC(_view);
+            }
+            FocusManager.Instance.SetCurrentFocusView(_button);
             _button.ClickEvent += OnClicked;
             await ManualTest.WaitForConfirm();
             _button.ClickEvent -= OnClicked;
-            if (ManualTest.IsWearable())
+            if (_isWearable)
+            {
+                _wearTestPage.ClearTestCase(_view);
+            }
+            else
+            {
+                _testPage.ClearTestCase(_view);
+            }
+        }\r
+\r
+        [Test]
+        [Category("P1")]
+        [Description("Test: Click. Check whether the event will be triggered when setting focus to the button")]
+        [Property("SPEC", "Tizen.NUI.Components.Button.OnFocusGained M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@samsung.com")]
+        [Precondition(1, "This test can be tested only in TV emulator now.")]
+        [Precondition(2, "Prepare remote-control and connect to TV.")]
+        [Step(1, "Click run TC")]
+        [Step(2, "Press the right key of remote-control")]
+        [Step(3, "TC will pass after the right button gained focus")]
+        [Postcondition(1, "NA")]
+        public async Task OnFocusGained_CB()
+        {
+            if (_isMobile || _isWearable)
+            {
+                ManualTest.Confirm();
+                return;
+            }
+            else\r
+            {\r
+                _button = new MyButton(new ButtonStyle());\r
+                CreateMyButton(_button, "Left");\r
+                _button1 = new MyButton(new ButtonStyle());\r
+                CreateMyButton(_button1, "Right");\r
+                _testPage.ExecuteTC(_view);\r
+                FocusManager.Instance.SetCurrentFocusView(_button);\r
+                _button.RightFocusableView = _button1;\r
+                await ManualTest.WaitForConfirm();\r
+                _testPage.ClearTestCase(_view);\r
+            }
+        }\r
+\r
+        [Test]
+        [Category("P1")]
+        [Description("Test: Click. Check whether the event will be triggered when the button lost focus")]
+        [Property("SPEC", "Tizen.NUI.Components.Button.OnFocusLost M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@samsung.com")]
+        [Precondition(1, "This test can be tested only in TV emulator now.")]
+        [Precondition(2, "Prepare remote-control and connect to TV.")]
+        [Step(1, "Click run TC")]
+        [Step(2, "Press the right key of remote-control")]
+        [Step(3, "TC will pass after the left button lost focus")]
+        [Postcondition(1, "NA")]
+        public async Task OnFocusLost_CB()
+        {\r
+            if (_isMobile || _isWearable)
+            {
+                ManualTest.Confirm();
+                return;
+            }
+            else\r
+            {\r
+                _button = new MyButton1(new ButtonStyle());\r
+                CreateMyButton(_button, "Left");\r
+                _button1 = new MyButton1(new ButtonStyle());\r
+                CreateMyButton(_button1, "Right");\r
+                _testPage.ExecuteTC(_view);\r
+                FocusManager.Instance.SetCurrentFocusView(_button);\r
+                _button.RightFocusableView = _button1;\r
+                await ManualTest.WaitForConfirm();\r
+                _testPage.ClearTestCase(_view);\r
+            }
+        }\r
+\r
+        [Test]
+        [Category("P1")]
+        [Description("Test: Click. Check whether the event will be triggered when user click the button")]
+        [Property("SPEC", "Tizen.NUI.Components.Button.OnTouch M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@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_CB()
+        {
+            _button = new MyButton1(new ButtonStyle());
+            CreateMyButton(_button, "Click me!");\r
+            if (_isWearable)
+            {
+                _wearTestPage.ExecuteTC(_view);
+            }
+            else
+            {
+                _testPage.ExecuteTC(_view);
+            }
+            FocusManager.Instance.SetCurrentFocusView(_button);
+            await ManualTest.WaitForConfirm();
+            if (_isWearable)
             {
-                _wearTestPage.ClearTestCase(_button);
+                _wearTestPage.ClearTestCase(_view);
             }
             else
             {
-                _testPage.ClearTestCase(_button);
+                _testPage.ClearTestCase(_view);
             }
         }
     }
index 2e39288..25212c0 100755 (executable)
@@ -36,13 +36,18 @@ namespace Tizen.NUI.Components.Tests
         private float _pointSize = 20.0f;
         private TextLabel _label;
         private Slider _slider;
+        private Slider _slider1;\r
+        private bool _isMobile = false;
+        private bool _isWearable = false;
 
         [SetUp]
         public void Init()
         {
-            LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
+            LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");\r
+            _isMobile = ManualTest.IsMobile();
+            _isWearable = ManualTest.IsWearable();
             _window = Window.Instance;
-            if (ManualTest.IsWearable())
+            if (_isWearable)
             {
                 _label = ManualTest.CreateLabel("This case is unsuitable for wearable, please press PASS button to continue!");
                 _wearTestPage = WearableManualTestNUI.GetInstance();
@@ -62,32 +67,68 @@ namespace Tizen.NUI.Components.Tests
         public void Destroy()
         {
             LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST");
+            if (_slider != null)\r
+            {
+                _slider.FocusGained -= OnFocusGained;
+                _slider.FocusLost -= OnFocusLost;
+            }\r
+\r
+            if (_slider1 != null)\r
+            {
+                _slider1.FocusGained -= OnFocusGained;
+                _slider1.FocusLost -= OnFocusLost;
+            }
+        }\r
+\r
+        public class MySlider : Slider
+        {
+            public MySlider() : base() { }\r
+\r
+            public override void OnFocusGained()\r
+            {\r
+                Tizen.Log.Fatal("NUI.Components", "Button FocusGained!!!!!!!!!!!!!!!!!!!!!");\r
+                ManualTest.Confirm();\r
+            }
+        }\r
+\r
+        public class MySlider1 : Slider
+        {
+            public MySlider1() : base() { }\r
+\r
+            public override void OnFocusLost()\r
+            {\r
+                Tizen.Log.Fatal("NUI.Components", "Button FocusLost!!!!!!!!!!!!!!!!!!!!!");\r
+                ManualTest.Confirm();\r
+            }
         }
 
-        private Slider CreateSlider()
+        private void CreateSlider(Slider sd)
         {
-            _slider = new Slider()
-            {
-                BackgroundColor = Color.Magenta,
-                TrackThickness = 4,
-                BgTrackColor = new Color(0, 0, 0, 0.1f),
-                SlidedTrackColor = new Color(0.05f, 0.63f, 0.9f, 1),
-                ThumbImageURLSelector = new StringSelector
-                {
-                    Normal = "9. Controller/controller_btn_slide_handler_normal.png",
-                    Pressed = "9. Controller/controller_btn_slide_handler_press.png",
-                },
-                ThumbSize = new Size(Window.Instance.Size.Width * 0.0312f, Window.Instance.Size.Height * 0.0555f),\r
-                Direction = Slider.DirectionType.Horizontal,
-                MinValue = 0,
-                MaxValue = 100,
-                Position = new Position(Window.Instance.Size.Width * 0.3f, Window.Instance.Size.Height * 0.4f),
-                Size = new Size(Window.Instance.Size.Width * 0.4166f, Window.Instance.Size.Height * 0.0462f),\r
-                CurrentValue = 10,
-            };
-            _view.Add(_slider);
-
-            return _slider;
+            sd.Focusable = true;
+            sd.TrackThickness = 4;
+            sd.BgTrackColor = new Color(0, 0, 0, 0.1f);
+            sd.SlidedTrackColor = new Color(0.05f, 0.63f, 0.9f, 1);\r
+            sd.Direction = Slider.DirectionType.Horizontal;
+            sd.MinValue = 0;
+            sd.MaxValue = 100;
+            sd.Position = new Position(Window.Instance.Size.Width * 0.3f, Window.Instance.Size.Height * 0.4f);
+            sd.Size = new Size(Window.Instance.Size.Width * 0.4166f, Window.Instance.Size.Height * 0.0462f);\r
+            sd.CurrentValue = 10;\r
+            sd.FocusGained += OnFocusGained;\r
+            sd.FocusLost += OnFocusLost;
+            _view.Add(sd);
+        }
+
+        private void OnFocusGained(object sender, EventArgs e)\r
+        {
+            Slider source = sender as Slider;
+            source.BackgroundColor = Color.Magenta;
+        }\r
+\r
+        private void OnFocusLost(object sender, EventArgs e)\r
+        {\r
+            Slider source = sender as Slider;\r
+            source.BackgroundColor = Color.White;\r
         }
 
         private void CreateView(string information)
@@ -139,7 +180,7 @@ namespace Tizen.NUI.Components.Tests
         [Postcondition(1, "NA")]
         public async Task ValueChangedEvent_CB()
         {
-            if (ManualTest.IsWearable())
+            if (_isWearable)
             {
                 _wearTestPage.ExecuteTC(_label);
                 await ManualTest.WaitForConfirm();
@@ -148,9 +189,9 @@ namespace Tizen.NUI.Components.Tests
             else
             {
                 CreateView("Press Key-Down");
-                _slider = CreateSlider();
+                _slider = new Slider();
+                CreateSlider(_slider);
                 _slider.ValueChangedEvent += OnValueChangedEvent;
-
                 // Waits for user confirmation.
                 await ManualTest.WaitForConfirm();
                 _slider.ValueChangedEvent -= OnValueChangedEvent;
@@ -173,7 +214,7 @@ namespace Tizen.NUI.Components.Tests
         [Postcondition(1, "NA")]
         public async Task SlidingFinishedEvent_CB()
         {
-            if (ManualTest.IsWearable())
+            if (_isWearable)
             {
                 _wearTestPage.ExecuteTC(_label);
                 await ManualTest.WaitForConfirm();
@@ -182,7 +223,8 @@ namespace Tizen.NUI.Components.Tests
             else
             {
                 CreateView("Press Key-Down");
-                _slider = CreateSlider();
+                _slider = new Slider();
+                CreateSlider(_slider);
                 _slider.SlidingFinishedEvent += OnSlidingFinishedEvent;
                 // Waits for user confirmation.
                 await ManualTest.WaitForConfirm();
@@ -206,7 +248,7 @@ namespace Tizen.NUI.Components.Tests
         [Postcondition(1, "NA")]
         public async Task StateChangedEvent_CB()
         {
-            if (ManualTest.IsWearable())
+            if (_isWearable)
             {
                 _wearTestPage.ExecuteTC(_label);
                 await ManualTest.WaitForConfirm();
@@ -215,13 +257,86 @@ namespace Tizen.NUI.Components.Tests
             else
             {
                 CreateView("Press Key-Down");
-                _slider = CreateSlider();
+                _slider = new Slider();
+                CreateSlider(_slider);
                 _slider.StateChangedEvent += OnStateChangedEvent;
                 // Waits for user confirmation.
                 await ManualTest.WaitForConfirm();
                 _slider.StateChangedEvent -= OnStateChangedEvent;
                 _testPage.ClearTestCase(_view);
             }
+        }\r
+\r
+        [Test]
+        [Category("P1")]
+        [Description("Test: Click. Check whether the event will be triggered when setting focus to the slider")]
+        [Property("SPEC", "Tizen.NUI.Components.Slider.OnFocusGained M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@samsung.com")]
+        [Precondition(1, "This test can be tested only in TV emulator now.")]
+        [Precondition(2, "Prepare remote-control and connect to TV.")]
+        [Step(1, "Click run TC")]
+        [Step(2, "Press the up key of remote-control")]
+        [Step(3, "TC will pass after the above slider gained focus")]
+        [Postcondition(1, "NA")]
+        public async Task OnFocusGained_CB()
+        {
+            if (_isMobile || _isWearable)
+            {
+                ManualTest.Confirm();
+                return;
+            }
+            else
+            {
+                CreateView("Press Key-Up");
+                _slider = new MySlider();
+                CreateSlider(_slider);\r
+                _slider1 = new MySlider();
+                CreateSlider(_slider1);
+                _slider1.Position = new Position(Window.Instance.Size.Width * 0.3f, Window.Instance.Size.Height * 0.3f);
+                FocusManager.Instance.SetCurrentFocusView(_slider);
+                _slider.UpFocusableView = _slider1;
+                // Waits for user confirmation.
+                await ManualTest.WaitForConfirm();
+                _testPage.ClearTestCase(_view);
+            }
+        }\r
+\r
+        [Test]
+        [Category("P1")]
+        [Description("Test: Click. Check whether the event will be triggered when the slider lost focus")]
+        [Property("SPEC", "Tizen.NUI.Components.Slider.OnFocusLost M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@samsung.com")]
+        [Precondition(1, "This test can be tested only in TV emulator now.")]
+        [Precondition(2, "Prepare remote-control and connect to TV.")]
+        [Step(1, "Click run TC")]
+        [Step(2, "Press the up key of remote-control")]
+        [Step(3, "TC will pass after the slider lost focus")]
+        [Postcondition(1, "NA")]
+        public async Task OnFocusLost_CB()
+        {
+            if (_isMobile || _isWearable)
+            {
+                ManualTest.Confirm();
+                return;
+            }
+            else
+            {
+                CreateView("Press Key-Up");
+                _slider = new MySlider1();
+                CreateSlider(_slider);\r
+                _slider1 = new MySlider1();
+                CreateSlider(_slider1);
+                _slider1.Position = new Position(Window.Instance.Size.Width * 0.3f, Window.Instance.Size.Height * 0.3f);
+                FocusManager.Instance.SetCurrentFocusView(_slider);
+                _slider.UpFocusableView = _slider1;
+                // Waits for user confirmation.
+                await ManualTest.WaitForConfirm();
+                _testPage.ClearTestCase(_view);
+            }
         }
     }
 }
index 3b4762f..6c70cea 100755 (executable)
@@ -20,7 +20,6 @@ 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
@@ -32,13 +31,17 @@ namespace Tizen.NUI.Components.Tests
         private ManualTestComponents _testPage;
         private WearableManualTestNUI _wearTestPage;
         private Switch _switch;
-        private string _resourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
+        private string _resourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource;\r
+        private bool _isMobile = false;
+        private bool _isWearable = false;
 
         [SetUp]
         public void Init()
         {
-            LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");
-            if (ManualTest.IsWearable())
+            LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Preconditions for each TEST");\r
+            _isMobile = ManualTest.IsMobile();
+            _isWearable = ManualTest.IsWearable();
+            if (_isWearable)
             {
                 _wearTestPage = WearableManualTestNUI.GetInstance();
             }
@@ -52,6 +55,25 @@ namespace Tizen.NUI.Components.Tests
         public void Destroy()
         {
             LogUtils.Write(LogUtils.INFO, LogUtils.TAG, "Postconditions for each TEST");
+        }\r
+\r
+        public class MySwitch : Switch
+        {
+            public MySwitch(SwitchStyle st) : base(st) { }
+
+            public override bool OnKey(Key key)
+            {\r
+                Tizen.Log.Fatal("NUI.Components", "Button OnKey!!!!!!!!!!!!!!!!!!!!!");\r
+                ManualTest.Confirm();
+                return true;
+            }\r
+\r
+            public override bool OnTouch(Touch touch)\r
+            {
+                Tizen.Log.Fatal("NUI.Components", "Button OnTouch!!!!!!!!!!!!!!!!!!!!!");
+                ManualTest.Confirm();
+                return true;
+            }
         }
 
         private void CreateSwitch()
@@ -76,12 +98,12 @@ namespace Tizen.NUI.Components.Tests
                     },\r
                 },\r
             };
-            _switch = new Switch(st);
+            _switch = new MySwitch(st);
             Assert.IsNotNull(_switch, "Should be not null");
             Assert.IsInstanceOf<Components.Switch>(_switch, "Should be equal!");
             _switch.Size = new Size(Window.Instance.Size.Width * 0.05f, Window.Instance.Size.Height * 0.0555f);
             _switch.Position = new Position(Window.Instance.Size.Width * 0.5f, Window.Instance.Size.Height * 0.5f);\r
-            if (ManualTest.IsWearable())
+            if (_isWearable)
             {\r
                 _wearTestPage.ExecuteTC(_switch);\r
             }\r
@@ -115,7 +137,7 @@ namespace Tizen.NUI.Components.Tests
             _switch.SelectedEvent += OnSelectedEvent;
             await ManualTest.WaitForConfirm();
             _switch.SelectedEvent -= OnSelectedEvent;
-            if (ManualTest.IsWearable())
+            if (_isWearable)
             {
                 _wearTestPage.ClearTestCase(_switch);
             }
@@ -123,6 +145,62 @@ namespace Tizen.NUI.Components.Tests
             {
                 _testPage.ClearTestCase(_switch);
             }
+        }\r
+\r
+        [Test]
+        [Category("P1")]
+        [Description("Test: Touch. Check whether the event will be triggered when user click(touch) the Switch")]
+        [Property("SPEC", "Tizen.NUI.Components.Switch.OnTouch M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@samsung.com")]
+        [Precondition(1, "If test on TV, prepare mouse and connect to TV.")]
+        [Step(1, "Click run TC")]
+        [Step(2, "Click(Touch) the Switch.")]
+        [Step(3, "TC will pass after touch or click.")]
+        [Postcondition(1, "NA")]
+        public async Task OnTouch_CB()
+        {
+            CreateSwitch();
+            await ManualTest.WaitForConfirm();
+            if (_isWearable)
+            {
+                _wearTestPage.ClearTestCase(_switch);
+            }
+            else
+            {
+                _testPage.ClearTestCase(_switch);
+            }
+        }\r
+\r
+        [Test]
+        [Category("P1")]
+        [Description("Test: Click. Check whether the event will be triggered when user press the key of remote-control")]
+        [Property("SPEC", "Tizen.NUI.Components.Switch.OnKey M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MR")]
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@samsung.com")]
+        [Precondition(1, "This test can be tested only in TV emulator now.")]
+        [Precondition(2, "Prepare remote-control and connect to TV.")]
+        [Step(1, "Click run TC")]
+        [Step(2, "Press the keys of remote-control such as enter/up/down/left/right")]
+        [Step(3, "TC will pass after pressing.")]
+        [Postcondition(1, "NA")]
+        public async Task OnKey_CB()
+        {\r
+            if (_isMobile || _isWearable)
+            {
+                ManualTest.Confirm();
+                return;
+            }
+            else\r
+            {\r
+                CreateSwitch();\r
+                _switch.Focusable = true;\r
+                FocusManager.Instance.SetCurrentFocusView(_switch);\r
+                await ManualTest.WaitForConfirm();\r
+                _testPage.ClearTestCase(_switch);
+            }
         }
     }
 }
old mode 100644 (file)
new mode 100755 (executable)
index 6ebe926..8c8e502
@@ -83,7 +83,7 @@ namespace Tizen.NUI.Components.Tests
                 Assert.Fail("Should throw the Exception: There is no style of defaultButtonX !");
             }
             catch(InvalidOperationException e)
-            {
+            {\r
                 Assert.Pass("InvalidOperationException: passed!");
             }
         }
@@ -377,7 +377,7 @@ namespace Tizen.NUI.Components.Tests
                 Assert.Fail("Should throw the NullReferenceException!");
             }
             catch (NullReferenceException e)
-            {
+            {\r
                 Assert.Pass("NullReferenceException: passed!");
             }
         }
@@ -435,7 +435,7 @@ namespace Tizen.NUI.Components.Tests
                 Assert.Fail("Should throw the NullReferenceException!");
             }
             catch(NullReferenceException e)
-            {
+            {\r
                 Assert.Pass("NullReferenceException: passed!");
             }
         }
@@ -486,7 +486,7 @@ namespace Tizen.NUI.Components.Tests
                 Assert.Fail("Should throw the NullReferenceException!");
             }
             catch(NullReferenceException e)
-            {
+            {\r
                 Assert.Pass("NullReferenceException: passed!");
             }
         }
@@ -536,7 +536,7 @@ namespace Tizen.NUI.Components.Tests
                 Assert.Fail("Should throw the NullReferenceException!");
             }
             catch(NullReferenceException e)
-            {
+            {\r
                 Assert.Pass("NullReferenceException: passed!");
             }
         }
@@ -760,6 +760,120 @@ namespace Tizen.NUI.Components.Tests
             {
                 Assert.Fail("Caught Exception" + e.ToString());
             }
+        }\r
+\r
+        [Test]
+        [Category("P1")]
+        [Description("Test Button's icon part. Check whether null or not")]
+        [Property("SPEC", "Tizen.NUI.Components.Button.Icon A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@samsung.com")]
+        public void Icon_TEST()
+        {
+            /* TEST CODE */
+            try
+            {
+                var button = new Button();
+                Assert.IsNotNull(button, "Should be not null");
+                Assert.IsInstanceOf<Components.Button>(button, "Should return Button instance");
+                Assert.IsNotNull(button.Icon, "Should be not null");
+                Assert.IsInstanceOf<ImageView>(button.Icon, "Should return ImageView instance");
+                button.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
+        [Test]
+        [Category("P1")]
+        [Description("Test Button's overlay image part. Check whether null or not")]
+        [Property("SPEC", "Tizen.NUI.Components.Button.OverlayImage A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@samsung.com")]
+        public void OverlayImage_TEST()
+        {
+            /* TEST CODE */
+            try
+            {
+                var button = new Button();
+                Assert.IsNotNull(button, "Should be not null");
+                Assert.IsInstanceOf<Components.Button>(button, "Should return Button instance");
+                Assert.IsNotNull(button.OverlayImage, "Should be not null");
+                Assert.IsInstanceOf<ImageView>(button.OverlayImage, "Should return ImageView instance");
+                button.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
+        [Test]
+        [Category("P1")]
+        [Description("Test Button's text part. Check whether null or not")]
+        [Property("SPEC", "Tizen.NUI.Components.Button.TextLabel A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@samsung.com")]
+        public void TextLabel_TEST()
+        {
+            /* TEST CODE */
+            try
+            {
+                var button = new Button();
+                Assert.IsNotNull(button, "Should be not null");
+                Assert.IsInstanceOf<Components.Button>(button, "Should return Button instance");
+                Assert.IsNotNull(button.TextLabel, "Should be not null");
+                Assert.IsInstanceOf<TextLabel>(button.TextLabel, "Should return TextLabel instance");
+                button.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
+        [Test]
+        [Category("P1")]
+        [Description("Test Icon relative orientation in Button. Check whether IconRelativeOrientation is readable and writable.")]
+        [Property("SPEC", "Tizen.NUI.Components.Button.IconRelativeOrientation A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@samsung.com")]
+        public void IconRelativeOrientation_TEST()
+        {
+            /* TEST CODE */
+            try
+            {
+                var button = new Button();
+                Assert.IsNotNull(button, "Should be not null");
+                Assert.IsInstanceOf<Components.Button>(button, "Should return Button instance");\r
+                button.IconRelativeOrientation = Button.IconOrientation.Top;\r
+                Assert.AreEqual(Button.IconOrientation.Top, button.IconRelativeOrientation, "Should be equals to the set value of IconRelativeOrientation");\r
+                button.IconRelativeOrientation = Button.IconOrientation.Bottom;\r
+                Assert.AreEqual(Button.IconOrientation.Bottom, button.IconRelativeOrientation, "Should be equals to the set value of IconRelativeOrientation");\r
+                button.IconRelativeOrientation = Button.IconOrientation.Left;\r
+                Assert.AreEqual(Button.IconOrientation.Left, button.IconRelativeOrientation, "Should be equals to the set value of IconRelativeOrientation");\r
+                button.IconRelativeOrientation = Button.IconOrientation.Right;\r
+                Assert.AreEqual(Button.IconOrientation.Right, button.IconRelativeOrientation, "Should be equals to the set value of IconRelativeOrientation");
+                button.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 OnStateChangedEvent(object sender, Components.Button.StateChangedEventArgs args)
@@ -769,7 +883,7 @@ namespace Tizen.NUI.Components.Tests
 
         public class MyButton : Button
         {
-            public MyButton() : base() {}\r
+            public MyButton() : base() {}
 
             public ViewStyle CreateMyViewStyle()
             {
diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSCheckBox.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSCheckBox.cs
new file mode 100755 (executable)
index 0000000..5beac71
--- /dev/null
@@ -0,0 +1,138 @@
+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 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 CheckBoxTests\r
+    {\r
+        private const string TAG = "Components";\r
+\r
+        [SetUp]\r
+        public void Init()\r
+        {\r
+            Tizen.Log.Info(TAG, "Init() is called!");\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", "Zhou Lei, zhouleon.lei@samsung.com")]\r
+        public void CheckBox_CHECK_VALUE()\r
+        {\r
+            /* TEST CODE */\r
+            var _checkBox = new CheckBox();\r
+            Assert.IsNotNull(_checkBox, "Should be not null!");\r
+            Assert.IsInstanceOf<CheckBox>(_checkBox, "Should be an instance of CheckBox!");\r
+\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Test CheckBox constructor using string. Check whether CheckBox is successfully created or not.")]\r
+        [Property("SPEC", "Tizen.NUI.Components.CheckBox.CheckBox C")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "CONSTR")]\r
+        [Property("COVPARAM", "string")]\r
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@samsung.com")]\r
+        public void CheckBox_INIT_WITH_STRING()\r
+        {\r
+            /* TEST CODE */\r
+            StyleManager.Instance.Theme = "default";\r
+            StyleManager.Instance.RegisterStyle("defaultCheckBox", "default", typeof(DefaultButtonStyle));\r
+            var _checkBox = new CheckBox("defaultCheckBox");\r
+            Assert.IsNotNull(_checkBox, "Should be not null!");\r
+            Assert.IsInstanceOf<CheckBox>(_checkBox, "Should be an instance of CheckBox!");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P2")]\r
+        [Description("Check exception when constructing a CheckBox with nonexistent style.")]\r
+        [Property("SPEC", "Tizen.NUI.Components.CheckBox.CheckBox C")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "CONSTX")]\r
+        [Property("COVPARAM", "string")]\r
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@samsung.com")]\r
+        public void CheckBox_INIT_WITH_STRING_Exception()\r
+        {\r
+            /* TEST CODE */\r
+            try\r
+            {\r
+                var _checkBox = new CheckBox("defaultCheckBoxX");\r
+                Assert.Fail("Should throw the Exception: There is no style of defaultCheckBoxX !");\r
+            }\r
+            catch(InvalidOperationException e)\r
+            {\r
+                Assert.Pass("InvalidOperationException: passed!");\r
+            }\r
+        }\r
+\r
+        [Test]\r
+        [Category("P2")]\r
+        [Description("Check exception when constructing a CheckBox with null string style.")]\r
+        [Property("SPEC", "Tizen.NUI.Components.CheckBox.CheckBox C")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "CONSTX")]\r
+        [Property("COVPARAM", "string")]\r
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@samsung.com")]\r
+        public void CheckBox_INIT_WITH_NULL_STRING_Exception()\r
+        {\r
+            /* TEST CODE */\r
+            try\r
+            {\r
+                var _checkBox = new CheckBox("");\r
+                Assert.Fail("Should throw the Exception: There is null string style!");\r
+            }\r
+            catch (InvalidOperationException e)\r
+            {\r
+                Assert.Pass("InvalidOperationException: passed!");\r
+            }\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Test CheckBox constructor using style. Check whether CheckBox is successfully created or not.")]\r
+        [Property("SPEC", "Tizen.NUI.Components.CheckBox.CheckBox C")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "CONSTR")]\r
+        [Property("COVPARAM", "ButtonStyle")]\r
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@samsung.com")]\r
+        public void CheckBox_INIT_WITH_STYLE()\r
+        {\r
+            /* TEST CODE */\r
+            var style = new ButtonStyle();\r
+            Assert.IsNotNull(style, "Should be not null!");\r
+            Assert.IsInstanceOf<ButtonStyle>(style, "Should be an instance of ButtonStyle!");\r
+\r
+            var _checkBox = new CheckBox(style);\r
+            Assert.IsNotNull(_checkBox, "Should be not null!");\r
+            Assert.IsInstanceOf<CheckBox>(_checkBox, "Should be an instance of CheckBox!");\r
+        }\r
+\r
+        public class DefaultButtonStyle : StyleBase\r
+        {\r
+            protected override ViewStyle GetViewStyle()\r
+            {\r
+                return new ButtonStyle();\r
+            }\r
+        }\r
+    }\r
+}\r
diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSRadioButton.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSRadioButton.cs
new file mode 100755 (executable)
index 0000000..561a42d
--- /dev/null
@@ -0,0 +1,138 @@
+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 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
+\r
+        [SetUp]\r
+        public void Init()\r
+        {\r
+            Tizen.Log.Info(TAG, "Init() is called!");\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", "Zhou Lei, zhouleon.lei@samsung.com")]\r
+        public void RadioButton_CHECK_VALUE()\r
+        {\r
+            /* TEST CODE */\r
+            var _radioButton = new RadioButton();\r
+            Assert.IsNotNull(_radioButton, "Should be not null!");\r
+            Assert.IsInstanceOf<RadioButton>(_radioButton, "Should be an instance of RadioButton!");\r
+\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Test RadioButton constructor using string. Check whether RadioButton is successfully created or not.")]\r
+        [Property("SPEC", "Tizen.NUI.Components.RadioButton.RadioButton C")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "CONSTR")]\r
+        [Property("COVPARAM", "string")]\r
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@samsung.com")]\r
+        public void RadioButton_INIT_WITH_STRING()\r
+        {\r
+            /* TEST CODE */\r
+            StyleManager.Instance.Theme = "default";\r
+            StyleManager.Instance.RegisterStyle("defaultRadioButton", "default", typeof(DefaultButtonStyle));\r
+            var _radioButton = new RadioButton("defaultRadioButton");\r
+            Assert.IsNotNull(_radioButton, "Should be not null!");\r
+            Assert.IsInstanceOf<RadioButton>(_radioButton, "Should be an instance of RadioButton!");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P2")]\r
+        [Description("Check exception when constructing a RadioButton with nonexistent style.")]\r
+        [Property("SPEC", "Tizen.NUI.Components.RadioButton.RadioButton C")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "CONSTX")]\r
+        [Property("COVPARAM", "string")]\r
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@samsung.com")]\r
+        public void RadioButton_INIT_WITH_STRING_Exception()\r
+        {\r
+            /* TEST CODE */\r
+            try\r
+            {\r
+                var _radioButton = new RadioButton("defaultRadioButtonX");\r
+                Assert.Fail("Should throw the Exception: There is no style of defaultRadioButtonX !");\r
+            }\r
+            catch(InvalidOperationException e)\r
+            {\r
+                Assert.Pass("InvalidOperationException: passed!");\r
+            }\r
+        }\r
+\r
+        [Test]\r
+        [Category("P2")]\r
+        [Description("Check exception when constructing a RadioButton with null string style.")]\r
+        [Property("SPEC", "Tizen.NUI.Components.RadioButton.RadioButton C")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "CONSTX")]\r
+        [Property("COVPARAM", "string")]\r
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@samsung.com")]\r
+        public void RadioButton_INIT_WITH_NULL_STRING_Exception()\r
+        {\r
+            /* TEST CODE */\r
+            try\r
+            {\r
+                var _radioButton = new RadioButton("");\r
+                Assert.Fail("Should throw the Exception: There is null string style!");\r
+            }\r
+            catch (InvalidOperationException e)\r
+            {\r
+                Assert.Pass("InvalidOperationException: passed!");\r
+            }\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Test RadioButton constructor using style. Check whether RadioButton is successfully created or not.")]\r
+        [Property("SPEC", "Tizen.NUI.Components.RadioButton.RadioButton C")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "CONSTR")]\r
+        [Property("COVPARAM", "ButtonStyle")]\r
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@samsung.com")]\r
+        public void RadioButton_INIT_WITH_STYLE()\r
+        {\r
+            /* TEST CODE */\r
+            var style = new ButtonStyle();\r
+            Assert.IsNotNull(style, "Should be not null!");\r
+            Assert.IsInstanceOf<ButtonStyle>(style, "Should be an instance of ButtonStyle!");\r
+\r
+            var _radioButton = new RadioButton(style);\r
+            Assert.IsNotNull(_radioButton, "Should be not null!");\r
+            Assert.IsInstanceOf<RadioButton>(_radioButton, "Should be an instance of RadioButton!");\r
+        }\r
+\r
+        public class DefaultButtonStyle : StyleBase\r
+        {\r
+            protected override ViewStyle GetViewStyle()\r
+            {\r
+                return new ButtonStyle();\r
+            }\r
+        }\r
+    }\r
+}\r
old mode 100644 (file)
new mode 100755 (executable)
index c392beb..63fffc9
@@ -288,6 +288,60 @@ namespace Tizen.NUI.Components.Tests
             }
         }
 
+        [Test]
+        [Category("P1")]
+        [Description("Test Switch's track part. Check whether null or not")]
+        [Property("SPEC", "Tizen.NUI.Components.Switch.Track A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@samsung.com")]
+        public void Track_TEST()
+        {
+            /* TEST CODE */
+            try
+            {
+                var sw = new Switch();
+                Assert.IsNotNull(sw, "Should be not null");
+                Assert.IsInstanceOf<Components.Switch>(sw, "Should be an instance of Switch");
+                Assert.IsNotNull(sw.Track, "Should be not null");
+                Assert.IsInstanceOf<ImageView>(sw.Track, "Should be an instance of ImageView");
+                sw.Dispose();
+            }
+            catch (Exception e)
+            {
+                Tizen.Log.Error(TAG, "Caught Exception" + e.ToString());
+                LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
+                Assert.Fail("Caught Exception" + e.ToString());
+            }
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test Switch's thumb part. Check whether null or not")]
+        [Property("SPEC", "Tizen.NUI.Components.Switch.Thumb A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Zhou Lei, zhouleon.lei@samsung.com")]
+        public void Thumb_TEST()
+        {
+            /* TEST CODE */
+            try
+            {
+                var sw = new Switch();
+                Assert.IsNotNull(sw, "Should be not null");
+                Assert.IsInstanceOf<Components.Switch>(sw, "Should be an instance of Switch");
+                Assert.IsNotNull(sw.Thumb, "Should be not null");
+                Assert.IsInstanceOf<ImageView>(sw.Thumb, "Should be an instance of ImageView");
+                sw.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 MySwitch : Switch
         {
             public MySwitch() : base() {}\r