--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?xml-stylesheet type="text/xsl" href="jgenhtml.xsl"?><coverage branch-rate="NaN" branches-covered="0" branches-valid="0" complexity="0" date="2021-05-27" filename="index" function-rate="0.092856176" functions-covered="685" functions-valid="7377" line-rate="0.14716579" lines-covered="5382" lines-valid="36571" testname="lcov.info" version="1.5">
+<sources>
+<source branches-hit="0" branches-valid="0" functions-hit="22" functions-valid="75" lines-hit="108" lines-valid="470" pathname="/public/Theme" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="21" lines-hit="0" lines-valid="55" pathname="/internal/Window" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="38" lines-hit="0" lines-valid="142" pathname="/internal/Transition" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="148" functions-valid="239" lines-hit="592" lines-valid="956" pathname="/internal/NativeBinding" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="8" functions-valid="81" lines-hit="16" lines-valid="185" pathname="/public/Application" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="9" lines-hit="0" lines-valid="19" pathname="/public/XamlBinding/Internals" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="42" functions-valid="176" lines-hit="162" lines-valid="786" pathname="/internal/Application" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="45" lines-hit="0" lines-valid="253" pathname="/internal/FrameBroker" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="223" lines-hit="0" lines-valid="1179" pathname="/internal/XamlBinding" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="32" lines-hit="0" lines-valid="307" pathname="/public/CustomView" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="167" lines-hit="0" lines-valid="465" pathname="/public/Accessibility" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="206" lines-hit="0" lines-valid="850" pathname="/public/Layouting" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="25" lines-hit="0" lines-valid="93" pathname="/internal/EXaml/Block" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="215" lines-hit="0" lines-valid="797" pathname="/public/Input" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="74" lines-hit="0" lines-valid="375" pathname="/public/Rendering" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="46" lines-hit="0" lines-valid="212" pathname="/public/ViewProperty" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="6" functions-valid="19" lines-hit="60" lines-valid="76" pathname="/internal/Interop" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="1" functions-valid="146" lines-hit="1" lines-valid="747" pathname="/public/Animation" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="17" lines-hit="0" lines-valid="75" pathname="/internal/XamlBinding/Interactivity" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="38" lines-hit="0" lines-valid="195" pathname="/internal/EXaml/Operation" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="59" lines-hit="0" lines-valid="269" pathname="/public/Xaml" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="11" lines-hit="0" lines-valid="106" pathname="/internal/EXaml" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="1" functions-valid="130" lines-hit="1" lines-valid="501" pathname="/public/Window" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="11" lines-hit="0" lines-valid="32" pathname="/internal/Animation" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="49" functions-valid="195" lines-hit="1060" lines-valid="1555" pathname="/public/BaseComponents/Style" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="32" lines-hit="0" lines-valid="195" pathname="/public/Images" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="59" lines-hit="0" lines-valid="316" pathname="/internal/EXaml/Action" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="8" lines-hit="0" lines-valid="15" pathname="/public/Transition" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="45" lines-hit="0" lines-valid="122" pathname="/public/Xaml/MarkupExtensions" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="59" functions-valid="1122" lines-hit="167" lines-valid="3602" pathname="/internal/Common" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="209" functions-valid="233" lines-hit="559" lines-valid="732" pathname="/public/Events" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="238" lines-hit="0" lines-valid="1994" pathname="/internal/Xaml" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="47" lines-hit="0" lines-valid="162" pathname="/public/XamlBinding/Interactivity" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="2" functions-valid="64" lines-hit="5" lines-valid="431" pathname="/internal/Layouting" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="386" lines-hit="0" lines-valid="1195" pathname="/internal/WebView" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="4" lines-hit="0" lines-valid="36" pathname="/public/EXaml" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="69" lines-hit="0" lines-valid="310" pathname="/public/Widget" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="19" lines-hit="0" lines-valid="75" pathname="/public/BaseComponents/VectorGraphics" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="24" lines-hit="0" lines-valid="63" pathname="/internal/Accessibility" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="11" lines-hit="0" lines-valid="38" pathname="/internal/FrameProvider" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="10" functions-valid="23" lines-hit="34" lines-valid="85" pathname="/public/Template" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="56" lines-hit="0" lines-valid="145" pathname="/internal/Widget" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="49" functions-valid="893" lines-hit="2207" lines-valid="7885" pathname="/public/BaseComponents" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="378" lines-hit="0" lines-valid="1448" pathname="/internal/Utility" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="244" lines-hit="0" lines-valid="1326" pathname="/public/Utility" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="66" functions-valid="720" lines-hit="369" lines-valid="3077" pathname="/public/Common" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="162" lines-hit="0" lines-valid="1167" pathname="/public/Visuals" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="0" functions-valid="5" lines-hit="0" lines-valid="22" pathname="/internal/XamlBinding/Internals" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+<source branches-hit="0" branches-valid="0" functions-hit="13" functions-valid="237" lines-hit="41" lines-valid="1430" pathname="/public/XamlBinding" prefix="/home/wanggw/LineCoverageTool/coverage/Tizensource/TizenFX/src/Tizen.NUI/src"/>
+</sources>
+<config branch-coverage="false" description-file="false" function-coverage="true" genhtml_hi_limit="90" genhtml_med_limit="75" legend="false" no-sort="false" no-source="false"/>
+</coverage>
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Template/DataTemplate")]
+ public class PublicDataTemplateTest
+ {
+ private const string tag = "NUITEST";
+ private static readonly Condition condition;
+ private string path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "index.xml";
+
+ private void OnStatePropertyChanged(BindableObject bindable, object oldValue, object newValue)
+ {
+ if ((bool)oldValue == (bool)newValue) return;
+
+ condition.ConditionChanged?.Invoke(bindable, (bool)oldValue, (bool)newValue);
+ }
+
+ internal class MyDataTemplateTest : DataTemplate
+ {
+ public MyDataTemplateTest() : base()
+ { }
+
+ public void OnSetupContent(object value)
+ {
+ base.SetupContent(value);
+ }
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DataTemplate constructor.")]
+ [Property("SPEC", "Tizen.NUI.DataTemplate.DataTemplate C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DataTemplateConstructor()
+ {
+ tlog.Debug(tag, $"DataTemplateConstructor START");
+
+ var testingTarget = new DataTemplate();
+ Assert.IsNotNull(testingTarget, "Can't create success object DataTemplate");
+ Assert.IsInstanceOf<DataTemplate>(testingTarget, "Should be an instance of DataTemplate type.");
+
+ tlog.Debug(tag, $"DataTemplateConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DataTemplate constructor. With Type.")]
+ [Property("SPEC", "Tizen.NUI.DataTemplate.DataTemplate C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DataTemplateConstructorWithType()
+ {
+ tlog.Debug(tag, $"DataTemplateConstructorWithType START");
+
+ string str = "myDataTemplate";
+ var testingTarget = new DataTemplate(str.GetType());
+ Assert.IsNotNull(testingTarget, "Can't create success object DataTemplate");
+ Assert.IsInstanceOf<DataTemplate>(testingTarget, "Should be an instance of DataTemplate type.");
+
+ tlog.Debug(tag, $"DataTemplateConstructorWithType END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DataTemplate constructor. With Func.")]
+ [Property("SPEC", "Tizen.NUI.DataTemplate.DataTemplate C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DataTemplateConstructorWithFunc()
+ {
+ tlog.Debug(tag, $"DataTemplateConstructorWithFunc START");
+
+ Func<object> LoadTemplate = () => new View();
+
+ var testingTarget = new DataTemplate(LoadTemplate);
+ Assert.IsNotNull(testingTarget, "Can't create success object DataTemplate");
+ Assert.IsInstanceOf<DataTemplate>(testingTarget, "Should be an instance of DataTemplate type.");
+
+ tlog.Debug(tag, $"DataTemplateConstructorWithFunc END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DataTemplate SetBinding.")]
+ [Property("SPEC", "Tizen.NUI.DataTemplate.SetBinding M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DataTemplateSetBinding()
+ {
+ tlog.Debug(tag, $"DataTemplateSetBinding START");
+
+ BindingBase binding = new Tizen.NUI.Binding.Binding() as BindingBase;
+ BindableProperty stateProperty = BindableProperty.CreateAttached("State", typeof(bool), typeof(XamlPropertyCondition), false, propertyChanged: OnStatePropertyChanged);
+
+ var testingTarget = new DataTemplate();
+ Assert.IsNotNull(testingTarget, "Can't create success object DataTemplate");
+ Assert.IsInstanceOf<DataTemplate>(testingTarget, "Should be an instance of DataTemplate type.");
+
+ try
+ {
+ testingTarget.SetBinding(stateProperty, binding);
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("SetBinding Fail!");
+ }
+
+ tlog.Debug(tag, $"DataTemplateSetBinding END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DataTemplate SetBinding. With null BindableProperty.")]
+ [Property("SPEC", "Tizen.NUI.DataTemplate.SetBinding M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DataTemplateSetBindingWithNullBindableProperty()
+ {
+ tlog.Debug(tag, $"DataTemplateSetBindingWithNullBindableProperty START");
+
+ BindingBase binding = new Tizen.NUI.Binding.Binding() as BindingBase;
+
+ var testingTarget = new DataTemplate();
+ Assert.IsNotNull(testingTarget, "Can't create success object DataTemplate");
+ Assert.IsInstanceOf<DataTemplate>(testingTarget, "Should be an instance of DataTemplate type.");
+
+ try
+ {
+ testingTarget.SetBinding(null, binding);
+ }
+ catch (ArgumentNullException e)
+ {
+ tlog.Debug(tag, $"DataTemplateSetValueWithNullBindableProperty END (OK)");
+ Assert.Pass("Caught ArgumentNullException: Pass!");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DataTemplate SetBinding. With null BindingBase.")]
+ [Property("SPEC", "Tizen.NUI.DataTemplate.SetBinding M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DataTemplateSetBindingWithNullBindingBase()
+ {
+ tlog.Debug(tag, $"DataTemplateSetBindingWithNullBindingBase START");
+
+ BindableProperty stateProperty = BindableProperty.CreateAttached("State", typeof(bool), typeof(XamlPropertyCondition), false, propertyChanged: OnStatePropertyChanged);
+
+ var testingTarget = new DataTemplate();
+ Assert.IsNotNull(testingTarget, "Can't create success object DataTemplate");
+ Assert.IsInstanceOf<DataTemplate>(testingTarget, "Should be an instance of DataTemplate type.");
+
+ try
+ {
+ testingTarget.SetBinding(stateProperty, null);
+ }
+ catch (ArgumentNullException e)
+ {
+ tlog.Debug(tag, $"DataTemplateSetValueWithNullBindableProperty END (OK)");
+ Assert.Pass("Caught ArgumentNullException: Pass!");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DataTemplate SetValue.")]
+ [Property("SPEC", "Tizen.NUI.DataTemplate.SetValue M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DataTemplateSetValue()
+ {
+ tlog.Debug(tag, $"DataTemplateSetValue START");
+
+ BindableProperty stateProperty = BindableProperty.CreateAttached("State", typeof(bool), typeof(XamlPropertyCondition), false, propertyChanged: OnStatePropertyChanged);
+
+ var testingTarget = new DataTemplate();
+ Assert.IsNotNull(testingTarget, "Can't create success object DataTemplate");
+ Assert.IsInstanceOf<DataTemplate>(testingTarget, "Should be an instance of DataTemplate type.");
+
+ try
+ {
+ testingTarget.SetValue(stateProperty, true);
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("SetValue Fail!");
+ }
+
+ tlog.Debug(tag, $"DataTemplateSetValue END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DataTemplate SetValue. With null BindableProperty.")]
+ [Property("SPEC", "Tizen.NUI.DataTemplate.SetValue M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DataTemplateSetValueWithNullBindableProperty()
+ {
+ tlog.Debug(tag, $"DataTemplateSetValueWithNullBindableProperty START");
+
+ var testingTarget = new DataTemplate();
+ Assert.IsNotNull(testingTarget, "Can't create success object DataTemplate");
+ Assert.IsInstanceOf<DataTemplate>(testingTarget, "Should be an instance of DataTemplate type.");
+
+ try
+ {
+ testingTarget.SetValue(null, true);
+ }
+ catch (ArgumentNullException e)
+ {
+ tlog.Debug(tag, $"DataTemplateSetValueWithNullBindableProperty END (OK)");
+ Assert.Pass("Caught ArgumentNullException: Pass!");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DataTemplate SetupContent.")]
+ [Property("SPEC", "Tizen.NUI.DataTemplate.SetupContent M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DataTemplateSetupContent()
+ {
+ tlog.Debug(tag, $"DataTemplateSetupContent START");
+
+ BindingBase binding = new Tizen.NUI.Binding.Binding(path) as BindingBase;
+ BindableProperty stateProperty = BindableProperty.CreateAttached("State", typeof(bool), typeof(XamlPropertyCondition), false, propertyChanged: OnStatePropertyChanged);
+
+ var testingTarget = new MyDataTemplateTest();
+ Assert.IsNotNull(testingTarget, "Can't create success object DataTemplate");
+ Assert.IsInstanceOf<DataTemplate>(testingTarget, "Should be an instance of DataTemplate type.");
+
+ testingTarget.SetBinding(stateProperty, binding);
+ testingTarget.SetValue(stateProperty, true);
+
+ try
+ {
+ ViewStyle style = new ViewStyle();
+ testingTarget.OnSetupContent(style);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"DataTemplateSetupContent END (OK)");
+ Assert.Fail("Fail!");
+ }
+
+ tlog.Debug(tag, $"DataTemplateSetupContent END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DataTemplate SetupContent. With null bandable.")]
+ [Property("SPEC", "Tizen.NUI.DataTemplate.SetupContent M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DataTemplateSetupContentWithNullBindable()
+ {
+ tlog.Debug(tag, $"DataTemplateSetupContentWithNullBindable START");
+
+ BindingBase binding = new Tizen.NUI.Binding.Binding() as BindingBase;
+ BindableProperty stateProperty = BindableProperty.CreateAttached("State", typeof(bool), typeof(XamlPropertyCondition), false, propertyChanged: OnStatePropertyChanged);
+
+ var testingTarget = new MyDataTemplateTest();
+ Assert.IsNotNull(testingTarget, "Can't create success object DataTemplate");
+ Assert.IsInstanceOf<DataTemplate>(testingTarget, "Should be an instance of DataTemplate type.");
+
+ testingTarget.SetBinding(stateProperty, binding);
+
+ try
+ {
+ testingTarget.OnSetupContent(null);
+ }
+ catch (Exception e)
+ {
+ Assert.Fail("Fail!");
+ }
+
+ tlog.Debug(tag, $"DataTemplateSetupContentWithNullBindable END (OK)");
+ }
+
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Template/DataTemplateExtensions")]
+ public class PublicDataTemplateExtensionsTest
+ {
+ private const string tag = "NUITEST";
+
+ internal class MyDataTemplateSelector : DataTemplateSelector
+ {
+ public MyDataTemplateSelector() : base()
+ { }
+
+ protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
+ {
+ if (item.GetType().ToString() == "System.String")
+ {
+ return new MyDataTemplateSelector();
+ }
+ else
+ {
+ Func<object> LoadTemplate = () => new View();
+
+ return new DataTemplate(LoadTemplate);
+
+ }
+ }
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DataTemplateExtensions CreateContent.")]
+ [Property("SPEC", "Tizen.NUI.DataTemplateExtensions.CreateContent M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DataTemplateExtensionsCreateContent()
+ {
+ tlog.Debug(tag, $"DataTemplateExtensionsCreateContent START");
+
+ var testingTarget = new MyDataTemplateSelector();
+
+ try
+ {
+ DataTemplateExtensions.CreateContent(testingTarget, View.Property.STATE, new View());
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("CreateContent Fail!");
+ }
+
+ tlog.Debug(tag, $"DataTemplateExtensionsCreateContent END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("DataTemplateExtensions CreateContent. With null selector.")]
+ [Property("SPEC", "Tizen.NUI.DataTemplateExtensions.CreateContent M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DataTemplateExtensionsCreateContentWithNullSelector()
+ {
+ tlog.Debug(tag, $"DataTemplateExtensionsCreateContentWithNullSelector START");
+
+ Func<object> LoadTemplate = () => new View();
+ var testingTarget = new DataTemplate(LoadTemplate);
+
+ try
+ {
+ DataTemplateExtensions.CreateContent(testingTarget, View.Property.STATE, new View());
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("CreateContent Fail!");
+ }
+
+ tlog.Debug(tag, $"DataTemplateExtensionsCreateContentWithNullSelector END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("DataTemplateExtensions CreateContent. With LoadTemplate.")]
+ [Property("SPEC", "Tizen.NUI.DataTemplateExtensions.CreateContent M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DataTemplateExtensionsCreateContentWithNullLoadTemplate()
+ {
+ tlog.Debug(tag, $"DataTemplateExtensionsCreateContentWithNullLoadTemplate START");
+
+ var testingTarget = new DataTemplate();
+
+ try
+ {
+ DataTemplateExtensions.CreateContent(testingTarget, "Color", new View());
+ }
+ catch (NotSupportedException e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"DataTemplateExtensionsCreateContentWithNullLoadTemplate END (OK)");
+ Assert.Pass("Caught NotSupportedException: Pass!");
+ }
+
+ tlog.Debug(tag, $"DataTemplateExtensionsCreateContentWithNullLoadTemplate END (OK)");
+ }
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Template/DataTemplateSelector")]
+ public class PublicDataTemplateSelectorTest
+ {
+ private const string tag = "NUITEST";
+
+ internal class MyDataTemplateSelector : DataTemplateSelector
+ {
+ public MyDataTemplateSelector() : base()
+ { }
+
+ protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
+ {
+ if (item.GetType().ToString() == "System.String")
+ {
+ return new MyDataTemplateSelector();
+ }
+ else
+ {
+ Func<object> LoadTemplate = () => new View();
+
+ return new DataTemplate(LoadTemplate);
+
+ }
+ }
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("DataTemplateSelector SelectTemplate. With null LoadTemplate.")]
+ [Property("SPEC", "Tizen.NUI.DataTemplateExtensions.CreateContent M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DataTemplateSelectorSelectTemplateWithNullLoadTemplate()
+ {
+ tlog.Debug(tag, $"DataTemplateSelectorSelectTemplateWithNullLoadTemplate START");
+
+ var testingTarget = new MyDataTemplateSelector();
+
+ try
+ {
+ DataTemplateExtensions.CreateContent(testingTarget, "Color", new View());
+ }
+ catch (NotSupportedException e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"DataTemplateSelectorSelectTemplateWithNullLoadTemplate END (OK)");
+ Assert.Pass("Caught NotSupportedException: Pass!");
+ }
+
+ tlog.Debug(tag, $"DataTemplateSelectorSelectTemplateWithNullLoadTemplate END (OK)");
+ }
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Template/ElementTemplate")]
+ public class PublicElementTemplateTest
+ {
+ private const string tag = "NUITEST";
+
+ internal class MyDataTemplateSelector : DataTemplateSelector
+ {
+ public MyDataTemplateSelector() : base()
+ { }
+
+ protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
+ {
+ if (item.GetType().ToString() == "System.String")
+ {
+ return new MyDataTemplateSelector();
+ }
+ else
+ {
+ Func<object> LoadTemplate = null;
+
+ return new DataTemplate(LoadTemplate);
+ }
+
+ }
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ElementTemplate Parent.")]
+ [Property("SPEC", "Tizen.NUI.ElementTemplate.Parent A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ElementTemplateParent()
+ {
+ tlog.Debug(tag, $"ElementTemplateParent START");
+
+ try
+ {
+ Func<object> LoadTemplate = () => new View();
+ var testingTarget = new DataTemplate(LoadTemplate) as IElement;
+
+ testingTarget.Parent = Window.Instance.GetDefaultLayer();
+ Assert.AreEqual("Tizen.NUI.Layer", testingTarget.Parent.ToString(), "Should be equal!");
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"ElementTemplateParent END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ElementTemplate CanRecycle.")]
+ [Property("SPEC", "Tizen.NUI.ElementTemplate.CanRecycle A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ElementTemplateCanRecycle()
+ {
+ tlog.Debug(tag, $"ElementTemplateCanRecycle START");
+
+ Func<object> LoadTemplate = () => new View();
+ var testingTarget = new DataTemplate(LoadTemplate) as ElementTemplate;
+ Assert.AreEqual(false, testingTarget.CanRecycle, "Should be equal!");
+
+ string str = "ElementTemplate";
+ var testingTarget1 = new DataTemplate(str.GetType()) as ElementTemplate;
+ Assert.AreEqual(true, testingTarget1.CanRecycle, "Should be equal!");
+
+ tlog.Debug(tag, $"ElementTemplateCanRecycle END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("ElementTemplate Parent. Parent == Value.")]
+ [Property("SPEC", "Tizen.NUI.ElementTemplate.Parent A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ElementTemplateParentEqualsToValue()
+ {
+ tlog.Debug(tag, $"ElementTemplateParentEqualsToValue START");
+
+ Func<object> LoadTemplate = () => new View();
+ var testingTarget = new DataTemplate(LoadTemplate) as IElement;
+
+ testingTarget.Parent = Window.Instance.GetDefaultLayer();
+ Assert.AreEqual("Tizen.NUI.Layer", testingTarget.Parent.ToString(), "Should be equal!");
+
+ try
+ {
+ testingTarget.Parent = testingTarget.Parent;
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"ElementTemplateParentEqualsToValue END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("ElementTemplate Parent. Parent != Value.")]
+ [Property("SPEC", "Tizen.NUI.ElementTemplate.Parent A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ElementTemplateParentNotEqualsToValue()
+ {
+ tlog.Debug(tag, $"ElementTemplateParentNotEqualsToValue START");
+
+ Func<object> LoadTemplate = () => new View();
+ var testingTarget = new DataTemplate(LoadTemplate) as IElement;
+
+ testingTarget.Parent = Window.Instance.GetDefaultLayer();
+ Assert.AreEqual("Tizen.NUI.Layer", testingTarget.Parent.ToString(), "Should be equal!");
+
+ try
+ {
+ testingTarget.Parent = new View();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"ElementTemplateParentNotEqualsToValue END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("ElementTemplate constructor. With null Type.")]
+ [Property("SPEC", "Tizen.NUI.ElementTemplate.ElementTemplate C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ElementTemplateConstructorWithNullType()
+ {
+ tlog.Debug(tag, $"ElementTemplateConstructorWithNullType START");
+
+ try
+ {
+ Type type = null;
+ var testingTarget = new DataTemplate(type);
+ }
+ catch (ArgumentNullException e)
+ {
+ tlog.Debug(tag, $"ElementTemplateConstructorWithNullType END (OK)");
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Pass("Caught ArgumentNullException: Pass!");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("ElementTemplate constructor. With null loadTemplate.")]
+ [Property("SPEC", "Tizen.NUI.ElementTemplate.ElementTemplate C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ElementTemplateConstructorWithNullLoadTemplate()
+ {
+ tlog.Debug(tag, $"ElementTemplateConstructorWithNullLoadTemplate START");
+
+ try
+ {
+ var testingTarget = new MyDataTemplateSelector();
+
+ View view = new View()
+ {
+ Color = Color.Cyan,
+ };
+
+ DataTemplateExtensions.CreateContent(testingTarget, View.Property.STATE, view);
+ }
+ catch (ArgumentNullException e)
+ {
+ tlog.Debug(tag, $"ElementTemplateConstructorWithNullLoadTemplate END (OK)");
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Pass("Caught ArgumentNullException: Pass!");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ElementTemplate AddResourcesChangedListener.")]
+ [Property("SPEC", "Tizen.NUI.ElementTemplate.AddResourcesChangedListener M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ElementTemplateAddResourcesChangedListener()
+ {
+ tlog.Debug(tag, $"ElementTemplateAddResourcesChangedListener START");
+
+ Func<object> LoadTemplate = () => new View();
+ var testingTarget = new DataTemplate(LoadTemplate) as IElement;
+
+ Action<object, ResourcesChangedEventArgs> onChanged = null;
+
+ try
+ {
+ testingTarget.AddResourcesChangedListener(onChanged);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Falied!");
+ }
+
+ tlog.Debug(tag, $"ElementTemplateAddResourcesChangedListener END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ElementTemplate RemoveResourcesChangedListener.")]
+ [Property("SPEC", "Tizen.NUI.ElementTemplate.RemoveResourcesChangedListener M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ElementTemplateRemoveResourcesChangedListener()
+ {
+ tlog.Debug(tag, $"ElementTemplateRemoveResourcesChangedListener START");
+
+ Func<object> LoadTemplate = () => new View();
+ var testingTarget = new DataTemplate(LoadTemplate) as IElement;
+
+ Action<object, ResourcesChangedEventArgs> onChanged = null;
+ testingTarget.AddResourcesChangedListener(onChanged);
+
+ try
+ {
+ testingTarget.RemoveResourcesChangedListener(onChanged);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Falied!");
+ }
+
+ tlog.Debug(tag, $"ElementTemplateRemoveResourcesChangedListener END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("ElementTemplate RemoveResourcesChangedListener. Null changeHandlers.")]
+ [Property("SPEC", "Tizen.NUI.ElementTemplate.RemoveResourcesChangedListener M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ElementTemplateRemoveResourcesChangedListenerWithNullChangeHandlers()
+ {
+ tlog.Debug(tag, $"ElementTemplateRemoveResourcesChangedListenerWithNullChangeHandlers START");
+
+ Func<object> LoadTemplate = () => new View();
+ var testingTarget = new DataTemplate(LoadTemplate) as IElement;
+
+ Action<object, ResourcesChangedEventArgs> onChanged = null;
+
+ try
+ {
+ testingTarget.RemoveResourcesChangedListener(onChanged);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Falied!");
+ }
+
+ tlog.Debug(tag, $"ElementTemplateRemoveResourcesChangedListenerWithNullChangeHandlers END (OK)");
+ }
+ }
+}