- 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 <wenfeng.ge@samsung.com>
--- /dev/null
+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>(adaptor, "Should be an Instance of Adaptor!");
+ }\r
+\r
+ [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()\r
+ {\r
+ KeyPressedName = "Up",\r
+ State = Key.StateType.Down,\r
+ };
+ 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);\r
+ 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());
+ }
+ }
+ }
+}
{
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");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
}
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<AnimatedImageVisual>(myAnimatedImageVisual, "Should be an instance of AnimatedImageVisual type.");
+ PropertyMap propertyMap = myAnimatedImageVisual.OutputVisualMap;
+ Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked.");
+ }
}
}
--- /dev/null
+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<BaseHandle.FocusRequestArgs>(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");
+ }
+ }
+}
--- /dev/null
+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<Type>(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<BindingMode>(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<Object>(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<Boolean>(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<String>(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<Type>(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>(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>(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<TDeclarer,TPropertyType> 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<PushButton, string>(b => b.LabelText, null, BindingMode.TwoWay);
+ Assert.IsNotNull(bindableProperty, "BindableProperty instance is null");
+ Assert.IsInstanceOf<BindableProperty>(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<TDeclarer,TPropertyType> 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<string> validateValueDelegate = (b, v) => true;
+ BindableProperty.BindingPropertyChangedDelegate<string> changedDelegate = (b, ov, nv) => { };
+ BindableProperty.BindingPropertyChangingDelegate<string> changingDelegate = (b, ov, nv) => { };
+ BindableProperty.CoerceValueDelegate<string> coerceValueDelegate = (bindable, value) => value;
+
+ var bindableProperty = BindableProperty.Create<PushButton, string>(b => b.LabelText, null, BindingMode.TwoWay, validateValueDelegate, changedDelegate, changingDelegate, coerceValueDelegate);
+ Assert.IsNotNull(bindableProperty, "BindableProperty instance is null");
+ Assert.IsInstanceOf<BindableProperty>(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>(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>(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<BindablePropertyKey>(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<BindablePropertyKey>(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<BindablePropertyKey>(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<BindablePropertyKey>(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<TDeclarer,TPropertyType> 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<string> validateValueDelegate = (b, v) => true;
+ BindableProperty.BindingPropertyChangedDelegate<string> changedDelegate = (b, ov, nv) => { };
+ BindableProperty.BindingPropertyChangingDelegate<string> changingDelegate = (b, ov, nv) => { };
+ BindableProperty.CoerceValueDelegate<string> coerceValueDelegate = (bindable, value) => value;
+
+ var bindableProperty = BindableProperty.CreateReadOnly<PushButton, string>(b => b.LabelText, "Tizen", BindingMode.TwoWay, validateValueDelegate, changedDelegate, changingDelegate, coerceValueDelegate);
+ Assert.IsNotNull(bindableProperty, "BindableProperty instance is null");
+ Assert.IsInstanceOf<BindablePropertyKey>(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<TDeclarer,TPropertyType> 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<PushButton, string>(b => b.LabelText, "Tizen", BindingMode.TwoWay);
+ Assert.IsNotNull(bindableProperty, "BindableProperty instance is null");
+ Assert.IsInstanceOf<BindablePropertyKey>(bindableProperty, "Should be instance of BindableProperty.");
+ }
+ }
+}
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");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, " Destroy() is called!");
}
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<BorderVisual>(myBorderVisual, "Should be an instance of BorderVisual type.");
+ PropertyMap propertyMap = myBorderVisual.OutputVisualMap;
+ Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked.");
+ }
}
}
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");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, " Destroy() is called!");
}
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<ColorVisual>(myColorVisual, "Should be an instance of ColorVisual type.");
+ PropertyMap propertyMap = myColorVisual.OutputVisualMap;
+ Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked.");
+ }
}
}
[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>(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());
}
{
}
+ public MyCustomView(string typeName, CustomViewBehaviour behaviour) : base(typeName, behaviour)
+ {
+ }
+
public override void OnInitialize()
{
view = new BaseComponents.View();
{
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);
+ }
+
}
}
private static string TAG = "NUI";
[SetUp]
- public static void Init()
+ public void Init()
{
Tizen.Log.Info(TAG, "Init() is called!");
App.MainTitleChangeText("FocusManagerTests");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
- }
+ }\r
+ private void OnFocusGroupChanged(object obj, EventArgs e)\r
+ { }
[Test]
[Category("P1")]
manager.SetCurrentFocusView(view2);
Assert.IsTrue(flag, "FocusChanged is not be called");
}
-
}
public class CustomFocusAlgorithm : FocusManager.ICustomFocusAlgorithm
--- /dev/null
+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<GetResourcesProvider>(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");
+ }
+ }
+}
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");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
}
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<GradientVisual>(myGradientVisual, "Should be an instance of GradientVisual type.");
+ PropertyMap propertyMap = myGradientVisual.OutputVisualMap;
+ Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked.");
+ }
}
}
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.")]
{
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");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
}
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<ImageVisual>(myImageVisual, "Should be an instance of ImageVisual type.");
+ PropertyMap propertyMap = myImageVisual.OutputVisualMap;
+ Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked.");
+ }
}
}
{
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");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, " Destroy() is called!");
}
+ private void OnImfActivedEvent(object sender, EventArgs e)\r
+ {\r
+ _flagOnImfActivedEvent = true;\r
+ }\r
+\r
+ private ImfManager.ImfCallbackData OnImfEventReceivedEvent(object obj, EventArgs e)\r
+ {\r
+ _flagOnImfEventReceivedEvent = true;\r
+ ImfManager.ImfCallbackData callbackData = new ImfManager.ImfCallbackData(true, 0, "", false);\r
+ return callbackData;\r
+ }\r
+\r
+ private void OnLanguageChangedEvent(object obj, EventArgs e)\r
+ {\r
+ _flagOnLanguageChangedEvent = true;\r
+ }\r
+\r
+ private void OnResizedEvent(object obj, EventArgs e)\r
+ {\r
+ _flagOnResizedEvent = true;\r
+ }\r
+\r
+ private void OnStatusChangedEvent(object obj, EventArgs e)\r
+ {\r
+ _flagOnStatusChangedEvent = true;\r
+ }
+
[Test]
[Category("P1")]
[Description("Test constructor. Check whether it works or not.")]
public void GetTextDirection_RETURN_VALUE()
{
ImfManager manager = ImfManager.Get();
- if(manager)
+ if (manager)
{
Assert.AreEqual(ImfManager.TextDirection.LeftToRight, manager.GetTextDirection(), "Should be equal");
}
public void GetInputPanelLocale_RETURN_VALUE()
{
ImfManager manager = ImfManager.Get();
- if(manager)
+ if (manager)
{
Assert.AreEqual("", manager.GetInputPanelLocale(), "Should be null");
}
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();\r
+ Assert.IsInstanceOf<ImfManager>(manager, "Should be an instance of ImfManager type.");
+ try
+ {\r
+ _flagOnImfActivedEvent = false;\r
+ Assert.False(_flagOnImfActivedEvent, "_flagOnImfActivedEvent should false initial");\r
+ manager.Activated += OnImfActivedEvent;\r
+ manager.Activate();
+ await Task.Delay(20);\r
+ Assert.True(_flagOnImfActivedEvent, "Should be true after triger Activated event.");\r
+ }
+ 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
+ {\r
+ manager.Activated -= OnImfActivedEvent;\r
+ }
+ }
+
+ [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();\r
+ Assert.IsInstanceOf<ImfManager>(manager, "Should be an instance of ImfManager type.");
+ try
+ {
+ _flagOnImfEventReceivedEvent = false;
+ Assert.False(_flagOnImfEventReceivedEvent, "_flagOnImfEventReceivedEvent should false initial");
+ manager.EventReceived += OnImfEventReceivedEvent;\r
+ 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.");\r
+ }
+ 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
+ {\r
+ manager.EventReceived -= OnImfEventReceivedEvent;\r
+ }
+ }
+
+ [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();\r
+ Assert.IsInstanceOf<ImfManager>(manager, "Should be an instance of ImfManager type.");
+ try
+ {
+ _flagOnLanguageChangedEvent = false;
+ Assert.False(_flagOnLanguageChangedEvent, "_flagOnLanguageChangedEvent should false initial");
+ manager.LanguageChanged += OnLanguageChangedEvent;\r
+ 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
+ {\r
+ manager.LanguageChanged -= OnLanguageChangedEvent;\r
+ }
+ }
+
+ [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();\r
+ Assert.IsInstanceOf<ImfManager>(manager, "Should be an instance of ImfManager type.");
+ try
+ {
+ _flagOnResizedEvent = false;
+ Assert.False(_flagOnResizedEvent, "_flagOnResizedEvent should false initial");
+ manager.Resized += OnResizedEvent;\r
+ 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
+ {\r
+ manager.Resized -= OnResizedEvent;\r
+ }
+ }
+
+ [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();\r
+ Assert.IsInstanceOf<ImfManager>(manager, "Should be an instance of ImfManager type.");
+ try
+ {
+ _flagOnStatusChangedEvent = false;
+ Assert.False(_flagOnStatusChangedEvent, "_flagOnStatusChangedEvent should false initial");
+ manager.StatusChanged += OnStatusChangedEvent;\r
+ 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
+ {\r
+ manager.StatusChanged -= OnStatusChangedEvent;
+ }
+ }
}
}
--- /dev/null
+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>(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);\r
+ Assert.IsInstanceOf<LongPressGesture>(longPressGesture, "Should be an instance of LongPressGesture type");\r
+ Vector2 vector = longPressGesture.LocalPoint;\r
+ Assert.AreEqual(0, vector.X, "Should be the default value");\r
+ Assert.AreEqual(0, vector.Y, "Should be the default value");\r
+ }
+ 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);\r
+ Assert.IsInstanceOf<LongPressGesture>(longPressGesture, "Should be an instance of LongPressGesture type");\r
+ uint number = longPressGesture.NumberOfTouches;\r
+ Assert.AreEqual(1, number, "Should be the default value");\r
+ }
+ 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);\r
+ Assert.IsInstanceOf<LongPressGesture>(longPressGesture, "Should be an instance of LongPressGesture type");\r
+ Vector2 vector = longPressGesture.ScreenPoint;\r
+ Assert.AreEqual(0, vector.X, "Should be the default value");\r
+ Assert.AreEqual(0, vector.Y, "Should be the default value");\r
+ }
+ catch (Exception e)
+ {
+ Tizen.Log.Error(TAG, "Caught Exception" + e.ToString());
+ LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
+ Assert.Fail("Caught Exception" + e.ToString());
+ }
+ }
+ }
+}
public class 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");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
}
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<MeshVisual>(myMeshVisual, "Should be an instance of MeshVisual type.");
+ PropertyMap propertyMap = myMeshVisual.OutputVisualMap;
+ Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked.");
+ }
}
}
{
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");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
}
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<NPatchVisual>(myNPatchVisual, "Should be an instance of NPatchVisual type.");
+ PropertyMap propertyMap = myNPatchVisual.OutputVisualMap;
+ Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked.");
+ }
}
}
private static string TAG = "NUI";
[SetUp]
- public static void Init()
+ public void Init()
{
Tizen.Log.Info(TAG, "Init() is called!");
App.MainTitleChangeText("PanGestureTests");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
}
Assert.IsNotNull(panGesture, "Can't create success object PanGesture");
Assert.IsInstanceOf<PanGesture>(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();\r
+ Assert.IsInstanceOf<PanGesture>(panGesture, "Should be an instance of PanGesture type.");\r
+ float distance = panGesture.GetDistance();\r
+ Assert.AreEqual(0, distance, "Should be the default value");\r
+ }
+ 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();\r
+ Assert.IsInstanceOf<PanGesture>(panGesture, "Should be an instance of PanGesture type.");\r
+ float distance = panGesture.GetScreenDistance();\r
+ Assert.AreEqual(0, distance, "Should be the default value");\r
+ }
+ 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();\r
+ Assert.IsInstanceOf<PanGesture>(panGesture, "Should be an instance of PanGesture type.");\r
+ float speed = panGesture.GetScreenSpeed();\r
+ Assert.AreEqual(0, speed, "Should be the default value");\r
+ }
+ 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();\r
+ Assert.IsInstanceOf<PanGesture>(panGesture, "Should be an instance of PanGesture type.");\r
+ float speed = panGesture.GetSpeed();\r
+ Assert.AreEqual(0, speed, "Should be the default value");\r
+ }
+ 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();\r
+ Assert.IsInstanceOf<PanGesture>(panGesture, "Should be an instance of PanGesture type.");\r
+ Vector2 vector = panGesture.Displacement;\r
+ Assert.AreEqual(0, vector.X, "Should be the default value");\r
+ Assert.AreEqual(0, vector.Y, "Should be the default value");\r
+ }
+ 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();\r
+ Assert.IsInstanceOf<PanGesture>(panGesture, "Should be an instance of PanGesture type.");\r
+ uint number = panGesture.NumberOfTouches;\r
+ Assert.AreEqual(1, number, "Should be the default value");\r
+ }
+ 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();\r
+ Assert.IsInstanceOf<PanGesture>(panGesture, "Should be an instance of PanGesture type.");\r
+ Vector2 vector = panGesture.Position;\r
+ Assert.AreEqual(0, vector.X, "Should be the default value");\r
+ Assert.AreEqual(0, vector.Y, "Should be the default value");\r
+ }
+ 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();\r
+ Assert.IsInstanceOf<PanGesture>(panGesture, "Should be an instance of PanGesture type.");\r
+ Vector2 vector = panGesture.ScreenDisplacement;\r
+ Assert.AreEqual(0, vector.X, "Should be the default value");\r
+ Assert.AreEqual(0, vector.Y, "Should be the default value");\r
+ }
+ 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();\r
+ Assert.IsInstanceOf<PanGesture>(panGesture, "Should be an instance of PanGesture type.");\r
+ Vector2 vector = panGesture.ScreenPosition;\r
+ Assert.AreEqual(0, vector.X, "Should be the default value");\r
+ Assert.AreEqual(0, vector.Y, "Should be the default value");\r
+ }
+ 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();\r
+ Assert.IsInstanceOf<PanGesture>(panGesture, "Should be an instance of PanGesture type.");\r
+ Vector2 vector = panGesture.ScreenVelocity;\r
+ Assert.AreEqual(0, vector.X, "Should be the default value");\r
+ Assert.AreEqual(0, vector.Y, "Should be the default value");\r
+ }
+ 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();\r
+ Assert.IsInstanceOf<PanGesture>(panGesture, "Should be an instance of PanGesture type.");\r
+ Vector2 vector = panGesture.Velocity;\r
+ Assert.AreEqual(0, vector.X, "Should be the default value");\r
+ Assert.AreEqual(0, vector.Y, "Should be the default value");\r
+ }
+ 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());
+ }
+ }
}
}
--- /dev/null
+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!");
+ }
+ }\r
+}
\ No newline at end of file
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");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
- }
+ }\r
+\r
+ private void OnTouchedOutside(object obj, EventArgs e)\r
+ { }
[Test]
[Category("P1")]
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 -.")]
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.")]
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");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
}
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<PrimitiveVisual>(myPrimitiveVisual, "Should be an instance of PrimitiveVisual type.");
+ PropertyMap propertyMap = myPrimitiveVisual.OutputVisualMap;
+ Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked.");
+ }
}
}
[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();
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");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
}
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<SVGVisual>(mySVGVisual, "Should be an instance of SVGVisual type.");
+ PropertyMap propertyMap = mySVGVisual.OutputVisualMap;
+ Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked.");
+ }
}
}
private static string TAG = "NUI";
[SetUp]
- public static void Init()
+ public void Init()
{
Tizen.Log.Info(TAG, "Init() is called!");
App.MainTitleChangeText("ScrollBarTests");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
- }
+ }\r
[Test]
[Category("P1")]
private static string TAG = "NUI";
[SetUp]
- public static void Init()
+ public void Init()
{
Tizen.Log.Info(TAG, "Init() is called!");
App.MainTitleChangeText("ScrollViewTests");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
- }
+ }\r
[Test]
[Category("P1")]
public void SetScrollSensitive_CHECK_RETURN_VALUE()
{
/* TEST CODE */
- try {
+ try\r
+ {
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());
public void SetMaxOvershoot_CHECK_RETURN_VALUE()
{
/* TEST CODE */
- try {
+ try\r
+ {
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());
public void SetSnapOvershootAlphaFunction_CHECK_RETURN_VALUE()
{
/* TEST CODE */
- try {
+ try\r
+ {
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());
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());
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());
public void SetWrapMode_CHECK_RETURN_VALUE()
{
/* TEST CODE */
- try {
+ try\r
+ {
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());
[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")]
Assert.Fail("Caught Exception" + e.ToString());
}
}
-
}
public class ScrollViewPagePathEffect : ScrollViewEffect
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Test;
+using System.Threading.Tasks;
namespace Tizen.NUI.Tests
{
public static void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
+ }\r
+\r
+\r
+ private static bool _flagScrollStarted, _flagScrollCompleted;
+ private void OnScrollStarted(object obj, EventArgs e)\r
+ {\r
+ _flagScrollStarted = true;\r
}
+ private void OnScrollCompleted(object obj, EventArgs e)\r
+ {\r
+ _flagScrollCompleted = true;\r
+ }\r
+\r
+ private void OnScrollUpdated(object obj, EventArgs e)\r
+ { }
+
[Test]
[Category("P1")]
[Description("dali Scrollable constructor test")]
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<ScrollView>(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<ScrollView>(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();\r
+ Assert.IsInstanceOf<ScrollView>(scrollable, "Should be a intance of ScrollView type");
+ try
+ {
+ scrollable.ScrollUpdated += OnScrollUpdated;\r
+ }
+ 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
+ {\r
+ scrollable.ScrollUpdated -= OnScrollUpdated;\r
+ }
+ }
}
}
}
[SetUp]
- public static void Init()
+ public void Init()
{
Tizen.Log.Info(TAG, "Init() is called!");
App.MainTitleChangeText("SliderTests");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
- }
+ }\r
public bool OnSlidingFinish(object obj, Slider.SlidingFinishedEventArgs args)
{
private static string TAG = "NUI";
[SetUp]
- public static void Init()
+ public void Init()
{
Tizen.Log.Info(TAG, "Init() is called!");
App.MainTitleChangeText("TapGestureTests");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
}
Assert.IsNotNull(tapGesture, "Can't create success object TapGesture");
Assert.IsInstanceOf<TapGesture>(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();\r
+ Assert.IsInstanceOf<TapGesture>(tapGesture, "Should be an instance of TapGesture type.");\r
+ Vector2 vector = tapGesture.LocalPoint;\r
+ Assert.AreEqual(0, vector.X, "Should be the default value");\r
+ Assert.AreEqual(0, vector.Y, "Should be the default value");\r
+ }
+ 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();\r
+ Assert.IsInstanceOf<TapGesture>(tapGesture, "Should be an instance of TapGesture type.");\r
+ uint number = tapGesture.NumberOfTaps;\r
+ Assert.AreEqual(1, number, "Should be the default value");\r
+ }
+ 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();\r
+ Assert.IsInstanceOf<TapGesture>(tapGesture, "Should be an instance of TapGesture type.");\r
+ uint number = tapGesture.NumberOfTouches;\r
+ Assert.AreEqual(1, number, "Should be the default value");\r
+ }
+ 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();\r
+ Assert.IsInstanceOf<TapGesture>(tapGesture, "Should be an instance of TapGesture type.");\r
+ Vector2 vector = tapGesture.ScreenPoint;\r
+ Assert.AreEqual(0, vector.X, "Should be the default value");\r
+ Assert.AreEqual(0, vector.Y, "Should be the default value");\r
+ }
+ 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());
+ }
+ }
}
}
}
#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();
+ }
}
}
{
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");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
}
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<TextVisual>(myTextVisual, "Should be an instance of TextVisual type.");
+ PropertyMap propertyMap = myTextVisual.OutputVisualMap;
+ Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked.");
+ }
}
}
private static string TAG = "NUI";
[SetUp]
- public static void Init()
+ public void Init()
{
Tizen.Log.Info(TAG, "Init() is called!");
App.MainTitleChangeText("TouchTests");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
}
{
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");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
- }
+ }\r
[Test]
[Category("P1")]
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();\r
+ videoView.ResourceUrl = video_path;\r
+ Assert.IsInstanceOf<VideoView>(videoView, "Should be an instance of VideoView type.");
+ try
+ {
+ _flagOnFinished = false;\r
+ Assert.False(_flagOnFinished, "_flagOnFinished should false initial");
+ videoView.Finished += OnFinished;\r
+ 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
+ {\r
+ videoView.Finished -= OnFinished;\r
+ }
+ }
}
}
" }\n";
[SetUp]
- public static void Init()
+ public void Init()
{
Tizen.Log.Info(TAG, "Init() is called!");
_flag = false;
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
}
private void viewEventCallback(object sender, EventArgs e)
{
_flag = true;
- }
+ }\r
[Test]
[Category("P1")]
Assert.IsTrue(_flag, "Should be true!");
parentActor.ChildRemoved -= viewEventCallback;
}
-
}
-
}
{
private static string TAG = "NUI";
private static string image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Tizen.NUI.Tests.png";
+ private static bool _flagComposingPropertyMap;\r
+ internal class MyVisualAnimator : VisualAnimator\r
+ {\r
+ protected override void ComposingPropertyMap()\r
+ {\r
+ _flagComposingPropertyMap = true;\r
+ }\r
+ }
[SetUp]
- public static void Init()
+ public void Init()
{
Tizen.Log.Info(TAG, "Init() is called!");
App.MainTitleChangeText("VisualAnimatorTests");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
}
map.DestinationValue = color;
Assert.IsTrue(color.Equals(map.DestinationValue), "Retrieved DestinationValue should be equal to set value");
}
+
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Check override method ComposingPropertyMap is invoked when new VisualAnimator instance.")]\r
+ [Property("SPEC", "Tizen.NUI.VisualAnimator.ComposingPropertyMap M")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "MR")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void ComposingPropertyMap_OVERRIDE_METHOD()\r
+ {\r
+ /*PRE CONDITION\r
+ * _flagComposingPropertyMap flag is initialize false value\r
+ * Create a instance VisualAnimator\r
+ */\r
+ _flagComposingPropertyMap = false;\r
+ Assert.False(_flagComposingPropertyMap, "_flagComposingPropertyMap should false initial");\r
+ /**TEST CODE**/\r
+ var myVisualAnimator = new MyVisualAnimator()\r
+ {\r
+ StartTime = 10,\r
+ EndTime = 200,\r
+ };\r
+ Assert.IsInstanceOf<VisualAnimator>(myVisualAnimator, "Should be an instance of VisualAnimator type.");
+ PropertyMap propertyMap = myVisualAnimator.OutputVisualMap;\r
+ Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked.");\r
+ }
}
}
public class VisualMapTests
{
private static string TAG = "NUI";
+ private static bool _flagComposingPropertyMap;\r
+ internal class MyVisualMap : VisualMap\r
+ {\r
+ protected override void ComposingPropertyMap()\r
+ {\r
+ _flagComposingPropertyMap = true;\r
+ base.ComposingPropertyMap();\r
+ }\r
+ }
[SetUp]
- public static void Init()
+ public void Init()
{
Tizen.Log.Info(TAG, "Init() is called!");
App.MainTitleChangeText("VisualMapTests");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
}
visualMap.VisualFittingMode = VisualFittingModeType.FitKeepAspectRatio;
Assert.AreEqual(VisualFittingModeType.FitKeepAspectRatio, visualMap.VisualFittingMode, "Retrieved VisualFittingMode should be equal to set value");
}
+
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Check override method ComposingPropertyMap is invoked when new VisualMap instance.")]\r
+ [Property("SPEC", "Tizen.NUI.VisualMap.ComposingPropertyMap M")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "MR")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void ComposingPropertyMap_OVERRIDE_METHOD()\r
+ {\r
+ /*PRE CONDITION\r
+ * _flagComposingPropertyMap flag is initialize false value\r
+ * Create a instance VisualMap\r
+ */\r
+ _flagComposingPropertyMap = false;\r
+ Assert.False(_flagComposingPropertyMap, "_flagComposingPropertyMap should false initial");\r
+ /**TEST CODE**/\r
+ var myVisualMap = new MyVisualMap();\r
+ Assert.IsInstanceOf<VisualMap>(myVisualMap, "Should be an instance of VisualMap type.");
+ //In OutputVisualMap will call ComposingPropertyMap to set _flagComposingPropertyMap
+ PropertyMap propertyMap = myVisualMap.OutputVisualMap;\r
+ Assert.AreEqual(0, propertyMap.Count(), "Retrieved PropertyMap count should be 0");\r
+ Assert.True(_flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked.");\r
+ }
}
}
--- /dev/null
+using NUnit.Framework;\r
+using NUnit.Framework.TUnit;\r
+using System;\r
+using Tizen.NUI;\r
+using System.Threading.Tasks;\r
+using Tizen.NUI.Test;\r
+\r
+namespace Tizen.NUI.Tests\r
+{\r
+\r
+ [TestFixture]\r
+ [Description("Tizen.NUI.WatchTime Tests")]\r
+ public class WatchTimeTests\r
+ {\r
+ private static string TAG = "NUI";\r
+\r
+ private bool IsWearable()\r
+ {\r
+ string value;\r
+ var result = Tizen.System.Information.TryGetValue("tizen.org/feature/profile", out value);\r
+ if (result && value.Equals("wearable"))\r
+ {\r
+ return true;\r
+ }\r
+\r
+ return false;\r
+ }\r
+\r
+ [SetUp]\r
+ public void Init()\r
+ {\r
+ Tizen.Log.Info(TAG, "Init() is called!");\r
+ App.MainTitleChangeText("WatchTimeTests");\r
+ App.MainTitleChangeBackgroundColor(null);\r
+ }\r
+\r
+ [TearDown]\r
+ public void Destroy()\r
+ {\r
+ Tizen.Log.Info(TAG, "Destroy() is called!");\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("WatchTime constructor test")]\r
+ [Property("SPEC", "Tizen.NUI.WatchTime.WatchTime C")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "CONSTR")]\r
+ [Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]\r
+ public void WatchTime_INIT()\r
+ {\r
+ if (IsWearable())\r
+ {\r
+ /* TEST CODE */\r
+ var time = new WatchTime();\r
+ Assert.IsInstanceOf<WatchTime>(time, "Should return WatchTime instance.");\r
+ }\r
+ else\r
+ {\r
+ Assert.Pass("Not Supported profile");\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test Day. Check whether Day is readable.")]\r
+ [Property("SPEC", "Tizen.NUI.WatchTime.Day A")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "PRO")]\r
+ [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")]\r
+ public void Day_GET_VALUE()\r
+ {\r
+ /* TEST CODE */\r
+ if (IsWearable())\r
+ {\r
+ var watchTime = new WatchTime();\r
+ Assert.IsInstanceOf<WatchTime>(watchTime, "Should be an instance of WatchTime type.");\r
+ int time = watchTime.Day;\r
+ Assert.AreEqual(0, time, "Should be the default value");\r
+ }\r
+ else\r
+ {\r
+ Assert.Pass("Not Supported profile");\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test DaylightSavingTimeStatus. Check whether DaylightSavingTimeStatus is readable.")]\r
+ [Property("SPEC", "Tizen.NUI.WatchTime.DaylightSavingTimeStatus A")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "PRO")]\r
+ [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")]\r
+ public void DaylightSavingTimeStatus_GET_VALUE()\r
+ {\r
+ /* TEST CODE */\r
+ if (IsWearable())\r
+ {\r
+ var watchTime = new WatchTime();\r
+ Assert.IsInstanceOf<WatchTime>(watchTime, "Should be an instance of WatchTime type.");\r
+ bool status = watchTime.DaylightSavingTimeStatus;\r
+ Assert.AreEqual(false, status, "Should be the default value");\r
+ }\r
+ else\r
+ {\r
+ Assert.Pass("Not Supported profile");\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test DayOfWeek. Check whether DayOfWeek is readable.")]\r
+ [Property("SPEC", "Tizen.NUI.WatchTime.DayOfWeek A")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "PRO")]\r
+ [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")]\r
+ public void DayOfWeek_GET_VALUE()\r
+ {\r
+ /* TEST CODE */\r
+ if (IsWearable())\r
+ {\r
+ var watchTime = new WatchTime();\r
+ Assert.IsInstanceOf<WatchTime>(watchTime, "Should be an instance of WatchTime type.");\r
+ int day = watchTime.DayOfWeek;\r
+ Assert.AreEqual(0, day, "Should be the default value");\r
+ }\r
+ else\r
+ {\r
+ Assert.Pass("Not Supported profile");\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test Hour. Check whether Hour is readable.")]\r
+ [Property("SPEC", "Tizen.NUI.WatchTime.Hour A")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "PRO")]\r
+ [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")]\r
+ public void Hour_GET_VALUE()\r
+ {\r
+ /* TEST CODE */\r
+ if (IsWearable())\r
+ {\r
+ var watchTime = new WatchTime();\r
+ Assert.IsInstanceOf<WatchTime>(watchTime, "Should be an instance of WatchTime type.");\r
+ int hour = watchTime.Hour;\r
+ Assert.AreEqual(0, hour, "Should be the default value");\r
+ }\r
+ else\r
+ {\r
+ Assert.Pass("Not Supported profile");\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test Hour24. Check whether Hour24 is readable.")]\r
+ [Property("SPEC", "Tizen.NUI.WatchTime.Hour24 A")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "PRO")]\r
+ [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")]\r
+ public void Hour24_GET_VALUE()\r
+ {\r
+ /* TEST CODE */\r
+ if (IsWearable())\r
+ {\r
+ var watchTime = new WatchTime();\r
+ Assert.IsInstanceOf<WatchTime>(watchTime, "Should be an instance of WatchTime type.");\r
+ int hour24 = watchTime.Hour24;\r
+ Assert.AreEqual(0, hour24, "Should be the default value");\r
+ }\r
+ else\r
+ {\r
+ Assert.Pass("Not Supported profile");\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test Millisecond. Check whether Millisecond is readable.")]\r
+ [Property("SPEC", "Tizen.NUI.WatchTime.Millisecond A")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "PRO")]\r
+ [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")]\r
+ public void Millisecond_GET_VALUE()\r
+ {\r
+ /* TEST CODE */\r
+ if (IsWearable())\r
+ {\r
+ var watchTime = new WatchTime();\r
+ Assert.IsInstanceOf<WatchTime>(watchTime, "Should be an instance of WatchTime type.");\r
+ int millisecond = watchTime.Millisecond;\r
+ Assert.AreEqual(0, millisecond, "Should be the default value");\r
+ }\r
+ else\r
+ {\r
+ Assert.Pass("Not Supported profile");\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test Minute. Check whether Minute is readable.")]\r
+ [Property("SPEC", "Tizen.NUI.WatchTime.Minute A")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "PRO")]\r
+ [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")]\r
+ public void Minute_GET_VALUE()\r
+ {\r
+ /* TEST CODE */\r
+ if (IsWearable())\r
+ {\r
+ var watchTime = new WatchTime();\r
+ Assert.IsInstanceOf<WatchTime>(watchTime, "Should be an instance of WatchTime type.");\r
+ int minute = watchTime.Minute;\r
+ Assert.AreEqual(0, minute, "Should be the default value");\r
+ }\r
+ else\r
+ {\r
+ Assert.Pass("Not Supported profile");\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test Month. Check whether Month is readable.")]\r
+ [Property("SPEC", "Tizen.NUI.WatchTime.Month A")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "PRO")]\r
+ [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")]\r
+ public void Month_GET_VALUE()\r
+ {\r
+ /* TEST CODE */\r
+ if (IsWearable())\r
+ {\r
+ var watchTime = new WatchTime();\r
+ Assert.IsInstanceOf<WatchTime>(watchTime, "Should be an instance of WatchTime type.");\r
+ int month = watchTime.Month;\r
+ Assert.AreEqual(0, month, "Should be the default value");\r
+ }\r
+ else\r
+ {\r
+ Assert.Pass("Not Supported profile");\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test Second. Check whether Second is readable.")]\r
+ [Property("SPEC", "Tizen.NUI.WatchTime.Second A")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "PRO")]\r
+ [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")]\r
+ public void Second_GET_VALUE()\r
+ {\r
+ /* TEST CODE */\r
+ if (IsWearable())\r
+ {\r
+ var watchTime = new WatchTime();\r
+ Assert.IsInstanceOf<WatchTime>(watchTime, "Should be an instance of WatchTime type.");\r
+ int second = watchTime.Second;\r
+ Assert.AreEqual(0, second, "Should be the default value");\r
+ }\r
+ else\r
+ {\r
+ Assert.Pass("Not Supported profile");\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test TimeZone. Check whether TimeZone is readable.")]\r
+ [Property("SPEC", "Tizen.NUI.WatchTime.TimeZone A")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "PRO")]\r
+ [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")]\r
+ public void TimeZone_GET_VALUE()\r
+ {\r
+ /* TEST CODE */\r
+ if (IsWearable())\r
+ {\r
+ var watchTime = new WatchTime();\r
+ Assert.IsInstanceOf<WatchTime>(watchTime, "Should be an instance of WatchTime type.");\r
+ string zone = watchTime.TimeZone;\r
+ Assert.AreEqual("", zone, "Should be the default value");\r
+ }\r
+ else\r
+ {\r
+ Assert.Pass("Not Supported profile");\r
+ }\r
+ }\r
+\r
+ [Test]\r
+ [Category("P1")]\r
+ [Description("Test Year. Check whether Year is readable.")]\r
+ [Property("SPEC", "Tizen.NUI.WatchTime.Year A")]\r
+ [Property("SPEC_URL", "-")]\r
+ [Property("CRITERIA", "PRO")]\r
+ [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")]\r
+ public void Year_GET_VALUE()\r
+ {\r
+ /* TEST CODE */\r
+ if (IsWearable())\r
+ {\r
+ var watchTime = new WatchTime();\r
+ Assert.IsInstanceOf<WatchTime>(watchTime, "Should be an instance of WatchTime type.");\r
+ int year = watchTime.Year;\r
+ Assert.AreEqual(0, year, "Should be the default value");\r
+ }\r
+ else\r
+ {\r
+ Assert.Pass("Not Supported profile");\r
+ }\r
+ }\r
+ }\r
+}
\ No newline at end of file
public class WindowSafeNativeWindowHandleTests
{
private static string TAG = "NUI-TCT";
+ internal class MySafeNativeWindowHandle : Window.SafeNativeWindowHandle\r
+ {\r
+ public bool MyReleaseHandle()\r
+ {\r
+ return base.ReleaseHandle();\r
+ }\r
+ }
[SetUp]
public static void Init()
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();\r
+ Assert.IsInstanceOf<Window.SafeNativeWindowHandle>(mySafeHandle, "Should be an instance of SafeNativeWindowHandle type.");\r
+ bool ret = mySafeHandle.MyReleaseHandle();\r
+ Assert.AreEqual(true, ret, "The return value should be true here.");\r
+ }\r
+ }\r
}
--- /dev/null
+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<Window.WindowFocusChangedEventArgs>(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");
+ }
+ }
+}
private static string TAG = "NUI";
[SetUp]
- public static void Init()
+ public void Init()
{
Tizen.Log.Info(TAG, "Init() is called!");
App.MainTitleChangeText("WindowTests");
}
[TearDown]
- public static void Destroy()
+ public void Destroy()
{
Tizen.Log.Info(TAG, "Destroy() is called!");
- }
+ }\r
+\r
+ private void OnFocusChanged(object obj, EventArgs e)\r
+ { }
+
+ private void OnKeyEvent(object obj, EventArgs e)\r
+ { }
+
+ private void OnTouchEvent(object obj, EventArgs e)\r
+ { }
+
+ private void OnWheelEvent(object obj, EventArgs e)\r
+ { }
[Test]
[Category("P1")]
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());
+ }
+ }
+ }\r
}