From: dongsug.song Date: Fri, 20 Sep 2019 05:44:11 +0000 (+0900) Subject: [NUI][Non-ACR][Fix auto tct Block errors] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ceb98b29b25e35c748f7481efe8029093f3ae0c4;p=test%2Ftct%2Fcsharp%2Fapi.git [NUI][Non-ACR][Fix auto tct Block errors] Change-Id: I193c49e888dbc0231faa369ac7b49b5281fc0f1e --- diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPopup.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPopup.cs index ba4959a65..ff6505b32 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPopup.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPopup.cs @@ -43,10 +43,19 @@ namespace Tizen.NUI.Tests public void Popup_INIT() { /* TEST CODE */ - var popup = new Popup(); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); - Assert.IsNotNull(popup, "Can't create success object Popup"); - Assert.IsInstanceOf(popup, "Should be an instance of Popup type."); + popup.Unparent(); } [Test] @@ -61,9 +70,25 @@ namespace Tizen.NUI.Tests /* TEST CODE */ try { - Popup popup = new Popup(); - TextLabel label = new TextLabel("setTitle"); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + var label = new TextLabel("setTitle"); + + Assert.IsNotNull(label, "Should not be a Null : TextLabel"); + Assert.IsInstanceOf(label, "Should be an instance of : TextLabel"); + popup.SetTitle(label); + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + + popup.Unparent(); } catch (Exception e) { @@ -85,9 +110,25 @@ namespace Tizen.NUI.Tests /* TEST CODE */ try { - Popup popup = new Popup(); - TextLabel label = new TextLabel("SetContent"); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + var label = new TextLabel("SetContent"); + + Assert.IsNotNull(label, "Should not be a Null : TextLabel"); + Assert.IsInstanceOf(label, "Should be an instance of : TextLabel"); + popup.SetContent(label); + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + + popup.Unparent(); } catch (Exception e) { @@ -109,9 +150,25 @@ namespace Tizen.NUI.Tests /* TEST CODE */ try { - Popup popup = new Popup(); - TextLabel label = new TextLabel("SetFooter"); - popup.SetTitle(label); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + var label = new TextLabel("SetFooter"); + + Assert.IsNotNull(label, "Should not be a Null : TextLabel"); + Assert.IsInstanceOf(label, "Should be an instance of : TextLabel"); + + popup.SetFooter(label); + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + + popup.Unparent(); } catch (Exception e) { @@ -131,22 +188,48 @@ namespace Tizen.NUI.Tests public void Title_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + popup.AnimationDuration = 0.0f; - popup.SetDisplayState(Popup.DisplayStateType.Shown); - TextLabel label = new TextLabel("test title"); - PropertyMap map = new PropertyMap(); + popup.SetDisplayState(Popup.DisplayStateType.Shown); + + var label = new TextLabel("test title"); + + Assert.IsNotNull(label, "Should not be a Null : TextLabel"); + Assert.IsInstanceOf(label, "Should be an instance of : TextLabel"); + + var map = new PropertyMap(); + + Assert.IsNotNull(map, "Should not be a Null : PropertyMap"); + Assert.IsInstanceOf(map, "Should be an instance of : PropertyMap"); + map.Add("type", new PropertyValue(label.GetTypeName())); map.Add("text", new PropertyValue("test title")); - popup.Title = map; + popup.Title = map; + + var propertyMap = popup.Title; + + Assert.IsNotNull(propertyMap, "Can't create successfully : PropertyMap"); + Assert.IsInstanceOf(propertyMap, "Should be an instance of PropertyMap"); - PropertyMap propertyMap = popup.Title; String type = ""; (propertyMap.Find(0, "type")).Get(out type); Assert.AreEqual("TextLabel", type, "Should be equals to the set value of type"); String text = ""; (propertyMap.Find(1, "text")).Get(out text); - Assert.AreEqual("test title", text, "Should be equals to the set value of text"); + Assert.AreEqual("test title", text, "Should be equals to the set value of text"); + + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + + popup.Unparent(); } [Test] @@ -159,22 +242,47 @@ namespace Tizen.NUI.Tests public void Content_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + + popup.Size2D = new Size2D(100, 100); popup.AnimationDuration = 0.0f; popup.SetDisplayState(Popup.DisplayStateType.Shown); - TextLabel label = new TextLabel("test title"); - PropertyMap map = new PropertyMap(); + + var label = new TextLabel("test title"); + + Assert.IsNotNull(label, "Should not be a Null : TextLabel"); + Assert.IsInstanceOf(label, "Should be an instance of : TextLabel"); + + var map = new PropertyMap(); + + Assert.IsNotNull(map, "Should not be a Null : PropertyMap"); + Assert.IsInstanceOf(map, "Should be an instance of : PropertyMap"); + map.Add("type", new PropertyValue(label.GetTypeName())); map.Add("text", new PropertyValue("test content")); popup.Content = map; - PropertyMap propertyMap = popup.Content; + var propertyMap = popup.Content; + + Assert.IsNotNull(propertyMap, "Should not be a Null : PropertyMap"); + Assert.IsInstanceOf(propertyMap, "Should be an instance of : PropertyMap"); + String type = ""; (propertyMap.Find(0, "type")).Get(out type); Assert.AreEqual("TextLabel", type, "Should be equals to the set value of type"); String text = ""; (propertyMap.Find(1, "text")).Get(out text); Assert.AreEqual("test content", text, "Should be equals to the set value of text"); + + popup.Unparent(); } [Test] @@ -187,22 +295,47 @@ namespace Tizen.NUI.Tests public void Footer_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + + popup.Size2D = new Size2D(100, 100); popup.AnimationDuration = 0.0f; popup.SetDisplayState(Popup.DisplayStateType.Shown); - TextLabel label = new TextLabel("test title"); - PropertyMap map = new PropertyMap(); + + var label = new TextLabel("test title"); + + Assert.IsNotNull(label, "Should not be a Null : TextLabel"); + Assert.IsInstanceOf(label, "Should be an instance of : TextLabel"); + + var map = new PropertyMap(); + + Assert.IsNotNull(map, "Should not be a Null : PropertyMap"); + Assert.IsInstanceOf(map, "Should be an instance of : PropertyMap"); + map.Add("type", new PropertyValue(label.GetTypeName())); map.Add("text", new PropertyValue("test Footer")); popup.Footer = map; - PropertyMap propertyMap = popup.Footer; + var propertyMap = popup.Footer; + + Assert.IsNotNull(propertyMap, "Should not be a Null : PropertyMap"); + Assert.IsInstanceOf(propertyMap, "Should be an instance of : PropertyMap"); + String type = ""; (propertyMap.Find(0, "type")).Get(out type); Assert.AreEqual("TextLabel", type, "Should be equals to the set value of type"); String text = ""; (propertyMap.Find(1, "text")).Get(out text); Assert.AreEqual("test Footer", text, "Should be equals to the set value of text"); + + popup.Unparent(); } [Test] @@ -215,31 +348,62 @@ namespace Tizen.NUI.Tests public async Task ExitAnimation_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + + popup.Size2D = new Size2D(100, 100); popup.PositionUsesPivotPoint = true; popup.AnimationDuration = 1.0f; popup.AnimationMode = Popup.AnimationModeType.Custom; - TextLabel label = new TextLabel("text"); + + var label = new TextLabel("text"); + + Assert.IsNotNull(label, "Should not be a Null : TextLabel"); + Assert.IsInstanceOf(label, "Should be an instance of : TextLabel"); + popup.SetContent(label); - PropertyMap animationMapExit = new PropertyMap(); + var animationMapExit = new PropertyMap(); + + Assert.IsNotNull(animationMapExit, "Should not be a Null : PropertyMap"); + Assert.IsInstanceOf(animationMapExit, "Should be an instance of : PropertyMap"); + animationMapExit.Insert("actor", new PropertyValue("customAnimationPopup")); - animationMapExit.Insert("property", new PropertyValue("position")); - Vector3 EixAnimationDestination = new Vector3(-300.0f, -200.0f, 0.0f); + animationMapExit.Insert("property", new PropertyValue("position")); + + var EixAnimationDestination = new Vector3(-300.0f, -200.0f, 0.0f); + + Assert.IsNotNull(EixAnimationDestination, "Should not be a Null : Vector3"); + Assert.IsInstanceOf(EixAnimationDestination, "Should be an instance of : Vector3"); + animationMapExit.Insert("value", new PropertyValue(EixAnimationDestination)); animationMapExit.Insert("alphaFunction", new PropertyValue("EASE_IN")); - PropertyArray timePeriodMapExit = new PropertyArray(); + + var timePeriodMapExit = new PropertyArray(); + + Assert.IsNotNull(timePeriodMapExit, "Should not be a Null : PropertyArray"); + Assert.IsInstanceOf(timePeriodMapExit, "Should be an instance of : PropertyArray"); + timePeriodMapExit.PushBack(new PropertyValue(0.0f)); timePeriodMapExit.PushBack(new PropertyValue(1.0f)); animationMapExit.Insert("timePeriod", new PropertyValue(timePeriodMapExit)); popup.ExitAnimation = animationMapExit; - - Window.Instance.GetDefaultLayer().Add(popup); popup.SetDisplayState(Popup.DisplayStateType.Shown); + await Task.Delay(20); - Assert.IsNotNull(popup); - Assert.IsNotNull(popup.ExitAnimation); + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsNotNull(popup.ExitAnimation, "Should not be a Null : Popup.ExitAnimation"); + Assert.IsInstanceOf(popup.ExitAnimation, "Should be an instance of : PropertyMap"); + + popup.Unparent(); } [Test] @@ -252,31 +416,61 @@ namespace Tizen.NUI.Tests public async Task EntryAnimation_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + + popup.Size2D = new Size2D(100, 100); popup.PositionUsesPivotPoint = true; popup.AnimationDuration = 1.0f; popup.AnimationMode = Popup.AnimationModeType.Custom; - TextLabel label = new TextLabel("text"); + + var label = new TextLabel("text"); + + Assert.IsNotNull(label, "Should not be a Null : TextLabel"); + Assert.IsInstanceOf(label, "Should be an instance of : TextLabel"); + popup.SetContent(label); - PropertyMap animationMapEntry = new PropertyMap(); + var animationMapEntry = new PropertyMap(); + + Assert.IsNotNull(animationMapEntry, "Should not be a Null : PropertyMap"); + Assert.IsInstanceOf(animationMapEntry, "Should be an instance of : PropertyMap"); + animationMapEntry.Insert("actor", new PropertyValue("customAnimationPopup")); animationMapEntry.Insert("property", new PropertyValue("position")); - Vector3 entryAnimationDestination = new Vector3(300.0f, 200.0f, 0.0f); + + var entryAnimationDestination = new Vector3(300.0f, 200.0f, 0.0f); + + Assert.IsNotNull(entryAnimationDestination, "Should not be a Null : Vector3"); + Assert.IsInstanceOf(entryAnimationDestination, "Should be an instance of : Vector3"); + animationMapEntry.Insert("value", new PropertyValue(entryAnimationDestination)); animationMapEntry.Insert("alphaFunction", new PropertyValue("EASE_OUT")); - PropertyArray timePeriodMapEntry = new PropertyArray(); + + var timePeriodMapEntry = new PropertyArray(); + + Assert.IsNotNull(timePeriodMapEntry, "Should not be a Null : PropertyArray"); + Assert.IsInstanceOf(timePeriodMapEntry, "Should be an instance of : PropertyArray"); + timePeriodMapEntry.PushBack(new PropertyValue(0.0f)); timePeriodMapEntry.PushBack(new PropertyValue(1.0f)); animationMapEntry.Insert("timePeriod", new PropertyValue(timePeriodMapEntry)); popup.EntryAnimation = animationMapEntry; - - Window.Instance.GetDefaultLayer().Add(popup); popup.SetDisplayState(Popup.DisplayStateType.Shown); + await Task.Delay(20); - Assert.IsNotNull(popup); - Assert.IsNotNull(popup.EntryAnimation); + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsNotNull(popup.EntryAnimation, "Should not be a Null : Popup.EntryAnimation"); + + popup.Unparent(); } [Test] @@ -284,17 +478,31 @@ namespace Tizen.NUI.Tests [Description("Test SetDisplayState.Check whether set DisplayState successfully")] [Property("SPEC", "Tizen.NUI.UIComponents.Popup.SetDisplayState M")] [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR MCST")] + [Property("CRITERIA", "MCST")] [Property("AUTHOR", "Wu Youxia, youxia.wu@partner.samsung.com")] public void SetDisplayState_CHECK_STATE() { /* TEST CODE */ try { - Popup popup = new Popup(); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + + popup.Size2D = new Size2D(100, 100); popup.AnimationDuration = 0.0f; popup.SetDisplayState(Popup.DisplayStateType.Shown); + + //in the above, it only set DisplayStateType.Shown only, no need to check other properties. Assert.AreEqual(Popup.DisplayStateType.Shown, popup.DisplayState, "Should be equals to the set value of DisplayState"); + + popup.Unparent(); } catch (Exception e) { @@ -314,19 +522,35 @@ namespace Tizen.NUI.Tests public async Task Shown_CHECK_STATE() { /* TEST CODE */ - Popup popup = new Popup(); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + + popup.Size2D = new Size2D(100, 100); + popup.AnimationDuration = 0.0f; - bool flag = false; - popup.Shown += (obj, ee) => - { - flag = true; - }; + flag = false; + popup.Shown += Popup_Shown; popup.SetDisplayState(Popup.DisplayStateType.Shown); await Task.Delay(120); Assert.IsTrue(flag, "Shown Should be triggered!"); - } - + popup.Shown -= Popup_Shown; + popup.Unparent(); + } + + private void Popup_Shown(object sender, Popup.ShownEventArgs e) + { + flag = true; + } + + bool flag = false; [Test] [Category("P1")] [Description("Test Showing.Check whether Showing will be triggered successfully")] @@ -337,18 +561,34 @@ namespace Tizen.NUI.Tests public void Showing_CHECK_STATE() { /* TEST CODE */ - Popup popup = new Popup(); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + Window.Instance.GetDefaultLayer().Add(popup); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + popup.Size2D = new Size2D(100, 100); + popup.AnimationDuration = 0.1f; - bool flag = false; - popup.Showing += (obj, ee) => - { - flag = true; - }; + flag = false; + popup.Showing += Popup_Showing; popup.SetDisplayState(Popup.DisplayStateType.Showing); Assert.IsTrue(flag, "Showing Should be triggered!"); - } + popup.Showing -= Popup_Showing; + popup.Unparent(); + } + + private void Popup_Showing(object sender, Popup.ShowingEventArgs e) + { + flag = true; + } + [Test] [Category("P1")] [Description("Test Hidden.Check whether Hidden will be triggered successfully")] @@ -359,20 +599,36 @@ namespace Tizen.NUI.Tests public async Task Hidden_CHECK_STATE() { /* TEST CODE */ - Popup popup = new Popup(); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + popup.AnimationDuration = 0.1f; - bool flag = false; - popup.Hidden += (obj, ee) => - { - flag = true; - }; + flag = false; + popup.Hidden += Popup_Hidden; popup.SetDisplayState(Popup.DisplayStateType.Shown); + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + await Task.Delay(1200); popup.SetDisplayState(Popup.DisplayStateType.Hidden); await Task.Delay(1200); Assert.IsTrue(flag, "Hidden Should be triggered!"); - } + popup.Hidden -= Popup_Hidden; + popup.Unparent(); + } + + private void Popup_Hidden(object sender, Popup.HiddenEventArgs e) + { + flag = true; + } + [Test] [Category("P1")] [Description("Test Hiding.Check whether Hiding will be triggered successfully")] @@ -383,19 +639,37 @@ namespace Tizen.NUI.Tests public void Hiding_CHECK_STATE() { /* TEST CODE */ - Popup popup = new Popup(); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + popup.AnimationDuration = 0.1f; - bool flag = false; - popup.Hiding += (obj, ee) => - { - flag = true; - }; + flag = false; + popup.Hiding += Popup_Hiding; + + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + popup.SetDisplayState(Popup.DisplayStateType.Shown); popup.SetDisplayState(Popup.DisplayStateType.Hidden); Assert.IsTrue(flag, "Hiding Should be triggered!"); - } + popup.Hide(); + popup.Hiding -= Popup_Hiding; + popup.Unparent(); + } + + private void Popup_Hiding(object sender, Popup.HidingEventArgs e) + { + flag = true; + } + [Test] [Category("P1")] [Description("Test DisplayState.Check whether DisplayState is readable and writeable.")] @@ -403,13 +677,38 @@ namespace Tizen.NUI.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRW")] [Property("AUTHOR", "Wu Youxia, youxia.wu@partner.samsung.com")] - public void DisplayState_SET_GET_VALUE() + public async Task DisplayState_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); - popup.AnimationDuration = 0.0f; + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + popup.AnimationDuration = 0.5f; popup.DisplayState = Popup.DisplayStateType.Shown; - Assert.AreEqual(Popup.DisplayStateType.Shown, popup.DisplayState, "Should be equals to the set value of DisplayState"); + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + + Assert.AreEqual(Popup.DisplayStateType.Showing, popup.DisplayState, "Should be equals to the set value of DisplayState"); + + await Task.Delay(1000); + + Assert.AreEqual(Popup.DisplayStateType.Shown, popup.DisplayState, "Should be equals to the set value of DisplayState"); + + popup.DisplayState = Popup.DisplayStateType.Hidden; + + Assert.AreEqual(Popup.DisplayStateType.Hiding, popup.DisplayState, "Should be equals to the set value of DisplayState"); + + await Task.Delay(1000); + + Assert.AreEqual(Popup.DisplayStateType.Hidden, popup.DisplayState, "Should be equals to the set value of DisplayState"); + + popup.Unparent(); } [Test] @@ -422,9 +721,25 @@ namespace Tizen.NUI.Tests public void TouchTransparent_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + popup.TouchTransparent = true; - Assert.AreEqual(true, popup.TouchTransparent, "Should be equals to the set value of TouchTransparent"); + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + + Assert.AreEqual(true, popup.TouchTransparent, "Should be equals to the set value of TouchTransparent"); + + popup.TouchTransparent = false; + Assert.AreEqual(false, popup.TouchTransparent, "Should be equals to the set value of TouchTransparent"); + + popup.Unparent(); } [Test] @@ -437,9 +752,25 @@ namespace Tizen.NUI.Tests public void TailVisibility_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + popup.TailVisibility = true; - Assert.AreEqual(true, popup.TailVisibility, "Should be equals to the set value of TailVisibility"); + Assert.AreEqual(true, popup.TailVisibility, "Should be equals to the set value of TailVisibility"); + + popup.TailVisibility = false; + Assert.AreEqual(false, popup.TailVisibility, "Should be equals to the set value of TailVisibility"); + + popup.Unparent(); } [Test] @@ -452,14 +783,29 @@ namespace Tizen.NUI.Tests public void TailPosition_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + var vector3 = new Vector3(10.0f, 20.0f, 30.0f); + + Assert.IsNotNull(vector3, "Should not be a Null : Vector3"); + Assert.IsInstanceOf(vector3, "Should be an instance of : Vector3"); - Vector3 vector3 = new Vector3(10.0f, 20.0f, 30.0f); popup.TailPosition = vector3; + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); Assert.AreEqual(vector3.X, popup.TailPosition.X, "Should be equals to the set value of TailPosition.X"); Assert.AreEqual(vector3.Y, popup.TailPosition.Y, "Should be equals to the set value of TailPosition.Y"); Assert.AreEqual(vector3.Z, popup.TailPosition.Z, "Should be equals to the set value of TailPosition.Z"); + + popup.Unparent(); } [Test] @@ -472,9 +818,35 @@ namespace Tizen.NUI.Tests public void ContextualMode_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + popup.ContextualMode = Popup.ContextualModeType.NonContextual; - Assert.AreEqual(Popup.ContextualModeType.NonContextual, popup.ContextualMode, "Should be equals to the set value of ContextualMode"); + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + + Assert.AreEqual(Popup.ContextualModeType.NonContextual, popup.ContextualMode, "Should be equals to the set value of ContextualMode"); + + popup.ContextualMode = Popup.ContextualModeType.Above; + Assert.AreEqual(Popup.ContextualModeType.Above, popup.ContextualMode, "Should be equals to the set value of ContextualMode"); + + //Misspelling, will be fixed later by ACR. + popup.ContextualMode = Popup.ContextualModeType.Rright; + Assert.AreEqual(Popup.ContextualModeType.Rright, popup.ContextualMode, "Should be equals to the set value of ContextualMode"); + + popup.ContextualMode = Popup.ContextualModeType.Below; + Assert.AreEqual(Popup.ContextualModeType.Below, popup.ContextualMode, "Should be equals to the set value of ContextualMode"); + + popup.ContextualMode = Popup.ContextualModeType.Left; + Assert.AreEqual(Popup.ContextualModeType.Left, popup.ContextualMode, "Should be equals to the set value of ContextualMode"); + + popup.Unparent(); } [Test] @@ -487,9 +859,22 @@ namespace Tizen.NUI.Tests public void AnimationDuration_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + popup.AnimationDuration = 0.6f; + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + Assert.AreEqual(0.6f, popup.AnimationDuration, "Should be equals to the set value of AnimationDuration"); + + popup.Unparent(); } [Test] @@ -502,9 +887,31 @@ namespace Tizen.NUI.Tests public void AnimationMode_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + popup.AnimationMode = Popup.AnimationModeType.Custom; - Assert.AreEqual(Popup.AnimationModeType.Custom, popup.AnimationMode, "Should be equals to the set value of AnimationMode"); + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + + Assert.AreEqual(Popup.AnimationModeType.Custom, popup.AnimationMode, "Should be equals to the set value of AnimationMode"); + + popup.AnimationMode = Popup.AnimationModeType.None; + Assert.AreEqual(Popup.AnimationModeType.None, popup.AnimationMode, "Should be equals to the set value of AnimationMode"); + + popup.AnimationMode = Popup.AnimationModeType.Zoom; + Assert.AreEqual(Popup.AnimationModeType.Zoom, popup.AnimationMode, "Should be equals to the set value of AnimationMode"); + + popup.AnimationMode = Popup.AnimationModeType.Fade; + Assert.AreEqual(Popup.AnimationModeType.Fade, popup.AnimationMode, "Should be equals to the set value of AnimationMode"); + + popup.Unparent(); } [Test] @@ -517,9 +924,22 @@ namespace Tizen.NUI.Tests public void AutoHideDelay_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + popup.AutoHideDelay = 10; + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + Assert.AreEqual(10, popup.AutoHideDelay, "Should be equals to the set value of AutoHideDelay"); + + popup.Unparent(); } [Test] @@ -532,9 +952,25 @@ namespace Tizen.NUI.Tests public void BackingEnabled_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + popup.BackingEnabled = true; - Assert.AreEqual(true, popup.BackingEnabled, "Should be equals to the set value of BackingEnabled"); + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + + Assert.AreEqual(true, popup.BackingEnabled, "Should be equals to the set value of BackingEnabled"); + + popup.BackingEnabled = false; + Assert.AreEqual(false, popup.BackingEnabled, "Should be equals to the set value of BackingEnabled"); + + popup.Unparent(); } [Test] @@ -547,14 +983,30 @@ namespace Tizen.NUI.Tests public void BackingColor_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); - Vector4 color = new Vector4(1.0f, 1.0f, 0.0f, 0.0f); - popup.BackingColor = color; + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + var color = new Vector4(1.0f, 1.0f, 0.0f, 0.0f); + + Assert.IsNotNull(color, "Should not be a Null : Vector4"); + Assert.IsInstanceOf(color, "Should be an instance of : Vector4"); + popup.BackingColor = color; + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + Assert.AreEqual(color.R, popup.BackingColor.R, "Should be equals to the set value of BackingColor.R"); Assert.AreEqual(color.G, popup.BackingColor.G, "Should be equals to the set value of BackingColor.G"); Assert.AreEqual(color.B, popup.BackingColor.B, "Should be equals to the set value of BackingColor.B"); Assert.AreEqual(color.A, popup.BackingColor.A, "Should be equals to the set value of BackingColor.A"); + + popup.Unparent(); } [Test] @@ -567,11 +1019,28 @@ namespace Tizen.NUI.Tests public void PopupBackgroundImage_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); - ImageView imageView = new ImageView(image_path); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + var imageView = new ImageView(image_path); + + Assert.IsNotNull(imageView, "Should not be a Null : ImageView"); + Assert.IsInstanceOf(imageView, "Should be an instance of : ImageView"); + string imageString = imageView.ResourceUrl; popup.PopupBackgroundImage = imageString; + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + Assert.AreEqual(imageString, popup.PopupBackgroundImage, "Should be equals to the set value of PopupBackgroundImage"); + + popup.Unparent(); } [Test] @@ -584,14 +1053,30 @@ namespace Tizen.NUI.Tests public void PopupBackgroundBorder_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); - Rectangle boreder = new Rectangle(1, 1, 0, 0); - popup.PopupBackgroundBorder = boreder; + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + var boreder = new Rectangle(1, 1, 0, 0); + + Assert.IsNotNull(boreder, "Should not be a Null : Rectangle"); + Assert.IsInstanceOf(boreder, "Should be an instance of : Rectangle"); + + popup.PopupBackgroundBorder = boreder; + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + Assert.AreEqual(1, popup.PopupBackgroundBorder.X, "Should be equals to the set value of PopupBackgroundBorder.x"); Assert.AreEqual(1, popup.PopupBackgroundBorder.Y, "Should be equals to the set value of PopupBackgroundBorder.y"); Assert.AreEqual(0, popup.PopupBackgroundBorder.Width, "Should be equals to the set value of PopupBackgroundBorder.width"); Assert.AreEqual(0, popup.PopupBackgroundBorder.Height, "Should be equals to the set value of PopupBackgroundBorder.height"); + + popup.Unparent(); } [Test] @@ -604,11 +1089,28 @@ namespace Tizen.NUI.Tests public void TailUpImage_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); - ImageView imageView = new ImageView(image_path); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + var imageView = new ImageView(image_path); + + Assert.IsNotNull(imageView, "Should not be a Null : ImageView"); + Assert.IsInstanceOf(imageView, "Should be an instance of : ImageView"); + string imageString = imageView.ResourceUrl; popup.TailUpImage = imageString; + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + Assert.AreEqual(imageString, popup.TailUpImage, "Should be equals to the set value of TailUpImage"); + + popup.Unparent(); } [Test] @@ -621,11 +1123,28 @@ namespace Tizen.NUI.Tests public void TailDownImage_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); - ImageView imageView = new ImageView(image_path); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + var imageView = new ImageView(image_path); + + Assert.IsNotNull(imageView, "Should not be a Null : ImageView"); + Assert.IsInstanceOf(imageView, "Should be an instance of : ImageView"); + string imageString = imageView.ResourceUrl; popup.TailDownImage = imageString; + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + Assert.AreEqual(imageString, popup.TailDownImage, "Should be equals to the set value of TailDownImage"); + + popup.Unparent(); } [Test] @@ -638,11 +1157,28 @@ namespace Tizen.NUI.Tests public void TailLeftImage_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); - ImageView imageView = new ImageView(image_path); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + var imageView = new ImageView(image_path); + + Assert.IsNotNull(imageView, "Should not be a Null : ImageView"); + Assert.IsInstanceOf(imageView, "Should be an instance of : ImageView"); + string imageString = imageView.ResourceUrl; popup.TailLeftImage = imageString; + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + Assert.AreEqual(imageString, popup.TailLeftImage, "Should be equals to the set value of TailLeftImage"); + + popup.Unparent(); } [Test] @@ -655,11 +1191,28 @@ namespace Tizen.NUI.Tests public void TailRightImage_SET_GET_VALUE() { /* TEST CODE */ - Popup popup = new Popup(); - ImageView imageView = new ImageView(image_path); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + var imageView = new ImageView(image_path); + + Assert.IsNotNull(imageView, "Should not be a Null : ImageView"); + Assert.IsInstanceOf(imageView, "Should be an instance of : ImageView"); + string imageString = imageView.ResourceUrl; popup.TailRightImage = imageString; + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(popup); + Assert.AreEqual(imageString, popup.TailRightImage, "Should be equals to the set value of TailRightImage"); + + popup.Unparent(); } [Test] @@ -667,14 +1220,26 @@ namespace Tizen.NUI.Tests [Description("Test Dispose, try to dispose the Popup.")] [Property("SPEC", "Tizen.NUI.UIComponents.Popup.Dispose M")] [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR MCST")] + [Property("CRITERIA", "MCST")] [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] public void Dispose_TEST() { /* TEST CODE */ try { - Popup popup = new Popup(); + var popup = new Popup(); + + Assert.IsNotNull(popup, "Should not be a Null : Popup"); + Assert.IsInstanceOf(popup, "Should be an instance of : Popup"); + + popup.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.Add(popup); + + popup.Unparent(); popup.Dispose(); } catch (Exception e) @@ -684,5 +1249,6 @@ namespace Tizen.NUI.Tests Assert.Fail("Caught Exception" + e.ToString()); } } + } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSProgressBar.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSProgressBar.cs index ddb71e12a..1d97355fc 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSProgressBar.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSProgressBar.cs @@ -40,7 +40,17 @@ namespace Tizen.NUI.Tests public void ProgressBar_INIT() { var progress = new ProgressBar(); + Assert.IsNotNull(progress, "Should not be a Null : ProgressBar"); Assert.IsInstanceOf(progress, "Progress Contruct Fail"); + + progress.Size2D = new Size2D(100, 100); + + Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance"); + Assert.IsInstanceOf(Window.Instance, "Should be an instance of : Window.Instance"); + + Window.Instance.GetDefaultLayer().Add(progress); + + progress.Unparent(); } [Test]