From: dongsug.song Date: Thu, 2 May 2019 04:23:49 +0000 (+0900) Subject: [NUI][ACR-214][Add TCs for coverage] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F85%2F205285%2F2;p=test%2Ftct%2Fcsharp%2Fapi.git [NUI][ACR-214][Add TCs for coverage] Change-Id: Ib46559ef3638263fd86becd9746077e5c38e15ca Signed-off-by: dongsug.song --- diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextEditor.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextEditor.cs index 613227b9a..9b60fa483 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextEditor.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextEditor.cs @@ -666,8 +666,8 @@ namespace Tizen.NUI.Tests float height = 0.0f; textEditor.Underline.Find(0, "enable").Get(out enable); textEditor.Underline.Find(0, "color").Get(color); - textEditor.Underline.Find(0, "height").Get(out height); - + textEditor.Underline.Find(0, "height").Get(out height); + Assert.AreEqual(true, enable, "enable : should be equals to the set value"); Assert.AreEqual(1.0f, color.R, "color : should be equals to the set value"); Assert.AreEqual(0.1f, height, "height : should be equals to the set value"); @@ -1116,30 +1116,30 @@ namespace Tizen.NUI.Tests [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] public async Task ScrollStateChanged_CHECK_EVENT() { - var textEditor = new TextEditor() - { - Size2D = new Size2D(100, 60), - Text = "Hello Hello World World", - Focusable = true, - }; + var textEditor = new TextEditor() + { + Size2D = new Size2D(100, 60), + Text = "Hello Hello World World", + Focusable = true, + }; Window.Instance.Add(textEditor); - try - { - textEditor.ScrollStateChanged += OnScrollStateChanged; - FocusManager.Instance.SetCurrentFocusView(textEditor); - await Task.Delay(500); - Assert.IsTrue(_flagScrollStateChanged, "ScrollStateChanged is not be called"); + try + { + textEditor.ScrollStateChanged += OnScrollStateChanged; + FocusManager.Instance.SetCurrentFocusView(textEditor); + await Task.Delay(500); + Assert.IsTrue(_flagScrollStateChanged, "ScrollStateChanged is not be called"); } - 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()); + catch (Exception e) + { + Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); } finally - { - textEditor.ScrollStateChanged -= OnScrollStateChanged; - Window.Instance.Remove(textEditor); + { + textEditor.ScrollStateChanged -= OnScrollStateChanged; + Window.Instance.Remove(textEditor); } } @@ -1152,17 +1152,40 @@ namespace Tizen.NUI.Tests [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] public void MatchSystemLanguageDirectionProperty_CHECK_VALUE() { - var textEditor = new TextEditor(); - Assert.IsNotNull(textEditor, "Can't create success object TextEditor"); - Assert.IsInstanceOf(textEditor, "Should be an instance of TextEditor type."); - - textEditor.SetValue(TextEditor.MatchSystemLanguageDirectionProperty, false); - bool ret = (bool)textEditor.GetValue(TextEditor.MatchSystemLanguageDirectionProperty); - Assert.AreEqual(false, ret, "should be same"); - - textEditor.SetValue(TextEditor.MatchSystemLanguageDirectionProperty, true); - ret = (bool)textEditor.GetValue(TextEditor.MatchSystemLanguageDirectionProperty); + var textEditor = new TextEditor(); + Assert.IsNotNull(textEditor, "Can't create success object TextEditor"); + Assert.IsInstanceOf(textEditor, "Should be an instance of TextEditor type."); + + textEditor.SetValue(TextEditor.MatchSystemLanguageDirectionProperty, false); + bool ret = (bool)textEditor.GetValue(TextEditor.MatchSystemLanguageDirectionProperty); + Assert.AreEqual(false, ret, "should be same"); + + textEditor.SetValue(TextEditor.MatchSystemLanguageDirectionProperty, true); + ret = (bool)textEditor.GetValue(TextEditor.MatchSystemLanguageDirectionProperty); Assert.AreEqual(true, ret, "should be same"); } + + [Test] + [Category("P1")] + [Description("Test MatchSystemLanguageDirection. Check whether MatchSystemLanguageDirection is working correctly or not.")] + [Property("SPEC", "Tizen.NUI.BaseComponents.TextEditor.MatchSystemLanguageDirection A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public void MatchSystemLanguageDirection_CHECK_VALUE() + { + var textEditor = new TextEditor(); + Assert.IsNotNull(textEditor, "Can't create success object TextEditor"); + Assert.IsInstanceOf(textEditor, "Should be an instance of TextEditor type."); + + textEditor.MatchSystemLanguageDirection = false; + bool ret = textEditor.MatchSystemLanguageDirection; + Assert.AreEqual(false, ret, "should be same"); + + textEditor.MatchSystemLanguageDirection = true; + ret = textEditor.MatchSystemLanguageDirection; + Assert.AreEqual(true, ret, "should be same"); + } + } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextField.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextField.cs index d1f91cd3f..e36126341 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextField.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextField.cs @@ -870,15 +870,15 @@ namespace Tizen.NUI.Tests value = new PropertyValue(0.1f); map.Insert("height", value); textField.Underline = map; - Assert.AreEqual(map.Count(), textField.Underline.Count(), "Retrieved Underline' count should be equal to set value"); - + Assert.AreEqual(map.Count(), textField.Underline.Count(), "Retrieved Underline' count should be equal to set value"); + bool enable = false; Vector4 color = new Vector4(); float height = 0.0f; textField.Underline.Find(0, "enable").Get(out enable); textField.Underline.Find(0, "color").Get(color); - textField.Underline.Find(0, "height").Get(out height); - + textField.Underline.Find(0, "height").Get(out height); + Assert.AreEqual(true, enable, "enable : should be equals to the set value"); Assert.AreEqual(1.0f, color.R, "color : should be equals to the set value"); Assert.AreEqual(0.1f, height, "height : should be equals to the set value"); @@ -1194,16 +1194,38 @@ namespace Tizen.NUI.Tests [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] public void MatchSystemLanguageDirectionProperty_CHECK_VALUE() { - var textField = new TextField(); - Assert.IsNotNull(textField, "Can't create success object TextField"); - Assert.IsInstanceOf(textField, "Should be an instance of TextField type."); - - textField.SetValue(TextField.MatchSystemLanguageDirectionProperty, false); - bool ret = (bool)textField.GetValue(TextField.MatchSystemLanguageDirectionProperty); + var textField = new TextField(); + Assert.IsNotNull(textField, "Can't create success object TextField"); + Assert.IsInstanceOf(textField, "Should be an instance of TextField type."); + + textField.SetValue(TextField.MatchSystemLanguageDirectionProperty, false); + bool ret = (bool)textField.GetValue(TextField.MatchSystemLanguageDirectionProperty); + Assert.AreEqual(false, ret, "should be same"); + + textField.SetValue(TextField.MatchSystemLanguageDirectionProperty, true); + ret = (bool)textField.GetValue(TextField.MatchSystemLanguageDirectionProperty); + Assert.AreEqual(true, ret, "should be same"); + } + + [Test] + [Category("P1")] + [Description("Test MatchSystemLanguageDirection. Check whether MatchSystemLanguageDirection is working correctly or not.")] + [Property("SPEC", "Tizen.NUI.BaseComponents.TextField.MatchSystemLanguageDirection A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public void MatchSystemLanguageDirection_CHECK_VALUE() + { + var textField = new TextField(); + Assert.IsNotNull(textField, "Can't create success object TextField"); + Assert.IsInstanceOf(textField, "Should be an instance of TextField type."); + + textField.MatchSystemLanguageDirection = false; + bool ret = textField.MatchSystemLanguageDirection; Assert.AreEqual(false, ret, "should be same"); - textField.SetValue(TextField.MatchSystemLanguageDirectionProperty, true); - ret = (bool)textField.GetValue(TextField.MatchSystemLanguageDirectionProperty); + textField.MatchSystemLanguageDirection = true; + ret = textField.MatchSystemLanguageDirection; Assert.AreEqual(true, ret, "should be same"); } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextLabel.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextLabel.cs index c696e4ce9..73b49f41b 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextLabel.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextLabel.cs @@ -412,14 +412,14 @@ namespace Tizen.NUI.Tests map.Insert("height", value); textLabel.Underline = map; Assert.AreEqual(map.Count(), textLabel.Underline.Count(), "Retrieved Underline should be equal to set value"); - + bool enable = false; Vector4 color = new Vector4(); float height = 0.0f; textLabel.Underline.Find(0, "enable").Get(out enable); textLabel.Underline.Find(0, "color").Get(color); - textLabel.Underline.Find(0, "height").Get(out height); - + textLabel.Underline.Find(0, "height").Get(out height); + Assert.AreEqual(true, enable, "enable : should be equals to the set value"); Assert.AreEqual(1.0f, color.R, "color : should be equals to the set value"); Assert.AreEqual(0.1f, height, "height : should be equals to the set value"); @@ -712,18 +712,41 @@ namespace Tizen.NUI.Tests [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] public void MatchSystemLanguageDirectionProperty_CHECK_VALUE() { - var textLabel = new TextLabel(); - Assert.IsNotNull(textLabel, "Can't create success object textLabel"); - Assert.IsInstanceOf(textLabel, "Should be an instance of textLabel type."); - - textLabel.SetValue(TextLabel.MatchSystemLanguageDirectionProperty, false); - bool ret = (bool)textLabel.GetValue(TextLabel.MatchSystemLanguageDirectionProperty); + var textLabel = new TextLabel(); + Assert.IsNotNull(textLabel, "Can't create success object textLabel"); + Assert.IsInstanceOf(textLabel, "Should be an instance of textLabel type."); + + textLabel.SetValue(TextLabel.MatchSystemLanguageDirectionProperty, false); + bool ret = (bool)textLabel.GetValue(TextLabel.MatchSystemLanguageDirectionProperty); + Assert.AreEqual(false, ret, "should be same"); + + textLabel.SetValue(TextLabel.MatchSystemLanguageDirectionProperty, true); + ret = (bool)textLabel.GetValue(TextLabel.MatchSystemLanguageDirectionProperty); + Assert.AreEqual(true, ret, "should be same"); + } + + [Test] + [Category("P1")] + [Description("Test MatchSystemLanguageDirection. Check whether MatchSystemLanguageDirection is working correctly or not.")] + [Property("SPEC", "Tizen.NUI.BaseComponents.TextLabel.MatchSystemLanguageDirection A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public void MatchSystemLanguageDirection_CHECK_VALUE() + { + var textLabel = new TextLabel(); + Assert.IsNotNull(textLabel, "Can't create success object textLabel"); + Assert.IsInstanceOf(textLabel, "Should be an instance of textLabel type."); + + textLabel.MatchSystemLanguageDirection = false; + bool ret = textLabel.MatchSystemLanguageDirection; Assert.AreEqual(false, ret, "should be same"); - textLabel.SetValue(TextLabel.MatchSystemLanguageDirectionProperty, true); - ret = (bool)textLabel.GetValue(TextLabel.MatchSystemLanguageDirectionProperty); + textLabel.MatchSystemLanguageDirection = true; + ret = textLabel.MatchSystemLanguageDirection; Assert.AreEqual(true, ret, "should be same"); } + } public class MyTexLabel : TextLabel