From: wenfeng.ge Date: Fri, 12 Oct 2018 11:05:17 +0000 (+0800) Subject: [NUI][Non-ACR][Update TCTs for Tizen.NUI] X-Git-Tag: tct5.0_m2~17^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F01%2F191201%2F14;p=test%2Ftct%2Fcsharp%2Fapi.git [NUI][Non-ACR][Update TCTs for Tizen.NUI] - To make coverage rate 100%, add some testcases for remain apis, don't have ACR or require TCT Change-Id: I841e842c1b3f12e128760dd921f9b52f97057c67 Signed-off-by: wenfeng.ge --- diff --git a/tct-suite-vs/Tizen.NUI.Tests/res/demoVideo.mp4 b/tct-suite-vs/Tizen.NUI.Tests/res/demoVideo.mp4 new file mode 100755 index 000000000..923221935 Binary files /dev/null and b/tct-suite-vs/Tizen.NUI.Tests/res/demoVideo.mp4 differ diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSAdaptor.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSAdaptor.cs new file mode 100755 index 000000000..feaed5001 --- /dev/null +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSAdaptor.cs @@ -0,0 +1,97 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; +using System; +using Tizen.NUI; +using Tizen.NUI.Test; + +namespace Tizen.NUI.Tests +{ + + [TestFixture] + [Description("Tizen.NUI.Adaptor Tests")] + public class AdaptorTests + { + private static string TAG = "NUI"; + + [SetUp] + public void Init() + { + Tizen.Log.Info(TAG, "Init() is called!"); + App.MainTitleChangeText("AdaptorTests"); + App.MainTitleChangeBackgroundColor(null); + } + + [TearDown] + public void Destroy() + { + Tizen.Log.Info(TAG, "Destroy() is called!"); + } + + [Test] + [Category("P1")] + [Description("Test Instance. Check whether Instance returns expected value or not.")] + [Property("SPEC", "Tizen.NUI.Adaptor.Instance A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void Instance_GET_VALUE() + { + /* TEST CODE */ + Adaptor adaptor = Adaptor.Instance; + Assert.IsInstanceOf(adaptor, "Should be an Instance of Adaptor!"); + } + + [Test] + [Category("P1")] + [Description("Test FeedKeyEvent.")] + [Property("SPEC", "Tizen.NUI.Adaptor.FeedKeyEvent M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void FeedKeyEvent_TEST() + { + /* TEST CODE */ + try + { + Key key = new Key() + { + KeyPressedName = "Up", + State = Key.StateType.Down, + }; + Adaptor adaptor = Adaptor.Instance; + adaptor.FeedKeyEvent(key); + } + 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 FeedWheelEvent.")] + [Property("SPEC", "Tizen.NUI.Adaptor.FeedWheelEvent M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void FeedWheelEvent_TEST() + { + /* TEST CODE */ + try + { + Vector2 point = new Vector2(1.0f, 1.0f); + Wheel wheel = new Wheel(Wheel.WheelType.MouseWheel, 1, 0x2, point, 1, 1000u); + Adaptor adaptor = Adaptor.Instance; + adaptor.FeedWheelEvent(wheel); + } + 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()); + } + } + } +} diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSAnimatedImageVisual.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSAnimatedImageVisual.cs index bdcb06029..21bb0cf3d 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSAnimatedImageVisual.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSAnimatedImageVisual.cs @@ -13,9 +13,18 @@ namespace Tizen.NUI.Tests { private static string TAG = "NUI"; private static string image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; + private static bool _flagComposingPropertyMap; + internal class MyAnimatedImageVisual : AnimatedImageVisual + { + protected override void ComposingPropertyMap() + { + _flagComposingPropertyMap = true; + base.ComposingPropertyMap(); + } + } [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("AnimatedImageVisualTests"); @@ -23,7 +32,7 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); } @@ -148,5 +157,29 @@ namespace Tizen.NUI.Tests Assert.AreEqual(image_path, url, "Retrieved URLS should be equal to set value"); } + [Test] + [Category("P1")] + [Description("Check override method ComposingPropertyMap is invoked when new AnimatedImageVisual instance.")] + [Property("SPEC", "Tizen.NUI.AnimatedImageVisual.ComposingPropertyMap M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public void ComposingPropertyMap_OVERRIDE_METHOD() + { + /*PRE CONDITION + * _flagComposingPropertyMap flag is initialize false value + * Create a instance MyAnimatedImageVisual + */ + _flagComposingPropertyMap = false; + Assert.False(_flagComposingPropertyMap, "_flagComposingPropertyMap should false initial"); + /**TEST CODE**/ + var myAnimatedImageVisual = new MyAnimatedImageVisual() + { + URL = image_path, + }; + Assert.IsInstanceOf(myAnimatedImageVisual, "Should be an instance of AnimatedImageVisual type."); + PropertyMap propertyMap = myAnimatedImageVisual.OutputVisualMap; + Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked."); + } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSBaseHandle.FocusRequestArgs.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSBaseHandle.FocusRequestArgs.cs new file mode 100755 index 000000000..df264b652 --- /dev/null +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSBaseHandle.FocusRequestArgs.cs @@ -0,0 +1,79 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; +using System; +using Tizen.NUI.Test; + +namespace Tizen.NUI.Tests +{ + [TestFixture] + [Description("Tizen.NUI.BaseHandle.FocusRequestArgs Tests")] + public class FocusRequestArgsTests + { + private static string TAG = "NUI"; + + [SetUp] + public void Init() + { + Tizen.Log.Info(TAG, "Init() is called!"); + App.MainTitleChangeText("FocusRequestArgsTests"); + App.MainTitleChangeBackgroundColor(null); + } + + [TearDown] + public void Destroy() + { + Tizen.Log.Info(TAG, "Destroy() is called!"); + } + + [Test] + [Category("P1")] + [Description("Create a FocusRequestArgs object. Check whether FocusRequestArgs is successfully created or not.")] + [Property("SPEC", "Tizen.NUI.BaseHandle.FocusRequestArgs.FocusRequestArgs C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public void FocusRequestArgs_INIT() + { + /* TEST CODE */ + var focusRequestArgs = new BaseHandle.FocusRequestArgs(); + Assert.IsNotNull(focusRequestArgs, "Can't create success object FocusRequestArgs"); + Assert.IsInstanceOf(focusRequestArgs, "Should be an instance of FocusRequestArgs type."); + } + + [Test] + [Category("P1")] + [Description("Test Focus. Check whether Focus is readable and writable.")] + [Property("SPEC", "Tizen.NUI.BaseHandle.FocusRequestArgs.Focus A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA","PRW")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public void Focus_SET_GET_VALUE() + { + /* TEST CODE */ + BaseHandle.FocusRequestArgs focusRequestArgs = new BaseHandle.FocusRequestArgs(); + focusRequestArgs.Focus = true; + Assert.AreEqual(true, focusRequestArgs.Focus, "Retrieved Focus should be equal to set value"); + + focusRequestArgs.Focus = false; + Assert.AreEqual(false, focusRequestArgs.Focus, "Retrieved Focus should be equal to set value"); + } + + [Test] + [Category("P1")] + [Description("Test Result. Check whether Result is readable and writable.")] + [Property("SPEC", "Tizen.NUI.BaseHandle.FocusRequestArgs.Result A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA","PRW")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public void Result_SET_GET_VALUE() + { + /* TEST CODE */ + BaseHandle.FocusRequestArgs focusRequestArgs = new BaseHandle.FocusRequestArgs(); + focusRequestArgs.Result = true; + Assert.AreEqual(true, focusRequestArgs.Result, "Retrieved Result should be equal to set value"); + + focusRequestArgs.Result = false; + Assert.AreEqual(false, focusRequestArgs.Result, "Retrieved Result should be equal to set value"); + } + } +} diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSBindableProperty.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSBindableProperty.cs new file mode 100755 index 000000000..7c63179a9 --- /dev/null +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSBindableProperty.cs @@ -0,0 +1,329 @@ +using System; +using System.Linq.Expressions; +using NUnit.Framework; +using Tizen.NUI.Binding; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.Tests +{ + [TestFixture] + [Description("Tizen.NUI.Binding.BindableProperty Tests")] + public class BindablePropertyTests + { + [SetUp] + public void Setup() + { + Console.WriteLine("BindablePropertyTests --------------- Setup()"); + } + + [TearDown] + public void TearDown() + { + Console.WriteLine("BindablePropertyTests --------------- TearDown()"); + } + + [Test] + [Category("P1")] + [Description("Check the type declaring the BindableProperty.")] + [Property("SPEC", "Tizen.NUI.Binding.BindableProperty.DeclaringType A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Feng Jin, feng16.jin@partner.samsung.com")] + public void DeclaringType_READ_ONLY() + { + /* TEST CODE */ + BindableProperty bindableProperty = BindableProperty.Create("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.Default, null, null, + null, null, null); + Assert.IsInstanceOf(bindableProperty.DeclaringType, "Should be instance of Type."); + Assert.AreEqual(bindableProperty.DeclaringType, typeof(string), "Not returning expected type."); + } + + [Test] + [Category("P1")] + [Description("Check the value for BindingMode.")] + [Property("SPEC", "Tizen.NUI.Binding.BindableProperty.DefaultBindingMode A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Feng Jin, feng16.jin@partner.samsung.com")] + public void DefaultBindingMode_READ_ONLY() + { + /* TEST CODE */ + BindableProperty bindableProperty = BindableProperty.Create("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay, null, null, + null, null, null); + Assert.IsInstanceOf(bindableProperty.DefaultBindingMode, "Should be instance of BindingMode."); + Assert.AreEqual(bindableProperty.DefaultBindingMode, BindingMode.TwoWay, "Not returning expected Value."); + } + + [Test] + [Category("P1")] + [Description("Check the value for BindableProperty.")] + [Property("SPEC", "Tizen.NUI.Binding.BindableProperty.DefaultValue A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Feng Jin, feng16.jin@partner.samsung.com")] + public void DefaultValue_READ_ONLY() + { + /* TEST CODE */ + BindableProperty bindableProperty = BindableProperty.Create("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay, null, null, + null, null, null); + Assert.IsInstanceOf(bindableProperty.DefaultValue, "Should be instance of Object."); + Assert.AreEqual(bindableProperty.DefaultValue, "TizenNew", "Not returning expected Value."); + } + + [Test] + [Category("P1")] + [Description("Check if BindableProperty is created form a BindablePropertyKey.")] + [Property("SPEC", "Tizen.NUI.Binding.BindableProperty.IsReadOnly A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Feng Jin, feng16.jin@partner.samsung.com")] + public void IsReadOnly_READ_ONLY() + { + /* TEST CODE */ + BindableProperty bindableProperty = BindableProperty.Create("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay, null, null, + null, null, null); + Assert.IsInstanceOf(bindableProperty.IsReadOnly, "Should be instance of Boolean."); + Assert.IsFalse(bindableProperty.IsReadOnly, "BindableProperty should not be readonly."); + } + + [Test] + [Category("P1")] + [Description("Check the property name.")] + [Property("SPEC", "Tizen.NUI.Binding.BindableProperty.PropertyName A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Feng Jin, feng16.jin@partner.samsung.com")] + public void PropertyName_READ_ONLY() + { + /* TEST CODE */ + BindableProperty bindableProperty = BindableProperty.Create("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay, null, null, + null, null, null); + Assert.IsInstanceOf(bindableProperty.PropertyName, "Should be instance of String."); + Assert.AreEqual(bindableProperty.PropertyName, "Tizen", "Not returning proper value."); + } + + [Test] + [Category("P1")] + [Description("Check the type of the BindableProperty.")] + [Property("SPEC", "Tizen.NUI.Binding.BindableProperty.ReturnType A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Feng Jin, feng16.jin@partner.samsung.com")] + public void ReturnType_READ_ONLY() + { + /* TEST CODE */ + BindableProperty bindableProperty = BindableProperty.Create("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay, null, null, + null, null, null); + Assert.IsInstanceOf(bindableProperty.ReturnType, "Should be instance of Type."); + Assert.AreEqual(bindableProperty.ReturnType, typeof(string), "Not returning proper Value."); + } + + [Test] + [Category("P1")] + [Description("Creates a new instance of the BindableProperty class.")] + [Property("SPEC", "Tizen.NUI.Binding.BindableProperty.Create M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Feng Jin, feng16.jin@partner.samsung.com")] + public void Create_CHECK_INSTANCE_CREATE_DEFAULT_VALUE_DELEGATE() + { + /* TEST CODE */ + var bindableProperty = BindableProperty.Create("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay, null, null, + null, null, null); + Assert.IsNotNull(bindableProperty, "Instance is null"); + Assert.IsInstanceOf(bindableProperty, "Should be instance of BindableProperty."); + } + + [Test] + [Category("P1")] + [Description("Creates a new instance of the BindableProperty class.")] + [Property("SPEC", "Tizen.NUI.Binding.BindableProperty.Create M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Feng Jin, feng16.jin@partner.samsung.com")] + public void Create_CHECK_INSTANCE_STRING() + { + /* TEST CODE */ + var bindableProperty = BindableProperty.Create("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay, null, null, + null, null); + Assert.IsNotNull(bindableProperty, "BindableProperty instance is null"); + Assert.IsInstanceOf(bindableProperty, "Should be instance of BindableProperty."); + } + + [Test] + [Category("P1")] + [Description("Creates a new instance of the BindableProperty class.")] + [Property("SPEC", "Tizen.NUI.Binding.BindableProperty.Create M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Feng Jin, feng16.jin@partner.samsung.com")] + public void Create_CHECK_INSTANCE_EXPRESSION() + { + /* TEST CODE */ + var bindableProperty = BindableProperty.Create(b => b.LabelText, null, BindingMode.TwoWay); + Assert.IsNotNull(bindableProperty, "BindableProperty instance is null"); + Assert.IsInstanceOf(bindableProperty, "Should be instance of BindableProperty."); + } + + [Test] + [Category("P1")] + [Description("Creates a new instance of the BindableProperty class.")] + [Property("SPEC", "Tizen.NUI.Binding.BindableProperty.Create M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Feng Jin, feng16.jin@partner.samsung.com")] + public void Create_CHECK_INSTANCE_EXPRESSION_CREATE_DEFAULT_VALUE_DELEGATE() + { + /* TEST CODE */ + BindableProperty.ValidateValueDelegate validateValueDelegate = (b, v) => true; + BindableProperty.BindingPropertyChangedDelegate changedDelegate = (b, ov, nv) => { }; + BindableProperty.BindingPropertyChangingDelegate changingDelegate = (b, ov, nv) => { }; + BindableProperty.CoerceValueDelegate coerceValueDelegate = (bindable, value) => value; + + var bindableProperty = BindableProperty.Create(b => b.LabelText, null, BindingMode.TwoWay, validateValueDelegate, changedDelegate, changingDelegate, coerceValueDelegate); + Assert.IsNotNull(bindableProperty, "BindableProperty instance is null"); + Assert.IsInstanceOf(bindableProperty, "Should be instance of BindableProperty."); + } + + [Test] + [Category("P1")] + [Description("Creates a new instance of the BindableProperty class for an attached property.")] + [Property("SPEC", "Tizen.NUI.Binding.BindableProperty.CreateAttached M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Feng Jin, feng16.jin@partner.samsung.com")] + public void CreateAttached_CHECK_INSTANCE_CREATE_DEFAULT_VALUE_DELEGATE() + { + /* TEST CODE */ + var bindableProperty = BindableProperty.CreateAttached("Tizen", typeof(string), typeof(string), "TizenNew"); + Assert.IsNotNull(bindableProperty, "BindableProperty instance is null"); + Assert.IsInstanceOf(bindableProperty, "Should be instance of BindableProperty."); + } + + [Test] + [Category("P1")] + [Description("Creates a new instance of the BindableProperty class for an attached property.")] + [Property("SPEC", "Tizen.NUI.Binding.BindableProperty.CreateAttached M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Feng Jin, feng16.jin@partner.samsung.com")] + public void CreateAttached_CHECK_INSTANCE_STRING() + { + /* TEST CODE */ + BindableProperty.ValidateValueDelegate validateValueDelegate = (b, v) => true; + BindableProperty.BindingPropertyChangedDelegate changedDelegate = (b, ov, nv) => { }; + BindableProperty.BindingPropertyChangingDelegate changingDelegate = (b, ov, nv) => { }; + BindableProperty.CoerceValueDelegate coerceValueDelegate = (bindable, value) => value; + + var bindableProperty = BindableProperty.CreateAttached("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay, validateValueDelegate, changedDelegate, changingDelegate, coerceValueDelegate); + Assert.IsNotNull(bindableProperty, "BindableProperty instance is null"); + Assert.IsInstanceOf(bindableProperty, "Should be instance of BindableProperty."); + } + + [Test] + [Category("P1")] + [Description("Creates a new instance of the BindableProperty class for attached read-only properties.")] + [Property("SPEC", "Tizen.NUI.Binding.BindableProperty.CreateAttachedReadOnly M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Feng Jin, feng16.jin@partner.samsung.com")] + public void CreateAttachedReadOnly_CHECK_INSTANCE_CREATE_DEFAULT_VALUE_DELEGATE() + { + /* TEST CODE */ + var bindableProperty = BindableProperty.CreateAttachedReadOnly("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay); + Assert.IsNotNull(bindableProperty, "BindableProperty instance is null"); + Assert.IsInstanceOf(bindableProperty, "Should be instance of BindableProperty."); + } + + [Test] + [Category("P1")] + [Description("Creates a new instance of the BindableProperty class for attached read-only properties.")] + [Property("SPEC", "Tizen.NUI.Binding.BindableProperty.CreateAttachedReadOnly M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Feng Jin, feng16.jin@partner.samsung.com")] + public void CreateAttachedReadOnly_CHECK_INSTANCE_STRING() + { + /* TEST CODE */ + BindableProperty.ValidateValueDelegate validateValueDelegate = (b, v) => true; + BindableProperty.BindingPropertyChangedDelegate changedDelegate = (b, ov, nv) => { }; + BindableProperty.BindingPropertyChangingDelegate changingDelegate = (b, ov, nv) => { }; + BindableProperty.CoerceValueDelegate coerceValueDelegate = (bindable, value) => value; + + var bindableProperty = BindableProperty.CreateAttachedReadOnly("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay, validateValueDelegate, changedDelegate, changingDelegate, coerceValueDelegate); + Assert.IsNotNull(bindableProperty, "BindableProperty instance is null"); + Assert.IsInstanceOf(bindableProperty, "Should be instance of BindableProperty."); + } + + [Test] + [Category("P1")] + [Description("Creates a new instance of the BindablePropertyKey class.")] + [Property("SPEC", "Tizen.NUI.Binding.BindableProperty.CreateReadOnly M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Feng Jin, feng16.jin@partner.samsung.com")] + public void CreateReadOnly_CHECK_INSTANCE_CREATE_DEFAULT_VALUE_DELEGATE() + { + /* TEST CODE */ + var bindableProperty = BindableProperty.CreateReadOnly("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay); + Assert.IsNotNull(bindableProperty, "BindableProperty instance is null"); + Assert.IsInstanceOf(bindableProperty, "Should be instance of BindableProperty."); + } + + [Test] + [Category("P1")] + [Description("Creates a new instance of the BindablePropertyKey class.")] + [Property("SPEC", "Tizen.NUI.Binding.BindableProperty.CreateReadOnly M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Feng Jin, feng16.jin@partner.samsung.com")] + public void CreateReadOnly_CHECK_INSTANCE_STRING() + { + /* TEST CODE */ + BindableProperty.ValidateValueDelegate validateValueDelegate = (b, v) => true; + BindableProperty.BindingPropertyChangedDelegate changedDelegate = (b, ov, nv) => { }; + BindableProperty.BindingPropertyChangingDelegate changingDelegate = (b, ov, nv) => { }; + BindableProperty.CoerceValueDelegate coerceValueDelegate = (bindable, value) => value; + + var bindableProperty = BindableProperty.CreateReadOnly("Tizen", typeof(string), typeof(string), "TizenNew", BindingMode.TwoWay, validateValueDelegate, changedDelegate, changingDelegate, coerceValueDelegate); + Assert.IsNotNull(bindableProperty, "BindableProperty instance is null"); + Assert.IsInstanceOf(bindableProperty, "Should be instance of BindableProperty."); + } + + [Test] + [Category("P1")] + [Description("Creates a new instance of the BindablePropertyKey class.")] + [Property("SPEC", "Tizen.NUI.Binding.BindableProperty.CreateReadOnly M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Feng Jin, feng16.jin@partner.samsung.com")] + public void CreateReadOnly_CHECK_INSTANCE_EXPRESSION() + { + /* TEST CODE */ + BindableProperty.ValidateValueDelegate validateValueDelegate = (b, v) => true; + BindableProperty.BindingPropertyChangedDelegate changedDelegate = (b, ov, nv) => { }; + BindableProperty.BindingPropertyChangingDelegate changingDelegate = (b, ov, nv) => { }; + BindableProperty.CoerceValueDelegate coerceValueDelegate = (bindable, value) => value; + + var bindableProperty = BindableProperty.CreateReadOnly(b => b.LabelText, "Tizen", BindingMode.TwoWay, validateValueDelegate, changedDelegate, changingDelegate, coerceValueDelegate); + Assert.IsNotNull(bindableProperty, "BindableProperty instance is null"); + Assert.IsInstanceOf(bindableProperty, "Should be instance of BindableProperty."); + } + + [Test] + [Category("P1")] + [Description("Creates a new instance of the BindablePropertyKey class.")] + [Property("SPEC", "Tizen.NUI.Binding.BindableProperty.CreateReadOnly M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Feng Jin, feng16.jin@partner.samsung.com")] + public void CreateReadOnly_CHECK_INSTANCE_EXPRESSION_CREATE_DEFAULT_VALUE_DELEGATE() + { + /* TEST CODE */ + var bindableProperty = BindableProperty.CreateReadOnly(b => b.LabelText, "Tizen", BindingMode.TwoWay); + Assert.IsNotNull(bindableProperty, "BindableProperty instance is null"); + Assert.IsInstanceOf(bindableProperty, "Should be instance of BindableProperty."); + } + } +} diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSBorderVisual.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSBorderVisual.cs index 4b8924772..908238b97 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSBorderVisual.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSBorderVisual.cs @@ -11,9 +11,18 @@ namespace Tizen.NUI.Tests public class BorderVisualTests { private static string TAG = "NUI"; + private static bool _flagComposingPropertyMap; + internal class MyBorderVisual : BorderVisual + { + protected override void ComposingPropertyMap() + { + _flagComposingPropertyMap = true; + base.ComposingPropertyMap(); + } + } [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, " Init() is called!"); App.MainTitleChangeText("BorderVisualTests"); @@ -22,7 +31,7 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, " Destroy() is called!"); } @@ -90,5 +99,31 @@ namespace Tizen.NUI.Tests borderVisualMap.AntiAliasing = true; Assert.AreEqual(true, borderVisualMap.AntiAliasing, "Retrieved AntiAliasing should be equal to set value"); } + + [Test] + [Category("P1")] + [Description("Check override method ComposingPropertyMap is invoked when new BorderVisual instance.")] + [Property("SPEC", "Tizen.NUI.BorderVisual.ComposingPropertyMap M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public void ComposingPropertyMap_OVERRIDE_METHOD() + { + /*PRE CONDITION + * _flagComposingPropertyMap flag is initialize false value + * Create a instance MyBorderVisual + */ + _flagComposingPropertyMap = false; + Assert.False(_flagComposingPropertyMap, "_flagComposingPropertyMap should false initial"); + /**TEST CODE**/ + var myBorderVisual = new MyBorderVisual() + { + Color = new Color(1.0f, 0.3f, 0.5f, 1.0f), + BorderSize = 1.0f, + }; + Assert.IsInstanceOf(myBorderVisual, "Should be an instance of BorderVisual type."); + PropertyMap propertyMap = myBorderVisual.OutputVisualMap; + Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked."); + } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSColorVisual.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSColorVisual.cs index 3bd60912a..3386a1ebf 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSColorVisual.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSColorVisual.cs @@ -11,9 +11,18 @@ namespace Tizen.NUI.Tests public class ColorVisualTests { private static string TAG = "NUI"; + private static bool _flagComposingPropertyMap; + internal class MyColorVisual : ColorVisual + { + protected override void ComposingPropertyMap() + { + _flagComposingPropertyMap = true; + base.ComposingPropertyMap(); + } + } [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, " Init() is called!"); App.MainTitleChangeText("ColorVisualTests"); @@ -21,7 +30,7 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, " Destroy() is called!"); } @@ -77,5 +86,30 @@ namespace Tizen.NUI.Tests colorVisualMap.RenderIfTransparent = false; Assert.AreEqual(false, colorVisualMap.RenderIfTransparent, "Retrieved RenderIfTransparent should be equal to set value"); } + + [Test] + [Category("P1")] + [Description("Check override method ComposingPropertyMap is invoked when new ColorVisual instance.")] + [Property("SPEC", "Tizen.NUI.ColorVisual.ComposingPropertyMap M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public void ComposingPropertyMap_OVERRIDE_METHOD() + { + /*PRE CONDITION + * _flagComposingPropertyMap flag is initialize false value + * Create a instance MyColorVisual + */ + _flagComposingPropertyMap = false; + Assert.False(_flagComposingPropertyMap, "_flagComposingPropertyMap should false initial"); + /**TEST CODE**/ + var myColorVisual = new MyColorVisual() + { + Color = new Color(1.0f, 0.3f, 0.5f, 1.0f), + }; + Assert.IsInstanceOf(myColorVisual, "Should be an instance of ColorVisual type."); + PropertyMap propertyMap = myColorVisual.OutputVisualMap; + Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked."); + } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSCustomView.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSCustomView.cs index 3593b41d3..7dfb49df3 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSCustomView.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSCustomView.cs @@ -224,22 +224,341 @@ namespace Tizen.NUI.Tests [Test] [Category("P1")] - [Description("Test Dispose, try to dispose the CustomView.")] - [Property("SPEC", "Tizen.NUI.BaseComponents.CustomView.Dispose M")] + [Description("Test CalculateChildSizeBase, try to calculate the size for a child using the base view object")] + [Property("SPEC", "Tizen.NUI.BaseComponents.CustomView.CalculateChildSizeBase M")] [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR MCST")] - [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void Dispose_TEST() + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junqing Ma, junqing.ma@samsung.com")] + public void CalculateChildSizeBase_CHECK_RETURN_VALUE() + { + /* TEST CODE */ + View child = new View(); + child.Size2D = new Size2D(150, 150); + + MyCustomView custom = new MyCustomView(); + custom.Size2D = new Size2D(0, 0); + + float v = custom.CalculateChildSize(child, DimensionType.AllDimensions); + Assert.AreEqual(0.0f, v, "The child size of CustomView is not correct here."); + + } + + [Test] + [Category("P1")] + [Description("Test CreateTransition, try to create transition effect on the control")] + [Property("SPEC", "Tizen.NUI.BaseComponents.CustomView.CreateTransition M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junqing Ma, junqing.ma@samsung.com")] + public void CreateTransition_TEST() + { + /* TEST CODE */ + MyCustomView view = new MyCustomView(); + + PropertyMap animator = new PropertyMap(); + animator.Add("alphaFunction", new PropertyValue("LINEAR")); + + PropertyMap timePeriod = new PropertyMap(); + timePeriod.Add("duration", new PropertyValue(0.8f)); + timePeriod.Add("delay", new PropertyValue(0.0f)); + animator.Add("timePeriod", new PropertyValue(timePeriod)); + + PropertyMap _transition = new PropertyMap(); + _transition.Add("target", new PropertyValue("testVisual")); + _transition.Add("property", new PropertyValue("pixelArea")); + _transition.Add("targetValue", new PropertyValue(new Vector4(0, 0, 0, 1))); + _transition.Add("targetValue", new PropertyValue(new Vector4(0, 0, 1, 1))); + _transition.Add("animator", new PropertyValue(animator)); + + var transitionData = new TransitionData(_transition); + Assert.IsNotNull(transitionData, "The transitionData shouldn't be null"); + Animation animation = view._CreateTransition(transitionData); + Assert.IsInstanceOf(animation, "Should return Animation instance."); + } + + [Test] + [Category("P1")] + [Description("Test EmitFocusSignal, try to emits the KeyInputFocusGained signal if true")] + [Property("SPEC", "Tizen.NUI.BaseComponents.CustomView.EmitFocusSignal M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junqing Ma, junqing.ma@samsung.com")] + public void EmitFocusSignal_TEST() { /* TEST CODE */ try { - CustomView customView = new CustomView("CustomView", CustomViewBehaviour.DisableSizeNegotiation); - customView.Dispose(); + MyCustomView view = new MyCustomView(); + view._EmitFocusSignal(false); + } + catch(Exception e) + { + Tizen.Log.Error("Test CustomView.cs", "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 EnableVisual, try to sets the given visual to be displayed or not when parent staged")] + [Property("SPEC", "Tizen.NUI.BaseComponents.CustomView.EnableVisual M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junqing Ma, junqing.ma@samsung.com")] + public void EnableVisual_TEST() + { + /* TEST CODE */ + try + { + MyCustomView view = new MyCustomView(); + view._EnableVisual(0, true); } catch (Exception e) { - Tizen.Log.Error("Test CellPosition.cs", "Caught Exception" + e.ToString()); + Tizen.Log.Error("Test CustomView.cs", "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 GetHeightForWidthBase, Check whether it return the right value")] + [Property("SPEC", "Tizen.NUI.BaseComponents.CustomView.GetHeightForWidthBase M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junqing Ma, junqing.ma@samsung.com")] + public void GetHeightForWidthBase_CHECK_RETURN_VALUE() + { + /* TEST CODE */ + MyCustomView view = new MyCustomView("CustomView", CustomViewBehaviour.DisableSizeNegotiation); + float height = view._GetHeightForWidth(1.0f); + Assert.AreEqual(1.0f, height, "The height of customView is not correct here."); + } + + [Test] + [Category("P1")] + [Description("Test GetVisual, Check whether it return the right value")] + [Property("SPEC", "Tizen.NUI.BaseComponents.CustomView.GetVisual M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junqing Ma, junqing.ma@samsung.com")] + public void GetVisual_CHECK_RETURN_VALUE() + { + MyCustomView view = new MyCustomView("CustomView", CustomViewBehaviour.DisableSizeNegotiation); + VisualFactory visualfactory = VisualFactory.Instance; + PropertyMap map = new PropertyMap(); + map.Insert(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text)); + map.Insert(Visual.Property.Type, new PropertyValue("")); + VisualBase visual = visualfactory.CreateVisual(map); + visual.Name = "test visual"; + + view._EnableVisual(0, true); + view._RegisterVisual(0, visual); + VisualBase ret = view._GetVisual(0); + Assert.AreEqual("test visual", ret.Name, "The visual get from CustomView is not correct here"); + } + + [Test] + [Category("P1")] + [Description("Test GetWidthForHeightBase, Check whether it return the right value")] + [Property("SPEC", "Tizen.NUI.BaseComponents.CustomView.GetWidthForHeightBase M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junqing Ma, junqing.ma@samsung.com")] + public void GetWidthForHeightBase_CHECK_RETURN_VALUE() + { + /* TEST CODE */ + MyCustomView view = new MyCustomView("CustomView", CustomViewBehaviour.DisableSizeNegotiation); + float width = view._GetWidthForHeight(1.0f); + Assert.AreEqual(1.0f, width, "The width of customView is not correct here."); + } + + [Test] + [Category("P1")] + [Description("Test IsVisualEnabled, Check whether it return the right value")] + [Property("SPEC", "Tizen.NUI.BaseComponents.CustomView.IsVisualEnabled M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junqing Ma, junqing.ma@samsung.com")] + public void IsVisualEnabled_CHECK_RETURN_VALUE() + { + /* TEST CODE */ + MyCustomView view = new MyCustomView("CustomView", CustomViewBehaviour.DisableSizeNegotiation); + + VisualFactory visualfactory = VisualFactory.Instance; + PropertyMap map = new PropertyMap(); + map.Insert(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text)); + map.Insert(Visual.Property.Type, new PropertyValue("")); + VisualBase visual = visualfactory.CreateVisual(map); + visual.Name = "test visual"; + + view._EnableVisual(0, true); + view._RegisterVisual(0, visual); + + bool ret = view._IsVisualEnabled(0); + + Assert.AreEqual(true, ret, "The return value of CustomView is not correct here"); + } + + + + [Test] + [Category("P1")] + [Description("Test UnregisterVisual, try to unregister visual")] + [Property("SPEC", "Tizen.NUI.BaseComponents.CustomView.UnregisterVisual M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junqing Ma, junqing.ma@samsung.com")] + public void UnregisterVisual_TEST() + { + /* TEST CODE */ + MyCustomView view = new MyCustomView("CustomView", CustomViewBehaviour.DisableSizeNegotiation); + + VisualFactory visualfactory = VisualFactory.Instance; + PropertyMap map = new PropertyMap(); + map.Insert(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text)); + map.Insert(Visual.Property.Type, new PropertyValue("")); + VisualBase visual = visualfactory.CreateVisual(map); + visual.Name = "test visual"; + + view._EnableVisual(0, true); + view._EnableVisual(1, true); + + try + { + view._RegisterVisual(0, visual); + view._RegisterVisual(1, visual, true); + } + catch (Exception e) + { + Tizen.Log.Error("Test CustomView.cs", "Caught Exception" + e.ToString()); + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); + } + + try + { + view._UnregisterVisual(0); + view._UnregisterVisual(1); + } + catch (Exception e) + { + Tizen.Log.Error("Test CustomView.cs", "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 RelayoutDependentOnChildrenBase. Check whether it return the right value")] + [Property("SPEC", "Tizen.NUI.BaseComponents.CustomView.RelayoutDependentOnChildrenBase M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "Junqing Ma, junqing.ma@samsung.com")] + public void RelayoutDependentOnChildrenBase_CHECK_RETURN_VALUE() + { + /* TEST CODE */ + MyCustomView view = new MyCustomView("CustomView", CustomViewBehaviour.DisableSizeNegotiation); + bool ret = view._RelayoutDependentOnChildren(); + Assert.AreEqual(true, ret, "The return value should be true here."); + } + + [Test] + [Category("P1")] + [Description("Test RelayoutDependentOnChildrenBase. Check whether it return the right value")] + [Property("SPEC", "Tizen.NUI.BaseComponents.CustomView.RelayoutDependentOnChildrenBase M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "Tizen.NUI.DimensionType")] + [Property("AUTHOR", "Junqing Ma, junqing.ma@samsung.com")] + public void RelayoutDependentOnChildrenBase_WITH_DIMENSIONTYPE_CHECK_RETURN_VALUE() + { + /* TEST CODE */ + MyCustomView view = new MyCustomView("CustomView", CustomViewBehaviour.DisableSizeNegotiation); + bool ret = view._RelayoutDependentOnChildren(DimensionType.AllDimensions); + Assert.AreEqual(true, ret, "The return value should be true here."); + } + + [Test] + [Category("P1")] + [Description("Test RelayoutRequest, try to request a relayout")] + [Property("SPEC", "Tizen.NUI.BaseComponents.CustomView.RelayoutRequest M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Junqing Ma, junqing.ma@samsung.com")] + public void RelayoutRequest_TEST() + { + /* TEST CODE */ + try + { + MyCustomView view = new MyCustomView("CustomView", CustomViewBehaviour.DisableSizeNegotiation); + view._RelayoutRequest(); + } + catch(Exception e) + { + Tizen.Log.Error("Test CustomView.cs", "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 RegisterVisual, try to register a visual")] + [Property("SPEC", "Tizen.NUI.BaseComponents.CustomView.RegisterVisual M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "int, Tizen.NUI.VisualBase")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public void RegisterVisual_TEST_PARAM2() + { + /* TEST CODE */ + try + { + MyCustomView view = new MyCustomView("CustomView", CustomViewBehaviour.DisableSizeNegotiation); + int visualIndex = view.RegisterProperty("visualName", new PropertyValue("visualName"), PropertyAccessMode.ReadWrite); + ColorVisual colorVisual = new ColorVisual(); + colorVisual.Color = new Color(1.0f, 0.3f, 0.5f, 1.0f); + VisualBase visual = VisualFactory.Instance.CreateVisual(colorVisual.OutputVisualMap); + view._RegisterVisual(visualIndex, visual); + } + catch (Exception e) + { + Tizen.Log.Error("Test CustomView.cs", "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 RegisterVisual, try to register a visual")] + [Property("SPEC", "Tizen.NUI.BaseComponents.CustomView.RegisterVisual M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "int, Tizen.NUI.VisualBase, bool")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public void RegisterVisual_TEST_PARAM3() + { + /* TEST CODE */ + try + { + MyCustomView view = new MyCustomView("CustomView", CustomViewBehaviour.DisableSizeNegotiation); + int visualIndex = view.RegisterProperty("visualName", new PropertyValue("visualName"), PropertyAccessMode.ReadWrite); + ColorVisual colorVisual = new ColorVisual(); + colorVisual.Color = new Color(1.0f, 0.3f, 0.5f, 1.0f); + VisualBase visual = VisualFactory.Instance.CreateVisual(colorVisual.OutputVisualMap); + view._RegisterVisual(visualIndex, visual, false); + } + catch (Exception e) + { + Tizen.Log.Error("Test CustomView.cs", "Caught Exception" + e.ToString()); LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); Assert.Fail("Caught Exception" + e.ToString()); } @@ -262,6 +581,10 @@ namespace Tizen.NUI.Tests { } + public MyCustomView(string typeName, CustomViewBehaviour behaviour) : base(typeName, behaviour) + { + } + public override void OnInitialize() { view = new BaseComponents.View(); @@ -274,5 +597,76 @@ namespace Tizen.NUI.Tests { return new Size2D(200, 200); } + + public override float CalculateChildSize(View child, DimensionType dimension) + { + return base.CalculateChildSizeBase(child, dimension); + } + + public Animation _CreateTransition(TransitionData transitionData) + { + return base.CreateTransition(transitionData); + } + + public void _EmitFocusSignal(bool focusGained) + { + base.EmitFocusSignal(focusGained); + } + + public void _EnableVisual(int index, bool enable) + { + base.EnableVisual(index, enable); + } + + public float _GetHeightForWidth(float width) + { + return base.GetHeightForWidthBase(width); + } + + public VisualBase _GetVisual(int index) + { + return base.GetVisual(index); + } + + public float _GetWidthForHeight(float height) + { + return base.GetWidthForHeightBase(height); + } + + public bool _IsVisualEnabled(int index) + { + return base.IsVisualEnabled(index); + } + + public void _RegisterVisual(int index, VisualBase visual) + { + base.RegisterVisual(index, visual); + } + + public void _RegisterVisual(int index, VisualBase visual, bool enabled) + { + base.RegisterVisual(index, visual, enabled); + } + + public bool _RelayoutDependentOnChildren(DimensionType dimension) + { + return base.RelayoutDependentOnChildrenBase(dimension); + } + + public bool _RelayoutDependentOnChildren() + { + return base.RelayoutDependentOnChildrenBase(); + } + + public void _RelayoutRequest() + { + base.RelayoutRequest(); + } + + public void _UnregisterVisual(int index) + { + base.UnregisterVisual(index); + } + } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSFocusManager.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSFocusManager.cs index f2d42f43d..57a3c8d6b 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSFocusManager.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSFocusManager.cs @@ -15,7 +15,7 @@ namespace Tizen.NUI.Tests private static string TAG = "NUI"; [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("FocusManagerTests"); @@ -23,10 +23,12 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); - } + } + private void OnFocusGroupChanged(object obj, EventArgs e) + { } [Test] [Category("P1")] @@ -354,7 +356,6 @@ namespace Tizen.NUI.Tests manager.SetCurrentFocusView(view2); Assert.IsTrue(flag, "FocusChanged is not be called"); } - } public class CustomFocusAlgorithm : FocusManager.ICustomFocusAlgorithm diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSGetResourcesProvider.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSGetResourcesProvider.cs new file mode 100755 index 000000000..65b8b4d8d --- /dev/null +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSGetResourcesProvider.cs @@ -0,0 +1,59 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; +using System; +using Tizen.NUI; +using Tizen.NUI.Test; + +namespace Tizen.NUI.Tests +{ + + [TestFixture] + [Description("Tizen.NUI.GetResourcesProvider Tests")] + public class GetResourcesProviderTests + { + private static string TAG = "NUI"; + + [SetUp] + public void Init() + { + Tizen.Log.Info(TAG, "Init() is called!"); + App.MainTitleChangeText("GetResourcesProviderTests"); + App.MainTitleChangeBackgroundColor(null); + } + + [TearDown] + public void Destroy() + { + Tizen.Log.Info(TAG, "Destroy() is called!"); + } + + [Test] + [Category("P1")] + [Description("Create a GetResourcesProvider object. Check whether object is successfully created or not.")] + [Property("SPEC", "Tizen.NUI.GetResourcesProvider.GetResourcesProvider C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void GetResourcesProvider_INIT() + { + /* TEST CODE */ + var resourcesProvider = new GetResourcesProvider(); + Assert.IsNotNull(resourcesProvider, "Can't create success object GetResourcesProvider"); + Assert.IsInstanceOf(resourcesProvider, "Should be an instance of GetResourcesProvider type."); + } + + [Test] + [Category("P1")] + [Description("Test Get. Check whether Get returns expected value or not.")] + [Property("SPEC", "Tizen.NUI.GetResourcesProvider.Get M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void Get_GET_VALUE() + { + /* TEST CODE */ + Tizen.NUI.Binding.ResourceDictionary dict = Tizen.NUI.GetResourcesProvider.Get().XamlResources; + Assert.IsEmpty(dict, "Shoud be empty"); + } + } +} diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSGradientVisual.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSGradientVisual.cs index d4b40ffb6..2d22c0146 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSGradientVisual.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSGradientVisual.cs @@ -11,9 +11,18 @@ namespace Tizen.NUI.Tests public class GradientVisualTests { private static string TAG = "NUI"; + private static bool _flagComposingPropertyMap; + internal class MyGradientVisual : GradientVisual + { + protected override void ComposingPropertyMap() + { + _flagComposingPropertyMap = true; + base.ComposingPropertyMap(); + } + } [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("GradientVisualTests"); @@ -21,7 +30,7 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); } @@ -190,5 +199,31 @@ namespace Tizen.NUI.Tests gradientVisualMap.SpreadMethod = GradientVisualSpreadMethodType.Pad; Assert.AreEqual(GradientVisualSpreadMethodType.Pad, gradientVisualMap.SpreadMethod, "Retrieved SpreadMethod should be equal to set value"); } + + [Test] + [Category("P1")] + [Description("Check override method ComposingPropertyMap is invoked when new GradientVisual instance.")] + [Property("SPEC", "Tizen.NUI.GradientVisual.ComposingPropertyMap M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public void ComposingPropertyMap_OVERRIDE_METHOD() + { + /*PRE CONDITION + * _flagComposingPropertyMap flag is initialize false value + * Create a instance MyGradientVisual + */ + _flagComposingPropertyMap = false; + Assert.False(_flagComposingPropertyMap, "_flagComposingPropertyMap should false initial"); + /**TEST CODE**/ + var myGradientVisual = new MyGradientVisual() + { + Center = new Vector2(1.0f, 1.0f), + Radius = 2.0f, + }; + Assert.IsInstanceOf(myGradientVisual, "Should be an instance of GradientVisual type."); + PropertyMap propertyMap = myGradientVisual.OutputVisualMap; + Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked."); + } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSHover.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSHover.cs index a132053f0..f589c1e9e 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSHover.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSHover.cs @@ -131,6 +131,20 @@ namespace Tizen.NUI.Tests Assert.AreEqual(0.0f, hover.GetScreenPosition(0).Y, "Should be equals to the origin value of ScreenPosition.Y"); } + [Test] + [Category("P1")] + [Description("Test Time property. Check whether Time returns the value expected.")] + [Property("SPEC", "Tizen.NUI.Hover.Time A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public void Time_Property_GET() + { + /* TEST CODE */ + Hover hover = new Hover(); + Assert.AreEqual(0u, hover.Time, "Should be equals to the origin value of Time"); + } + [Test] [Category("P1")] [Description("Test Dispose, try to dispose the Hover.")] diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSImageVisual.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSImageVisual.cs index 9520a8ce9..39780ace8 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSImageVisual.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSImageVisual.cs @@ -12,9 +12,18 @@ namespace Tizen.NUI.Tests { private static string TAG = "NUI"; private static string image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Tizen.NUI.Tests.png"; + private static bool _flagComposingPropertyMap; + internal class MyImageVisual : ImageVisual + { + protected override void ComposingPropertyMap() + { + _flagComposingPropertyMap = true; + base.ComposingPropertyMap(); + } + } [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("ImageVisualTests"); @@ -22,7 +31,7 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); } @@ -333,5 +342,30 @@ namespace Tizen.NUI.Tests map.Atlasing = false; Assert.AreEqual(false, map.Atlasing, "Retrieved Atlasing should be equal to set value"); } + + [Test] + [Category("P1")] + [Description("Check override method ComposingPropertyMap is invoked when new ImageVisual instance.")] + [Property("SPEC", "Tizen.NUI.ImageVisual.ComposingPropertyMap M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public void ComposingPropertyMap_OVERRIDE_METHOD() + { + /*PRE CONDITION + * _flagComposingPropertyMap flag is initialize false value + * Create a instance MyImageVisual + */ + _flagComposingPropertyMap = false; + Assert.False(_flagComposingPropertyMap, "_flagComposingPropertyMap should false initial"); + /**TEST CODE**/ + var myImageVisual = new MyImageVisual() + { + URL = image_path, + }; + Assert.IsInstanceOf(myImageVisual, "Should be an instance of ImageVisual type."); + PropertyMap propertyMap = myImageVisual.OutputVisualMap; + Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked."); + } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSImfManager.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSImfManager.cs index 1923a3709..b316f97d4 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSImfManager.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSImfManager.cs @@ -16,9 +16,10 @@ namespace Tizen.NUI.Tests { private static string TAG = "NUI"; private static string image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Tizen.NUI.Tests.png"; + private static bool _flagOnImfActivedEvent, _flagOnImfEventReceivedEvent, _flagOnLanguageChangedEvent, _flagOnResizedEvent, _flagOnStatusChangedEvent; [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, " Init() is called!"); App.MainTitleChangeText("ImfManagerTests"); @@ -26,11 +27,38 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, " Destroy() is called!"); } + private void OnImfActivedEvent(object sender, EventArgs e) + { + _flagOnImfActivedEvent = true; + } + + private ImfManager.ImfCallbackData OnImfEventReceivedEvent(object obj, EventArgs e) + { + _flagOnImfEventReceivedEvent = true; + ImfManager.ImfCallbackData callbackData = new ImfManager.ImfCallbackData(true, 0, "", false); + return callbackData; + } + + private void OnLanguageChangedEvent(object obj, EventArgs e) + { + _flagOnLanguageChangedEvent = true; + } + + private void OnResizedEvent(object obj, EventArgs e) + { + _flagOnResizedEvent = true; + } + + private void OnStatusChangedEvent(object obj, EventArgs e) + { + _flagOnStatusChangedEvent = true; + } + [Test] [Category("P1")] [Description("Test constructor. Check whether it works or not.")] @@ -291,7 +319,7 @@ namespace Tizen.NUI.Tests public void GetTextDirection_RETURN_VALUE() { ImfManager manager = ImfManager.Get(); - if(manager) + if (manager) { Assert.AreEqual(ImfManager.TextDirection.LeftToRight, manager.GetTextDirection(), "Should be equal"); } @@ -307,7 +335,7 @@ namespace Tizen.NUI.Tests public void GetInputPanelLocale_RETURN_VALUE() { ImfManager manager = ImfManager.Get(); - if(manager) + if (manager) { Assert.AreEqual("", manager.GetInputPanelLocale(), "Should be null"); } @@ -514,5 +542,187 @@ namespace Tizen.NUI.Tests Assert.Fail("Caught Exception" + e.ToString()); } } + + [Test] + [Category("P1")] + [Description("Check whether Activated event is triggered.")] + [Property("SPEC", "Tizen.NUI.ImfManager.Activated E")] + [Property("SPEC_URL", " - ")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public async Task Activated_CHECK_EVENT() + { + /* TEST CODE */ + var manager = ImfManager.Get(); + Assert.IsInstanceOf(manager, "Should be an instance of ImfManager type."); + try + { + _flagOnImfActivedEvent = false; + Assert.False(_flagOnImfActivedEvent, "_flagOnImfActivedEvent should false initial"); + manager.Activated += OnImfActivedEvent; + manager.Activate(); + await Task.Delay(20); + Assert.True(_flagOnImfActivedEvent, "Should be true after triger Activated event."); + } + 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 + { + manager.Activated -= OnImfActivedEvent; + } + } + + [Test] + [Category("P1")] + [Description("Check whether EventReceived event is triggered.")] + [Property("SPEC", "Tizen.NUI.ImfManager.EventReceived E")] + [Property("SPEC_URL", " - ")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public async Task EventReceived_CHECK_EVENT() + { + /* TEST CODE */ + var manager = ImfManager.Get(); + Assert.IsInstanceOf(manager, "Should be an instance of ImfManager type."); + try + { + _flagOnImfEventReceivedEvent = false; + Assert.False(_flagOnImfEventReceivedEvent, "_flagOnImfEventReceivedEvent should false initial"); + manager.EventReceived += OnImfEventReceivedEvent; + manager.Deactivate(); + manager.HideInputPanel(); + await Task.Delay(20); + manager.Activate(); + manager.ShowInputPanel(); + await Task.Delay(20); + Assert.True(_flagOnImfEventReceivedEvent, "Should be true after triger EventReceived event."); + } + 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 + { + manager.EventReceived -= OnImfEventReceivedEvent; + } + } + + [Test] + [Category("P1")] + [Description("Check whether LanguageChanged event is triggered.")] + [Property("SPEC", "Tizen.NUI.ImfManager.LanguageChanged E")] + [Property("SPEC_URL", " - ")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public async Task LanguageChanged_CHECK_EVENT() + { + /* TEST CODE */ + var manager = ImfManager.Get(); + Assert.IsInstanceOf(manager, "Should be an instance of ImfManager type."); + try + { + _flagOnLanguageChangedEvent = false; + Assert.False(_flagOnLanguageChangedEvent, "_flagOnLanguageChangedEvent should false initial"); + manager.LanguageChanged += OnLanguageChangedEvent; + manager.Deactivate(); + manager.HideInputPanel(); + await Task.Delay(20); + manager.Activate(); + manager.ShowInputPanel(); + await Task.Delay(20); + Assert.True(_flagOnLanguageChangedEvent, "Should be true after triger LanguageChanged event."); + } + 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 + { + manager.LanguageChanged -= OnLanguageChangedEvent; + } + } + + [Test] + [Category("P1")] + [Description("Check whether Resized event is triggered.")] + [Property("SPEC", "Tizen.NUI.ImfManager.Resized E")] + [Property("SPEC_URL", " - ")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public async Task Resized_CHECK_EVENT() + { + /* TEST CODE */ + var manager = ImfManager.Get(); + Assert.IsInstanceOf(manager, "Should be an instance of ImfManager type."); + try + { + _flagOnResizedEvent = false; + Assert.False(_flagOnResizedEvent, "_flagOnResizedEvent should false initial"); + manager.Resized += OnResizedEvent; + manager.Activate(); + manager.ShowInputPanel(); + await Task.Delay(60); + manager.Deactivate(); + manager.HideInputPanel(); + await Task.Delay(60); + + Assert.True(_flagOnResizedEvent, "Should be true after triger Resized event."); + } + 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 + { + manager.Resized -= OnResizedEvent; + } + } + + [Test] + [Category("P1")] + [Description("Check whether Resized event is triggered.")] + [Property("SPEC", "Tizen.NUI.ImfManager.StatusChanged E")] + [Property("SPEC_URL", " - ")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public async Task StatusChanged_CHECK_EVENT() + { + /* TEST CODE */ + var manager = ImfManager.Get(); + Assert.IsInstanceOf(manager, "Should be an instance of ImfManager type."); + try + { + _flagOnStatusChangedEvent = false; + Assert.False(_flagOnStatusChangedEvent, "_flagOnStatusChangedEvent should false initial"); + manager.StatusChanged += OnStatusChangedEvent; + manager.Activate(); + manager.ShowInputPanel(); + await Task.Delay(70); + manager.Deactivate(); + manager.HideInputPanel(); + await Task.Delay(70); + Assert.True(_flagOnStatusChangedEvent, "Should be true after triger StatusChanged event."); + } + 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 + { + manager.StatusChanged -= OnStatusChangedEvent; + } + } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSLongPressGesture.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSLongPressGesture.cs new file mode 100755 index 000000000..087f2a4ba --- /dev/null +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSLongPressGesture.cs @@ -0,0 +1,123 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; +using System; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Test; + +namespace Tizen.NUI.Tests +{ + [TestFixture] + [Description("Tizen.NUI.LongPressGesture Tests")] + public class LongPressGestureTests + { + private static string TAG = "NUI"; + + [SetUp] + public void Init() + { + Tizen.Log.Info(TAG, "Init() is called!"); + App.MainTitleChangeText("LongPressGestureTests"); + App.MainTitleChangeBackgroundColor(null); + } + + [TearDown] + public void Destroy() + { + Tizen.Log.Info(TAG, "Destroy() is called!"); + } + + [Test] + [Category("P1")] + [Description("Create a LongPressGesture object. Check whether LongPressGesture is successfully created or not.")] + [Property("SPEC", "Tizen.NUI.LongPressGesture.LongPressGesture C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void LongPressGesture_INIT() + { + /* TEST CODE */ + var longPressGesture = new LongPressGesture(Gesture.StateType.Cancelled); + Assert.IsNotNull(longPressGesture, "Can't create success object PanGesture"); + Assert.IsInstanceOf(longPressGesture, "Should be an instance of LongPressGesture type."); + } + + [Test] + [Category("P1")] + [Description("Test LocalPoint. Check whether LocalPoint is readable.")] + [Property("SPEC", "Tizen.NUI.LongPressGesture.LocalPoint A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void LocalPoint_GET_VALUE() + { + /* TEST CODE */ + try + { + var longPressGesture = new LongPressGesture(Gesture.StateType.Cancelled); + Assert.IsInstanceOf(longPressGesture, "Should be an instance of LongPressGesture type"); + Vector2 vector = longPressGesture.LocalPoint; + Assert.AreEqual(0, vector.X, "Should be the default value"); + Assert.AreEqual(0, vector.Y, "Should be the default value"); + } + 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 NumberOfTouches. Check whether NumberOfTouches is readable.")] + [Property("SPEC", "Tizen.NUI.LongPressGesture.NumberOfTouches A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void NumberOfTouches_GET_VALUE() + { + /* TEST CODE */ + try + { + var longPressGesture = new LongPressGesture(Gesture.StateType.Cancelled); + Assert.IsInstanceOf(longPressGesture, "Should be an instance of LongPressGesture type"); + uint number = longPressGesture.NumberOfTouches; + Assert.AreEqual(1, number, "Should be the default value"); + } + 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 ScreenPoint. Check whether ScreenPoint is readable.")] + [Property("SPEC", "Tizen.NUI.LongPressGesture.ScreenPoint A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void ScreenPoint_GET_VALUE() + { + /* TEST CODE */ + try + { + var longPressGesture = new LongPressGesture(Gesture.StateType.Cancelled); + Assert.IsInstanceOf(longPressGesture, "Should be an instance of LongPressGesture type"); + Vector2 vector = longPressGesture.ScreenPoint; + Assert.AreEqual(0, vector.X, "Should be the default value"); + Assert.AreEqual(0, vector.Y, "Should be the default value"); + } + 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()); + } + } + } +} diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSMeshVisual.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSMeshVisual.cs index 3f33174b2..10393374e 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSMeshVisual.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSMeshVisual.cs @@ -11,9 +11,18 @@ namespace Tizen.NUI.Tests public class MeshVisualTests { private static string TAG = "NUI"; + private static bool _flagComposingPropertyMap; + internal class MyMeshVisual : MeshVisual + { + protected override void ComposingPropertyMap() + { + _flagComposingPropertyMap = true; + base.ComposingPropertyMap(); + } + } [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("MeshVisualTests"); @@ -21,7 +30,7 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); } @@ -144,5 +153,30 @@ namespace Tizen.NUI.Tests Assert.AreEqual(1.0f, meshVisualMap.LightPosition.Y, "Retrieved LightPosition.Y should be equal to set value"); Assert.AreEqual(1.0f, meshVisualMap.LightPosition.Z, "Retrieved LightPosition.Z should be equal to set value"); } + + [Test] + [Category("P1")] + [Description("Check override method ComposingPropertyMap is invoked when new MeshVisual instance.")] + [Property("SPEC", "Tizen.NUI.MeshVisual.ComposingPropertyMap M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public void ComposingPropertyMap_OVERRIDE_METHOD() + { + /*PRE CONDITION + * _flagComposingPropertyMap flag is initialize false value + * Create a instance MyMeshVisual + */ + _flagComposingPropertyMap = false; + Assert.False(_flagComposingPropertyMap, "_flagComposingPropertyMap should false initial"); + /**TEST CODE**/ + var myMeshVisual = new MyMeshVisual() + { + LightPosition = new Vector3(1.0f, 1.0f, 1.0f), + }; + Assert.IsInstanceOf(myMeshVisual, "Should be an instance of MeshVisual type."); + PropertyMap propertyMap = myMeshVisual.OutputVisualMap; + Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked."); + } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSNPatchVisual.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSNPatchVisual.cs index f6b35c1de..e824772b4 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSNPatchVisual.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSNPatchVisual.cs @@ -12,9 +12,18 @@ namespace Tizen.NUI.Tests { private static string TAG = "NUI"; private static string image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Tizen.NUI.Tests.png"; + private static bool _flagComposingPropertyMap; + internal class MyNPatchVisual : NPatchVisual + { + protected override void ComposingPropertyMap() + { + _flagComposingPropertyMap = true; + base.ComposingPropertyMap(); + } + } [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("NPatchVisualTests"); @@ -22,7 +31,7 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); } @@ -90,5 +99,31 @@ namespace Tizen.NUI.Tests Assert.AreEqual(10, map.Border.Height, "Retrieved BorderOnly should be equal to set value"); } + + [Test] + [Category("P1")] + [Description("Check override method ComposingPropertyMap is invoked when new NPatchVisual instance.")] + [Property("SPEC", "Tizen.NUI.NPatchVisual.ComposingPropertyMap M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public void ComposingPropertyMap_OVERRIDE_METHOD() + { + /*PRE CONDITION + * _flagComposingPropertyMap flag is initialize false value + * Create a instance MyNPatchVisual + */ + _flagComposingPropertyMap = false; + Assert.False(_flagComposingPropertyMap, "_flagComposingPropertyMap should false initial"); + /**TEST CODE**/ + var myNPatchVisual = new MyNPatchVisual() + { + URL = image_path, + BorderOnly = true, + }; + Assert.IsInstanceOf(myNPatchVisual, "Should be an instance of NPatchVisual type."); + PropertyMap propertyMap = myNPatchVisual.OutputVisualMap; + Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked."); + } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPanGesture.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPanGesture.cs index 780c2543c..7d572fe03 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPanGesture.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPanGesture.cs @@ -14,7 +14,7 @@ namespace Tizen.NUI.Tests private static string TAG = "NUI"; [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("PanGestureTests"); @@ -22,7 +22,7 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); } @@ -42,5 +42,285 @@ namespace Tizen.NUI.Tests Assert.IsNotNull(panGesture, "Can't create success object PanGesture"); Assert.IsInstanceOf(panGesture, "Should be an instance of PanGesture type."); } + + [Test] + [Category("P1")] + [Description("Test GetDistance. Check whether GetDistance returns expected value or not.")] + [Property("SPEC", "Tizen.NUI.PanGesture.GetDistance M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void GetDistance_CHECK_RETURN_VALUE() + { + /* TEST CODE */ + try + { + var panGesture = new PanGesture(); + Assert.IsInstanceOf(panGesture, "Should be an instance of PanGesture type."); + float distance = panGesture.GetDistance(); + Assert.AreEqual(0, distance, "Should be the default value"); + } + 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 GetScreenDistance. Check whether GetScreenDistance returns expected value or not.")] + [Property("SPEC", "Tizen.NUI.PanGesture.GetScreenDistance M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void GetScreenDistance_CHECK_RETURN_VALUE() + { + /* TEST CODE */ + try + { + var panGesture = new PanGesture(); + Assert.IsInstanceOf(panGesture, "Should be an instance of PanGesture type."); + float distance = panGesture.GetScreenDistance(); + Assert.AreEqual(0, distance, "Should be the default value"); + } + 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 GetScreenSpeed. Check whether GetScreenSpeed returns expected value or not.")] + [Property("SPEC", "Tizen.NUI.PanGesture.GetScreenSpeed M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void GetScreenSpeed_CHECK_RETURN_VALUE() + { + /* TEST CODE */ + try + { + var panGesture = new PanGesture(); + Assert.IsInstanceOf(panGesture, "Should be an instance of PanGesture type."); + float speed = panGesture.GetScreenSpeed(); + Assert.AreEqual(0, speed, "Should be the default value"); + } + 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 GetSpeed. Check whether GetSpeed returns expected value or not.")] + [Property("SPEC", "Tizen.NUI.PanGesture.GetSpeed M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void GetSpeed_CHECK_RETURN_VALUE() + { + /* TEST CODE */ + try + { + var panGesture = new PanGesture(); + Assert.IsInstanceOf(panGesture, "Should be an instance of PanGesture type."); + float speed = panGesture.GetSpeed(); + Assert.AreEqual(0, speed, "Should be the default value"); + } + 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 Displacement. Check whether Displacement is readable.")] + [Property("SPEC", "Tizen.NUI.PanGesture.Displacement A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void Displacement_GET_VALUE() + { + /* TEST CODE */ + try + { + var panGesture = new PanGesture(); + Assert.IsInstanceOf(panGesture, "Should be an instance of PanGesture type."); + Vector2 vector = panGesture.Displacement; + Assert.AreEqual(0, vector.X, "Should be the default value"); + Assert.AreEqual(0, vector.Y, "Should be the default value"); + } + 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 NumberOfTouches. Check whether NumberOfTouches is readable.")] + [Property("SPEC", "Tizen.NUI.PanGesture.NumberOfTouches A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void NumberOfTouches_GET_VALUE() + { + /* TEST CODE */ + try + { + var panGesture = new PanGesture(); + Assert.IsInstanceOf(panGesture, "Should be an instance of PanGesture type."); + uint number = panGesture.NumberOfTouches; + Assert.AreEqual(1, number, "Should be the default value"); + } + 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 Position. Check whether Position is readable.")] + [Property("SPEC", "Tizen.NUI.PanGesture.Position A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void Position_GET_VALUE() + { + /* TEST CODE */ + try + { + var panGesture = new PanGesture(); + Assert.IsInstanceOf(panGesture, "Should be an instance of PanGesture type."); + Vector2 vector = panGesture.Position; + Assert.AreEqual(0, vector.X, "Should be the default value"); + Assert.AreEqual(0, vector.Y, "Should be the default value"); + } + 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 ScreenDisplacement. Check whether ScreenDisplacement is readable.")] + [Property("SPEC", "Tizen.NUI.PanGesture.ScreenDisplacement A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void ScreenDisplacement_GET_VALUE() + { + /* TEST CODE */ + try + { + var panGesture = new PanGesture(); + Assert.IsInstanceOf(panGesture, "Should be an instance of PanGesture type."); + Vector2 vector = panGesture.ScreenDisplacement; + Assert.AreEqual(0, vector.X, "Should be the default value"); + Assert.AreEqual(0, vector.Y, "Should be the default value"); + } + 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 ScreenPosition. Check whether ScreenPosition is readable.")] + [Property("SPEC", "Tizen.NUI.PanGesture.ScreenPosition A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void ScreenPosition_GET_VALUE() + { + /* TEST CODE */ + try + { + var panGesture = new PanGesture(); + Assert.IsInstanceOf(panGesture, "Should be an instance of PanGesture type."); + Vector2 vector = panGesture.ScreenPosition; + Assert.AreEqual(0, vector.X, "Should be the default value"); + Assert.AreEqual(0, vector.Y, "Should be the default value"); + } + 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 ScreenVelocity. Check whether ScreenVelocity is readable.")] + [Property("SPEC", "Tizen.NUI.PanGesture.ScreenVelocity A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void ScreenVelocity_GET_VALUE() + { + /* TEST CODE */ + try + { + var panGesture = new PanGesture(); + Assert.IsInstanceOf(panGesture, "Should be an instance of PanGesture type."); + Vector2 vector = panGesture.ScreenVelocity; + Assert.AreEqual(0, vector.X, "Should be the default value"); + Assert.AreEqual(0, vector.Y, "Should be the default value"); + } + 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 Velocity. Check whether Velocity is readable.")] + [Property("SPEC", "Tizen.NUI.PanGesture.Velocity A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void Velocity_GET_VALUE() + { + /* TEST CODE */ + try + { + var panGesture = new PanGesture(); + Assert.IsInstanceOf(panGesture, "Should be an instance of PanGesture type."); + Vector2 vector = panGesture.Velocity; + Assert.AreEqual(0, vector.X, "Should be the default value"); + Assert.AreEqual(0, vector.Y, "Should be the default value"); + } + 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()); + } + } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPinchGesture.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPinchGesture.cs new file mode 100755 index 000000000..e687c6bd4 --- /dev/null +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPinchGesture.cs @@ -0,0 +1,30 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; +using System; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Test; + +namespace Tizen.NUI.Tests +{ + [TestFixture] + [Description("Tizen.NUI.PinchGesture Tests")] + public class PinchGestureTests + { + private static string TAG = "NUI"; + + [SetUp] + public void Init() + { + Tizen.Log.Info(TAG, "Init() is called!"); + App.MainTitleChangeText("PinchGestureTests"); + App.MainTitleChangeBackgroundColor(null); + } + + [TearDown] + public void Destroy() + { + Tizen.Log.Info(TAG, "Destroy() is called!"); + } + } +} \ No newline at end of file diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPopup.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPopup.cs index ff7436074..5fce4f5bd 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPopup.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPopup.cs @@ -17,7 +17,7 @@ namespace Tizen.NUI.Tests private static string image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("PopupTests"); @@ -25,10 +25,13 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); - } + } + + private void OnTouchedOutside(object obj, EventArgs e) + { } [Test] [Category("P1")] diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPosition2D.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPosition2D.cs index 27bb0c997..9de9619d1 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPosition2D.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPosition2D.cs @@ -159,6 +159,21 @@ namespace Tizen.NUI.Tests Assert.AreEqual(9, position.Y, "The Y value of the position is not correct!"); } + [Test] + [Category("P1")] + [Description("Test ConvertFromString, Check whether ConvertFromString returns expected value or not")] + [Property("SPEC", "Tizen.NUI.Position2D.ConvertFromString M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")] + public void ConvertFromString_CHECK_RETURN_VALUE() + { + /* TEST CODE */ + Position2D position1 = new Position2D(2, 3); + var position2 = Position2D.ConvertFromString("2,3"); + Assert.AreEqual(position1, position2, "The value of the position2 is not correct!"); + } + [Test] [Category("P1")] [Description("Test operator -.")] @@ -328,6 +343,23 @@ namespace Tizen.NUI.Tests Assert.AreEqual(position.Y, vector.Y, "The value of Y is not correct."); } + [Test] + [Category("P1")] + [Description("Test implicit string, Try to convert a string instance to a position2D instance.")] + [Property("SPEC", "Tizen.NUI.Position2D.Implicit M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "string")] + [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")] + public void Implicit_STRING_RETURN_VALUE() + { + /* TEST CODE */ + string position = "10, 20"; + Position2D position2D = position; + Assert.AreEqual(position2D.X, 10, "The value of X is not correct."); + Assert.AreEqual(position2D.Y, 20, "The value of Y is not correct."); + } + [Test] [Category("P1")] [Description("Test Dispose, try to dispose the Position2D.")] diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPrimitiveVisual.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPrimitiveVisual.cs index b811da722..f10bfe6f5 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPrimitiveVisual.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPrimitiveVisual.cs @@ -11,9 +11,18 @@ namespace Tizen.NUI.Tests public class PrimitiveVisualTests { private static string TAG = "NUI"; + private static bool _flagComposingPropertyMap; + internal class MyPrimitiveVisual : PrimitiveVisual + { + protected override void ComposingPropertyMap() + { + _flagComposingPropertyMap = true; + base.ComposingPropertyMap(); + } + } [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("PrimitiveVisualTests"); @@ -21,7 +30,7 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); } @@ -227,5 +236,30 @@ namespace Tizen.NUI.Tests Assert.AreEqual(1.0f, primitiveVisualMap.LightPosition.Y, "Retrieved LightPosition.Y should be equal to set value"); Assert.AreEqual(1.0f, primitiveVisualMap.LightPosition.Z, "Retrieved LightPosition.Z should be equal to set value"); } + + [Test] + [Category("P1")] + [Description("Check override method ComposingPropertyMap is invoked when new PrimitiveVisual instance.")] + [Property("SPEC", "Tizen.NUI.PrimitiveVisual.ComposingPropertyMap M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")] + public void ComposingPropertyMap_OVERRIDE_METHOD() + { + /*PRE CONDITION + * _flagComposingPropertyMap flag is initialize false value + * Create a instance MySVGVisual + */ + _flagComposingPropertyMap = false; + Assert.False(_flagComposingPropertyMap, "_flagComposingPropertyMap should false initial"); + /**TEST CODE**/ + var myPrimitiveVisual = new MyPrimitiveVisual() + { + LightPosition = new Vector3(1.0f, 1.0f, 1.0f), + }; + Assert.IsInstanceOf(myPrimitiveVisual, "Should be an instance of PrimitiveVisual type."); + PropertyMap propertyMap = myPrimitiveVisual.OutputVisualMap; + Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked."); + } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPropertyArray.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPropertyArray.cs index 13e313b72..dba564a8b 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPropertyArray.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSPropertyArray.cs @@ -259,8 +259,9 @@ namespace Tizen.NUI.Tests [Property("SPEC", "Tizen.NUI.PropertyArray.Add M")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "MR")] + [Property("COVPARAM", "PropertyValue")] [Property("AUTHOR", "Zaijuan Sui, z6177.sui@samsung.com")] - public void Add_CHECK_VALUE() + public void Add_CHECK_VALUE_WITH_PROPERTYVALUE() { /* TEST CODE */ PropertyArray propertyarray = new PropertyArray(); diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSSVGVisual.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSSVGVisual.cs index 902585855..b7b4ad251 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSSVGVisual.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSSVGVisual.cs @@ -13,8 +13,18 @@ namespace Tizen.NUI.Tests private static string TAG = "NUI"; private static string image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Tizen.NUI.Tests.png"; + private static bool _flagComposingPropertyMap; + internal class MySVGVisual : SVGVisual + { + protected override void ComposingPropertyMap() + { + _flagComposingPropertyMap = true; + base.ComposingPropertyMap(); + } + } + [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("SVGVisualTests"); @@ -22,7 +32,7 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); } @@ -56,5 +66,30 @@ namespace Tizen.NUI.Tests map.URL = image_path; Assert.AreEqual(image_path, map.URL, "Retrieved URL should be equal to set value"); } + + [Test] + [Category("P1")] + [Description("Check override method ComposingPropertyMap is invoked when new SVGVisual instance.")] + [Property("SPEC", "Tizen.NUI.SVGVisual.ComposingPropertyMap M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")] + public void ComposingPropertyMap_OVERRIDE_METHOD() + { + /*PRE CONDITION + * _flagComposingPropertyMap flag is initialize false value + * Create a instance MySVGVisual + */ + _flagComposingPropertyMap = false; + Assert.False(_flagComposingPropertyMap, "_flagComposingPropertyMap should false initial"); + /**TEST CODE**/ + var mySVGVisual = new MySVGVisual() + { + URL = image_path, + }; + Assert.IsInstanceOf(mySVGVisual, "Should be an instance of SVGVisual type."); + PropertyMap propertyMap = mySVGVisual.OutputVisualMap; + Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked."); + } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSScrollBar.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSScrollBar.cs index e01254ad1..f493d7ebf 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSScrollBar.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSScrollBar.cs @@ -14,7 +14,7 @@ namespace Tizen.NUI.Tests private static string TAG = "NUI"; [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("ScrollBarTests"); @@ -22,10 +22,10 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); - } + } [Test] [Category("P1")] diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSScrollView.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSScrollView.cs index 6f570c826..04c320c3e 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSScrollView.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSScrollView.cs @@ -15,7 +15,7 @@ namespace Tizen.NUI.Tests private static string TAG = "NUI"; [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("ScrollViewTests"); @@ -23,10 +23,10 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); - } + } [Test] [Category("P1")] @@ -192,11 +192,12 @@ namespace Tizen.NUI.Tests public void SetScrollSensitive_CHECK_RETURN_VALUE() { /* TEST CODE */ - try { + try + { var scrollView = new ScrollView(); scrollView.SetScrollSensitive(true); } - catch(Exception e) + catch (Exception e) { Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); @@ -214,11 +215,12 @@ namespace Tizen.NUI.Tests public void SetMaxOvershoot_CHECK_RETURN_VALUE() { /* TEST CODE */ - try { + try + { var scrollView = new ScrollView(); scrollView.SetMaxOvershoot(50.0f, 50.0f); } - catch(Exception e) + catch (Exception e) { Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); @@ -236,11 +238,12 @@ namespace Tizen.NUI.Tests public void SetSnapOvershootAlphaFunction_CHECK_RETURN_VALUE() { /* TEST CODE */ - try { + try + { var scrollView = new ScrollView(); scrollView.SetSnapOvershootAlphaFunction(new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseIn)); } - catch(Exception e) + catch (Exception e) { Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); @@ -263,7 +266,7 @@ namespace Tizen.NUI.Tests var scrollView = new ScrollView(); scrollView.SetSnapOvershootDuration(5.0f); } - catch(Exception e) + catch (Exception e) { Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); @@ -286,7 +289,7 @@ namespace Tizen.NUI.Tests var scrollView = new ScrollView(); scrollView.SetViewAutoSnap(true); } - catch(Exception e) + catch (Exception e) { Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); @@ -304,11 +307,12 @@ namespace Tizen.NUI.Tests public void SetWrapMode_CHECK_RETURN_VALUE() { /* TEST CODE */ - try { + try + { var scrollView = new ScrollView(); scrollView.SetWrapMode(true); } - catch(Exception e) + catch (Exception e) { Tizen.Log.Error(TAG, "Caught Exception" + e.ToString()); LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); @@ -1407,7 +1411,7 @@ namespace Tizen.NUI.Tests [Test] [Category("P1")] [Description("Test Dispose, try to dispose the ScrollBar.")] - [Property("SPEC", "Tizen.NUI.UIComponents.ScrollView.Dispose M")] + [Property("SPEC", "Tizen.NUI.ScrollView.Dispose M")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "MR MCST")] [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] @@ -1426,7 +1430,6 @@ namespace Tizen.NUI.Tests Assert.Fail("Caught Exception" + e.ToString()); } } - } public class ScrollViewPagePathEffect : ScrollViewEffect diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSScrollable.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSScrollable.cs index a2936adf9..d25506626 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSScrollable.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSScrollable.cs @@ -4,6 +4,7 @@ using System; using Tizen.NUI; using Tizen.NUI.BaseComponents; using Tizen.NUI.Test; +using System.Threading.Tasks; namespace Tizen.NUI.Tests { @@ -26,8 +27,23 @@ namespace Tizen.NUI.Tests public static void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); + } + + + private static bool _flagScrollStarted, _flagScrollCompleted; + private void OnScrollStarted(object obj, EventArgs e) + { + _flagScrollStarted = true; } + private void OnScrollCompleted(object obj, EventArgs e) + { + _flagScrollCompleted = true; + } + + private void OnScrollUpdated(object obj, EventArgs e) + { } + [Test] [Category("P1")] [Description("dali Scrollable constructor test")] @@ -199,5 +215,80 @@ namespace Tizen.NUI.Tests Assert.AreEqual(0, scrollable.ScrollToAlphaFunction, "Should be equal!"); } + [Test] + [Category("P1")] + [Description("Test Scroll ScrollStarted. Check whether the ScrollStarted event triggered when the scroll start")] + [Property("SPEC", "Tizen.NUI.BaseComponents.Scrollable.ScrollStarted E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Junqing Ma, junqing.ma@samsung.com")] + public void ScrollStarted_CHECK_EVENT() + { + /* TEST CODE */ + var scrollable = new ScrollView(); + Assert.IsInstanceOf(scrollable, "Should be a intance of ScrollView type"); + _flagScrollStarted = false; + Assert.False(_flagScrollStarted, "_flagScrollStarted should false initial"); + scrollable.ScrollStarted += OnScrollStarted; + + scrollable.ScrollDomainSize = new Vector2(1000.0f, 1000.0f); + scrollable.ScrollTo(new Vector2(100.0f, 100.0f), 1.0f); + + Assert.IsTrue(_flagScrollStarted, "The ScrollStarted Event is not triggered!"); + scrollable.ScrollStarted -= OnScrollStarted; + } + + [Test] + [Category("P1")] + [Description("Test Scroll ScrollCompleted. Check whether the ScrollCompleted event triggered when the scroll complete")] + [Property("SPEC", "Tizen.NUI.BaseComponents.Scrollable.ScrollCompleted E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Junqing Ma, junqing.ma@samsung.com")] + public async Task ScrollCompleted_CHECK_EVENT() + { + /* TEST CODE */ + var scrollable = new ScrollView(); + Assert.IsInstanceOf(scrollable, "Should be a intance of ScrollView type"); + Assert.IsNotNull(scrollable, "Shouldn't be null"); + _flagScrollCompleted = false; + Assert.False(_flagScrollCompleted, "_flagScrollCompleted should false initial"); + scrollable.ScrollCompleted += OnScrollCompleted; + + scrollable.ScrollDomainSize = new Vector2(1000.0f, 1000.0f); + scrollable.ScrollTo(new Vector2(100.0f, 100.0f), 0.05f); + await Task.Delay(100); + + Assert.IsTrue(_flagScrollCompleted, "The ScrollCompleted Event is not triggered!"); + scrollable.ScrollCompleted -= OnScrollCompleted; + } + + [Test] + [Category("P1")] + [Description("Test Scroll ScrollUpdated. Check whether the ScrollUpdated event triggered when the scroll complete")] + [Property("SPEC", "Tizen.NUI.BaseComponents.Scrollable.ScrollUpdated E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public void ScrollUpdated_CHECK_EVENT() + { + /* TEST CODE */ + var scrollable = new ScrollView(); + Assert.IsInstanceOf(scrollable, "Should be a intance of ScrollView type"); + try + { + scrollable.ScrollUpdated += OnScrollUpdated; + } + 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 + { + scrollable.ScrollUpdated -= OnScrollUpdated; + } + } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSSlider.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSSlider.cs index f7d5b51ad..df4356370 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSSlider.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSSlider.cs @@ -30,7 +30,7 @@ namespace Tizen.NUI.Tests } [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("SliderTests"); @@ -38,10 +38,10 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); - } + } public bool OnSlidingFinish(object obj, Slider.SlidingFinishedEventArgs args) { diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTapGesture.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTapGesture.cs index 46def8850..260c2ce00 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTapGesture.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTapGesture.cs @@ -14,7 +14,7 @@ namespace Tizen.NUI.Tests private static string TAG = "NUI"; [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("TapGestureTests"); @@ -22,7 +22,7 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); } @@ -42,5 +42,107 @@ namespace Tizen.NUI.Tests Assert.IsNotNull(tapGesture, "Can't create success object TapGesture"); Assert.IsInstanceOf(tapGesture, "Should be an instance of TapGesture type."); } + + [Test] + [Category("P1")] + [Description("Test LocalPoint. Check whether LocalPoint is readable.")] + [Property("SPEC", "Tizen.NUI.TapGesture.LocalPoint A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void LocalPoint_GET_VALUE() + { + /* TEST CODE */ + try + { + var tapGesture = new TapGesture(); + Assert.IsInstanceOf(tapGesture, "Should be an instance of TapGesture type."); + Vector2 vector = tapGesture.LocalPoint; + Assert.AreEqual(0, vector.X, "Should be the default value"); + Assert.AreEqual(0, vector.Y, "Should be the default value"); + } + 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 NumberOfTaps. Check whether NumberOfTaps is readable.")] + [Property("SPEC", "Tizen.NUI.TapGesture.NumberOfTaps A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void NumberOfTaps_GET_VALUE() + { + /* TEST CODE */ + try + { + var tapGesture = new TapGesture(); + Assert.IsInstanceOf(tapGesture, "Should be an instance of TapGesture type."); + uint number = tapGesture.NumberOfTaps; + Assert.AreEqual(1, number, "Should be the default value"); + } + 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 NumberOfTouches. Check whether NumberOfTouches is readable.")] + [Property("SPEC", "Tizen.NUI.TapGesture.NumberOfTouches A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void NumberOfTouches_GET_VALUE() + { + /* TEST CODE */ + try + { + var tapGesture = new TapGesture(); + Assert.IsInstanceOf(tapGesture, "Should be an instance of TapGesture type."); + uint number = tapGesture.NumberOfTouches; + Assert.AreEqual(1, number, "Should be the default value"); + } + 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 ScreenPoint. Check whether ScreenPoint is readable.")] + [Property("SPEC", "Tizen.NUI.TapGesture.ScreenPoint A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void ScreenPoint_GET_VALUE() + { + /* TEST CODE */ + try + { + var tapGesture = new TapGesture(); + Assert.IsInstanceOf(tapGesture, "Should be an instance of TapGesture type."); + Vector2 vector = tapGesture.ScreenPoint; + Assert.AreEqual(0, vector.X, "Should be the default value"); + Assert.AreEqual(0, vector.Y, "Should be the default value"); + } + 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()); + } + } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextLabel.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextLabel.cs index 8a48239c2..ee4867dcd 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextLabel.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextLabel.cs @@ -675,5 +675,41 @@ namespace Tizen.NUI.Tests } #endif + [Test] + [Category("P1")] + [Description("Test OnBindingContextChanged. Check whether it return the right value")] + [Property("SPEC", "Tizen.NUI.BaseComponents.TextLabel.OnBindingContextChanged M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "Junqing Ma, junqing.ma@samsung.com")] + public void OnBindingContextChanged_CHECK_RETURN_VALUE() + { + /* TEST CODE */ + try + { + MyTexLabel textLabel = new MyTexLabel(); + textLabel._OnBindingContextChanged(); + } + catch(Exception e) + { + Tizen.Log.Error("Test CustomView.cs", "Caught Exception" + e.ToString()); + LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); + Assert.Fail("Caught Exception" + e.ToString()); + } + } + + } + + public class MyTexLabel : TextLabel + { + public MyTexLabel() : base() + { + } + + public void _OnBindingContextChanged() + { + base.OnBindingContextChanged(); + } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextVisual.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextVisual.cs index d7148ad4a..f9462dd96 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextVisual.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTextVisual.cs @@ -12,8 +12,18 @@ namespace Tizen.NUI.Tests { private static string TAG = "NUI"; + private static bool _flagComposingPropertyMap; + internal class MyTextVisual : TextVisual + { + protected override void ComposingPropertyMap() + { + _flagComposingPropertyMap = true; + base.ComposingPropertyMap(); + } + } + [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("TextVisualTests"); @@ -21,7 +31,7 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); } @@ -322,5 +332,30 @@ namespace Tizen.NUI.Tests Assert.AreEqual(0.3f, color.B, "Retrieved color.B should be equal to set value"); Assert.AreEqual(0.5f, color.A, "Retrieved color.A should be equal to set value"); } + + [Test] + [Category("P1")] + [Description("Check override method ComposingPropertyMap is invoked when new TextVisual instance.")] + [Property("SPEC", "Tizen.NUI.TextVisual.ComposingPropertyMap M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Wenfeng Ge, wenfeng.ge@samsung.com")] + public void ComposingPropertyMap_OVERRIDE_METHOD() + { + /*PRE CONDITION + * _flagComposingPropertyMap flag is initialize false value + * Create a instance MySVGVisual + */ + _flagComposingPropertyMap = false; + Assert.False(_flagComposingPropertyMap, "_flagComposingPropertyMap should false initial"); + /**TEST CODE**/ + var myTextVisual = new MyTextVisual() + { + TextColor = new Color(1.0f, 0.3f, 0.5f, 1.0f), + }; + Assert.IsInstanceOf(myTextVisual, "Should be an instance of TextVisual type."); + PropertyMap propertyMap = myTextVisual.OutputVisualMap; + Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked."); + } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTouch.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTouch.cs index b87ebfded..ab9449a7d 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTouch.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSTouch.cs @@ -14,7 +14,7 @@ namespace Tizen.NUI.Tests private static string TAG = "NUI"; [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("TouchTests"); @@ -22,7 +22,7 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVideoView.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVideoView.cs index 98c8098b1..db964adcb 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVideoView.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVideoView.cs @@ -17,19 +17,15 @@ namespace Tizen.NUI.Tests { private static string TAG = "NUI"; private static string video_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "demoVideo.mp4"; + private static bool _flagOnFinished; - private bool checkValue; - public VideoViewTests() + private void OnFinished(object obj, VideoView.FinishedEventArgs args) { - checkValue = false; - } - public void OnFinish(object obj, VideoView.FinishedEventArgs args) - { - checkValue = true; + _flagOnFinished = true; } [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("VideoViewTests"); @@ -37,10 +33,10 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); - } + } [Test] [Category("P1")] @@ -340,5 +336,39 @@ namespace Tizen.NUI.Tests Assert.Fail("Caught Exception" + e.ToString()); } } + + [Test] + [Category("P1")] + [Description("Test Finished. Check whether the Finished event triggered when the scroll complete")] + [Property("SPEC", "Tizen.NUI.BaseComponents.VideoView.Finished E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public async Task Finished_CHECK_EVENT() + { + /* TEST CODE */ + var videoView = new VideoView(); + videoView.ResourceUrl = video_path; + Assert.IsInstanceOf(videoView, "Should be an instance of VideoView type."); + try + { + _flagOnFinished = false; + Assert.False(_flagOnFinished, "_flagOnFinished should false initial"); + videoView.Finished += OnFinished; + videoView.Play(); + await Task.Delay(1000); + Assert.True(_flagOnFinished, "_flagOnFinished should be true after Finished triggered"); + } + 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 + { + videoView.Finished -= OnFinished; + } + } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSView.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSView.cs index 315bed373..95df9833a 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSView.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSView.cs @@ -37,7 +37,7 @@ namespace Tizen.NUI.Tests " }\n"; [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); _flag = false; @@ -46,7 +46,7 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); } @@ -54,7 +54,7 @@ namespace Tizen.NUI.Tests private void viewEventCallback(object sender, EventArgs e) { _flag = true; - } + } [Test] [Category("P1")] @@ -2517,7 +2517,5 @@ namespace Tizen.NUI.Tests Assert.IsTrue(_flag, "Should be true!"); parentActor.ChildRemoved -= viewEventCallback; } - } - } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVisualAnimator.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVisualAnimator.cs index 44134daf3..13071e9a2 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVisualAnimator.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVisualAnimator.cs @@ -12,9 +12,17 @@ namespace Tizen.NUI.Tests { private static string TAG = "NUI"; private static string image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Tizen.NUI.Tests.png"; + private static bool _flagComposingPropertyMap; + internal class MyVisualAnimator : VisualAnimator + { + protected override void ComposingPropertyMap() + { + _flagComposingPropertyMap = true; + } + } [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("VisualAnimatorTests"); @@ -22,7 +30,7 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); } @@ -132,5 +140,31 @@ namespace Tizen.NUI.Tests map.DestinationValue = color; Assert.IsTrue(color.Equals(map.DestinationValue), "Retrieved DestinationValue should be equal to set value"); } + + [Test] + [Category("P1")] + [Description("Check override method ComposingPropertyMap is invoked when new VisualAnimator instance.")] + [Property("SPEC", "Tizen.NUI.VisualAnimator.ComposingPropertyMap M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public void ComposingPropertyMap_OVERRIDE_METHOD() + { + /*PRE CONDITION + * _flagComposingPropertyMap flag is initialize false value + * Create a instance VisualAnimator + */ + _flagComposingPropertyMap = false; + Assert.False(_flagComposingPropertyMap, "_flagComposingPropertyMap should false initial"); + /**TEST CODE**/ + var myVisualAnimator = new MyVisualAnimator() + { + StartTime = 10, + EndTime = 200, + }; + Assert.IsInstanceOf(myVisualAnimator, "Should be an instance of VisualAnimator type."); + PropertyMap propertyMap = myVisualAnimator.OutputVisualMap; + Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked."); + } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVisualMap.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVisualMap.cs index 102bbb45e..ac644e1fd 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVisualMap.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSVisualMap.cs @@ -11,9 +11,18 @@ namespace Tizen.NUI.Tests public class VisualMapTests { private static string TAG = "NUI"; + private static bool _flagComposingPropertyMap; + internal class MyVisualMap : VisualMap + { + protected override void ComposingPropertyMap() + { + _flagComposingPropertyMap = true; + base.ComposingPropertyMap(); + } + } [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("VisualMapTests"); @@ -21,7 +30,7 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); } @@ -388,5 +397,29 @@ namespace Tizen.NUI.Tests visualMap.VisualFittingMode = VisualFittingModeType.FitKeepAspectRatio; Assert.AreEqual(VisualFittingModeType.FitKeepAspectRatio, visualMap.VisualFittingMode, "Retrieved VisualFittingMode should be equal to set value"); } + + [Test] + [Category("P1")] + [Description("Check override method ComposingPropertyMap is invoked when new VisualMap instance.")] + [Property("SPEC", "Tizen.NUI.VisualMap.ComposingPropertyMap M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public void ComposingPropertyMap_OVERRIDE_METHOD() + { + /*PRE CONDITION + * _flagComposingPropertyMap flag is initialize false value + * Create a instance VisualMap + */ + _flagComposingPropertyMap = false; + Assert.False(_flagComposingPropertyMap, "_flagComposingPropertyMap should false initial"); + /**TEST CODE**/ + var myVisualMap = new MyVisualMap(); + Assert.IsInstanceOf(myVisualMap, "Should be an instance of VisualMap type."); + //In OutputVisualMap will call ComposingPropertyMap to set _flagComposingPropertyMap + PropertyMap propertyMap = myVisualMap.OutputVisualMap; + Assert.AreEqual(0, propertyMap.Count(), "Retrieved PropertyMap count should be 0"); + Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked."); + } } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWatchTime.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWatchTime.cs new file mode 100755 index 000000000..ef1488d4e --- /dev/null +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWatchTime.cs @@ -0,0 +1,317 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; +using System; +using Tizen.NUI; +using System.Threading.Tasks; +using Tizen.NUI.Test; + +namespace Tizen.NUI.Tests +{ + + [TestFixture] + [Description("Tizen.NUI.WatchTime Tests")] + public class WatchTimeTests + { + private static string TAG = "NUI"; + + private bool IsWearable() + { + string value; + var result = Tizen.System.Information.TryGetValue("tizen.org/feature/profile", out value); + if (result && value.Equals("wearable")) + { + return true; + } + + return false; + } + + [SetUp] + public void Init() + { + Tizen.Log.Info(TAG, "Init() is called!"); + App.MainTitleChangeText("WatchTimeTests"); + App.MainTitleChangeBackgroundColor(null); + } + + [TearDown] + public void Destroy() + { + Tizen.Log.Info(TAG, "Destroy() is called!"); + } + + [Test] + [Category("P1")] + [Description("WatchTime constructor test")] + [Property("SPEC", "Tizen.NUI.WatchTime.WatchTime C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")] + public void WatchTime_INIT() + { + if (IsWearable()) + { + /* TEST CODE */ + var time = new WatchTime(); + Assert.IsInstanceOf(time, "Should return WatchTime instance."); + } + else + { + Assert.Pass("Not Supported profile"); + } + } + + [Test] + [Category("P1")] + [Description("Test Day. Check whether Day is readable.")] + [Property("SPEC", "Tizen.NUI.WatchTime.Day A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void Day_GET_VALUE() + { + /* TEST CODE */ + if (IsWearable()) + { + var watchTime = new WatchTime(); + Assert.IsInstanceOf(watchTime, "Should be an instance of WatchTime type."); + int time = watchTime.Day; + Assert.AreEqual(0, time, "Should be the default value"); + } + else + { + Assert.Pass("Not Supported profile"); + } + } + + [Test] + [Category("P1")] + [Description("Test DaylightSavingTimeStatus. Check whether DaylightSavingTimeStatus is readable.")] + [Property("SPEC", "Tizen.NUI.WatchTime.DaylightSavingTimeStatus A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void DaylightSavingTimeStatus_GET_VALUE() + { + /* TEST CODE */ + if (IsWearable()) + { + var watchTime = new WatchTime(); + Assert.IsInstanceOf(watchTime, "Should be an instance of WatchTime type."); + bool status = watchTime.DaylightSavingTimeStatus; + Assert.AreEqual(false, status, "Should be the default value"); + } + else + { + Assert.Pass("Not Supported profile"); + } + } + + [Test] + [Category("P1")] + [Description("Test DayOfWeek. Check whether DayOfWeek is readable.")] + [Property("SPEC", "Tizen.NUI.WatchTime.DayOfWeek A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void DayOfWeek_GET_VALUE() + { + /* TEST CODE */ + if (IsWearable()) + { + var watchTime = new WatchTime(); + Assert.IsInstanceOf(watchTime, "Should be an instance of WatchTime type."); + int day = watchTime.DayOfWeek; + Assert.AreEqual(0, day, "Should be the default value"); + } + else + { + Assert.Pass("Not Supported profile"); + } + } + + [Test] + [Category("P1")] + [Description("Test Hour. Check whether Hour is readable.")] + [Property("SPEC", "Tizen.NUI.WatchTime.Hour A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void Hour_GET_VALUE() + { + /* TEST CODE */ + if (IsWearable()) + { + var watchTime = new WatchTime(); + Assert.IsInstanceOf(watchTime, "Should be an instance of WatchTime type."); + int hour = watchTime.Hour; + Assert.AreEqual(0, hour, "Should be the default value"); + } + else + { + Assert.Pass("Not Supported profile"); + } + } + + [Test] + [Category("P1")] + [Description("Test Hour24. Check whether Hour24 is readable.")] + [Property("SPEC", "Tizen.NUI.WatchTime.Hour24 A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void Hour24_GET_VALUE() + { + /* TEST CODE */ + if (IsWearable()) + { + var watchTime = new WatchTime(); + Assert.IsInstanceOf(watchTime, "Should be an instance of WatchTime type."); + int hour24 = watchTime.Hour24; + Assert.AreEqual(0, hour24, "Should be the default value"); + } + else + { + Assert.Pass("Not Supported profile"); + } + } + + [Test] + [Category("P1")] + [Description("Test Millisecond. Check whether Millisecond is readable.")] + [Property("SPEC", "Tizen.NUI.WatchTime.Millisecond A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void Millisecond_GET_VALUE() + { + /* TEST CODE */ + if (IsWearable()) + { + var watchTime = new WatchTime(); + Assert.IsInstanceOf(watchTime, "Should be an instance of WatchTime type."); + int millisecond = watchTime.Millisecond; + Assert.AreEqual(0, millisecond, "Should be the default value"); + } + else + { + Assert.Pass("Not Supported profile"); + } + } + + [Test] + [Category("P1")] + [Description("Test Minute. Check whether Minute is readable.")] + [Property("SPEC", "Tizen.NUI.WatchTime.Minute A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void Minute_GET_VALUE() + { + /* TEST CODE */ + if (IsWearable()) + { + var watchTime = new WatchTime(); + Assert.IsInstanceOf(watchTime, "Should be an instance of WatchTime type."); + int minute = watchTime.Minute; + Assert.AreEqual(0, minute, "Should be the default value"); + } + else + { + Assert.Pass("Not Supported profile"); + } + } + + [Test] + [Category("P1")] + [Description("Test Month. Check whether Month is readable.")] + [Property("SPEC", "Tizen.NUI.WatchTime.Month A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void Month_GET_VALUE() + { + /* TEST CODE */ + if (IsWearable()) + { + var watchTime = new WatchTime(); + Assert.IsInstanceOf(watchTime, "Should be an instance of WatchTime type."); + int month = watchTime.Month; + Assert.AreEqual(0, month, "Should be the default value"); + } + else + { + Assert.Pass("Not Supported profile"); + } + } + + [Test] + [Category("P1")] + [Description("Test Second. Check whether Second is readable.")] + [Property("SPEC", "Tizen.NUI.WatchTime.Second A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void Second_GET_VALUE() + { + /* TEST CODE */ + if (IsWearable()) + { + var watchTime = new WatchTime(); + Assert.IsInstanceOf(watchTime, "Should be an instance of WatchTime type."); + int second = watchTime.Second; + Assert.AreEqual(0, second, "Should be the default value"); + } + else + { + Assert.Pass("Not Supported profile"); + } + } + + [Test] + [Category("P1")] + [Description("Test TimeZone. Check whether TimeZone is readable.")] + [Property("SPEC", "Tizen.NUI.WatchTime.TimeZone A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void TimeZone_GET_VALUE() + { + /* TEST CODE */ + if (IsWearable()) + { + var watchTime = new WatchTime(); + Assert.IsInstanceOf(watchTime, "Should be an instance of WatchTime type."); + string zone = watchTime.TimeZone; + Assert.AreEqual("", zone, "Should be the default value"); + } + else + { + Assert.Pass("Not Supported profile"); + } + } + + [Test] + [Category("P1")] + [Description("Test Year. Check whether Year is readable.")] + [Property("SPEC", "Tizen.NUI.WatchTime.Year A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void Year_GET_VALUE() + { + /* TEST CODE */ + if (IsWearable()) + { + var watchTime = new WatchTime(); + Assert.IsInstanceOf(watchTime, "Should be an instance of WatchTime type."); + int year = watchTime.Year; + Assert.AreEqual(0, year, "Should be the default value"); + } + else + { + Assert.Pass("Not Supported profile"); + } + } + } +} \ No newline at end of file diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWindow.SafeNativeWindowHandle.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWindow.SafeNativeWindowHandle.cs index 1d100e772..1721de9d7 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWindow.SafeNativeWindowHandle.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWindow.SafeNativeWindowHandle.cs @@ -10,6 +10,13 @@ namespace Tizen.NUI.Tests public class WindowSafeNativeWindowHandleTests { private static string TAG = "NUI-TCT"; + internal class MySafeNativeWindowHandle : Window.SafeNativeWindowHandle + { + public bool MyReleaseHandle() + { + return base.ReleaseHandle(); + } + } [SetUp] public static void Init() @@ -51,5 +58,21 @@ namespace Tizen.NUI.Tests Window.SafeNativeWindowHandle safeNativeWindowHandle = new Window.SafeNativeWindowHandle(); Assert.IsFalse(safeNativeWindowHandle.IsInvalid, "safeNativeWindowHandle should be valid here!"); } - } + + [Test] + [Category("P1")] + [Description("Test ReleaseHandle. Check whether ReleaseHandle returns expected value or not.")] + [Property("SPEC", "Tizen.NUI.Window.SafeNativeWindowHandle.ReleaseHandle M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void ReleaseHandle_CHECK_RETURN_VALUE() + { + /* TEST CODE */ + var mySafeHandle = new MySafeNativeWindowHandle(); + Assert.IsInstanceOf(mySafeHandle, "Should be an instance of SafeNativeWindowHandle type."); + bool ret = mySafeHandle.MyReleaseHandle(); + Assert.AreEqual(true, ret, "The return value should be true here."); + } + } } diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWindow.WindowFocusChangedEventArgs.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWindow.WindowFocusChangedEventArgs.cs new file mode 100755 index 000000000..fce75302f --- /dev/null +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWindow.WindowFocusChangedEventArgs.cs @@ -0,0 +1,62 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; +using System; +using Tizen.NUI; +using Tizen.NUI.Test; + +namespace Tizen.NUI.Tests +{ + [TestFixture] + [Description("Tizen.NUI.Window.WindowFocusChangedEventArgs Tests")] + public class WindowWindowFocusChangedEventArgsTests + { + private static string TAG = "NUI"; + + [SetUp] + public void Init() + { + Tizen.Log.Info(TAG, "Init() is called!"); + App.MainTitleChangeText("WindowFocusChangedEventArgsTests"); + App.MainTitleChangeBackgroundColor(null); + } + + [TearDown] + public void Destroy() + { + Tizen.Log.Info(TAG, "Destroy() is called!"); + } + + [Test] + [Category("P1")] + [Description("Create a WindowFocusChangedEventArgs object. Check whether WindowFocusChangedEventArgs is successfully created or not.")] + [Property("SPEC", "Tizen.NUI.Window.WindowFocusChangedEventArgs.WindowFocusChangedEventArgs C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void WindowFocusChangedEventArgs_INIT() + { + /* TEST CODE */ + var focusChangedEventArgs = new Window.WindowFocusChangedEventArgs(); + Assert.IsNotNull(focusChangedEventArgs, "Can't create success object FocusChangedEventArgs"); + Assert.IsInstanceOf(focusChangedEventArgs, "Should be an instance of WindowFocusChangedEventArgs type."); + } + + [Test] + [Category("P1")] + [Description("Test Key. Check whether Key is readable and writable.")] + [Property("SPEC", "Tizen.NUI.Window.WindowFocusChangedEventArgs.FocusGained A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA","PRW")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void FocusGained_SET_GET_VALUE() + { + /* TEST CODE */ + var focusChangedEventArgs = new Window.WindowFocusChangedEventArgs(); + focusChangedEventArgs.FocusGained = true; + Assert.IsTrue(focusChangedEventArgs.FocusGained, "FocusGained should be equal to set value"); + + focusChangedEventArgs.FocusGained = false; + Assert.IsFalse(focusChangedEventArgs.FocusGained, "FocusGained should be equal to set value"); + } + } +} diff --git a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWindow.cs b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWindow.cs index 9d2206d53..09e4807cc 100755 --- a/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWindow.cs +++ b/tct-suite-vs/Tizen.NUI.Tests/testcase/TSWindow.cs @@ -17,7 +17,7 @@ namespace Tizen.NUI.Tests private static string TAG = "NUI"; [SetUp] - public static void Init() + public void Init() { Tizen.Log.Info(TAG, "Init() is called!"); App.MainTitleChangeText("WindowTests"); @@ -25,10 +25,22 @@ namespace Tizen.NUI.Tests } [TearDown] - public static void Destroy() + public void Destroy() { Tizen.Log.Info(TAG, "Destroy() is called!"); - } + } + + private void OnFocusChanged(object obj, EventArgs e) + { } + + private void OnKeyEvent(object obj, EventArgs e) + { } + + private void OnTouchEvent(object obj, EventArgs e) + { } + + private void OnWheelEvent(object obj, EventArgs e) + { } [Test] [Category("P1")] @@ -1099,5 +1111,28 @@ namespace Tizen.NUI.Tests Assert.Fail("Caught Exception" + e.ToString()); } } - } + + [Test] + [Category("P1")] + [Description("FeedKeyEvent test, Check whether FeedKeyEvent function works or not.")] + [Property("SPEC", "Tizen.NUI.Window.FeedKeyEvent M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")] + public void FeedKeyEvent_CHECK_RETURN_VALUE() + { + /* TEST CODE */ + try + { + Key keyEvent = new Key(); + Window.FeedKeyEvent(keyEvent); + } + 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()); + } + } + } }