- A part of https://code.sec.samsung.net/jira/browse/TCSACR-280.
The full patch of this ACR will be submitted later, but this is blocking issue of GBM release.
Therefore, this patch needs to be reviewed and merged urgently.
- ProgressBar, ScrollBar classes test cases are removed
Change-Id: I50c263d11949c64c11b48a1e419a00a35c85d901
+++ /dev/null
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System;
-using Tizen.NUI;
-using Tizen.NUI.UIComponents;
-using System.Threading.Tasks;
-using Tizen.NUI.Test;
-
-namespace Tizen.NUI.Tests
-{
-
- [TestFixture]
- [Description("Tizen.NUI.UIComponents.ProgressBar.ValueChangedEventArgs Tests")]
- public class ProgressBarValueChangedEventArgsTests
- {
- private string TAG = "NUI";
- private string image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Tizen.NUI.Tests.png";
-
- [SetUp]
- public void Init()
- {
- Tizen.Log.Info(TAG, "Init() is called!");
- App.MainTitleChangeText("ValueChangedEventArgsTests");
- App.MainTitleChangeBackgroundColor(null);
- }
-
- [TearDown]
- public void Destroy()
- {
- Tizen.Log.Info(TAG, "Destroy() is called!");
- }
-
- [Test]
- [Category("P1")]
- [Description("dali ProgressBar.ValueChangedEventArgs constructor test")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ProgressBar.ValueChangedEventArgs.ValueChangedEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void ValueChangedEventArgs_INIT()
- {
- /* TEST CODE */
- var valueChangedEventArgs = new ProgressBar.ValueChangedEventArgs();
- Assert.IsInstanceOf<ProgressBar.ValueChangedEventArgs>(valueChangedEventArgs, "Should return ProgressBar.ValueChangedEventArgs instance.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test View. Check whether View is readable and writable.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ProgressBar.ValueChangedEventArgs.ProgressBar A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void ProgressBar_SET_GET_VALUE()
- {
- /* TEST CODE */
- ProgressBar.ValueChangedEventArgs valueChangedEventArgs = new ProgressBar.ValueChangedEventArgs();
- ProgressBar progressBar = new ProgressBar();
- valueChangedEventArgs.ProgressBar = progressBar;
- Assert.AreEqual(progressBar, valueChangedEventArgs.ProgressBar, "Retrieved ProgressBar should be equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test ProgressValue. Check whether ProgressValue is readable and writable.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ProgressBar.ValueChangedEventArgs.ProgressValue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void ProgressValue_SET_GET_VALUE()
- {
- /* TEST CODE */
- ProgressBar.ValueChangedEventArgs valueChangedEventArgs = new ProgressBar.ValueChangedEventArgs();
- ProgressBar progressBar = new ProgressBar();
- valueChangedEventArgs.ProgressBar = progressBar;
- valueChangedEventArgs.ProgressBar.ProgressValue = 0.5f;
- Assert.AreEqual(0.5f, valueChangedEventArgs.ProgressBar.ProgressValue, "Retrieved ProgressValue should be equal to set value");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test SecondaryProgressValue. Check whether SecondaryProgressValue is readable and writable.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ProgressBar.ValueChangedEventArgs.SecondaryProgressValue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void SecondaryProgressValue_SET_GET_VALUE()
- {
- /* TEST CODE */
- ProgressBar.ValueChangedEventArgs valueChangedEventArgs = new ProgressBar.ValueChangedEventArgs();
- ProgressBar progressBar = new ProgressBar();
- valueChangedEventArgs.ProgressBar = progressBar;
- valueChangedEventArgs.ProgressBar.SecondaryProgressValue = 0.5f;
- Assert.AreEqual(0.5f, valueChangedEventArgs.ProgressBar.SecondaryProgressValue, "Retrieved SecondaryProgressValue should be equal to set value");
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System;
-using Tizen.NUI;
-using Tizen.NUI.UIComponents;
-using System.Threading;
-using System.Threading.Tasks;
-using Tizen.NUI.Test;
-
-namespace Tizen.NUI.Tests
-{
- using tlog = Tizen.Log;
-
- [TestFixture]
- [Description("Tizen.NUI.UIComponents.ProgressBar Tests")]
- public class ProgressBarTests
- {
- private string TAG = "NUI";
- private string image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "Tizen.NUI.Tests.png";
-
- [SetUp]
- public void Init()
- {
- Tizen.Log.Info(TAG, "Init() is called!");
- App.MainTitleChangeText("ProgressBarTests");
- App.MainTitleChangeBackgroundColor(null);
- }
-
- [TearDown]
- public void Destroy()
- {
- Tizen.Log.Info(TAG, "Destroy() is called!");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test Construct. Check whether Table View construct.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ProgressBar.ProgressBar C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Xuemei Chen, xnicole.chen@samsung.com")]
- public async Task ProgressBar_INIT()
- {
- var progress = new ProgressBar();
-
- Assert.IsNotNull(progress, "Should not be a Null : ProgressBar");
- Assert.IsInstanceOf<ProgressBar>(progress, "Progress Contruct Fail");
-
- Assert.IsNotNull(Window.Instance, "Should not be a Null : Window.Instance");
- Assert.IsInstanceOf<Window>(Window.Instance, "Should be an instance of : Window.Instance");
-
- Window.Instance.GetDefaultLayer().Add(progress);
-
- progress.Size2D = new Size2D(100, 100);
-
- await Task.Delay(1000);
-
- progress.Unparent();
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Test ProgressValue. Check ProgressValue Read and Write.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ProgressBar.ProgressValue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Xuemei Chen, xnicole.chen@samsung.com")]
- public async Task ProgressValue_SET_GET_VALUE()
- {
- var progress = new ProgressBar();
-
- Window.Instance.GetDefaultLayer().Add(progress);
-
- progress.ParentOrigin = ParentOrigin.TopLeft;
- progress.PivotPoint = PivotPoint.TopLeft;
- progress.Size = new Size(Window.Instance.Size.Width, 20.0f, 0.0f);
- progress.Position = new Position(0.0f, 0.0f, 0.0f);
- progress.BackgroundColor = new Color(255,0,0,255);
- progress.ProgressValue = 0.03f;
-
- await Task.Delay(1000);
- Assert.AreEqual(0.03f, progress.ProgressValue, "ProgressValue test Fail ");
-
- progress.Unparent();
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Test SecondaryProgressValue. Check SecondaryProgressValue Read and Write.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ProgressBar.SecondaryProgressValue A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Xuemei Chen, xnicole.chen@samsung.com")]
- public async Task SecondaryProgressValue_SET_GET_VALUE()
- {
- var progress = new ProgressBar();
-
- Window.Instance.GetDefaultLayer().Add(progress);
- progress.ParentOrigin = ParentOrigin.TopLeft;
- progress.PivotPoint = PivotPoint.TopLeft;
- progress.Size = new Size(Window.Instance.Size.Width, 20.0f, 0.0f);
- progress.Position = new Position(0.0f, 20.0f, 0.0f);
- progress.BackgroundColor = new Color(0, 255, 0, 255);
- progress.SecondaryProgressValue = 0.04f;
-
- await Task.Delay(1000);
- float secondvalue = progress.SecondaryProgressValue;
- Assert.AreEqual(0.04f, secondvalue, "Secondary ProgressValue test Fail");
- progress.Unparent();
-
- }
-
- [Test]
- [Category("P1")]
- [Description("Test Indeterminate. Check Indeterminate Read and Write.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ProgressBar.Indeterminate A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Xuemei Chen, xnicole.chen@samsung.com")]
- public async Task Indeterminate_SET_GET_VALUE()
- {
- var progress = new ProgressBar();
- progress.ParentOrigin = ParentOrigin.TopLeft;
- progress.PivotPoint = PivotPoint.TopLeft;
- progress.Size = new Size(Window.Instance.Size.Width, 20.0f, 0.0f);
- progress.Position = new Position(0.0f, 0.0f, 0.0f);
- progress.BackgroundColor = new Color(255, 0, 0, 255);
-
- Window.Instance.GetDefaultLayer().Add(progress);
- progress.Indeterminate = true;
-
- await Task.Delay(20);
- Assert.IsTrue(progress.Indeterminate, "Test Indeterminate Fail.");
- Window.Instance.GetDefaultLayer().Remove(progress);
- }
-
- [Test]
- [Category("P1")]
- [Description("Test TrackVisual. Check TrackVisual Read and Write.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ProgressBar.TrackVisual A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Xuemei Chen, xnicole.chen@samsung.com")]
-
- public void TrackVisual_SET_GET_VALUE()
- {
- ProgressBar progress = new ProgressBar();
-
- progress.ParentOrigin = ParentOrigin.TopLeft;
- progress.PivotPoint = PivotPoint.TopLeft;
- progress.Size = new Size(Window.Instance.Size.Width, 20.0f, 0.0f);
- progress.Position = new Position(0.0f, 0.0f, 0.0f);
- progress.BackgroundColor = new Color(255, 0, 0, 255);
-
- Window.Instance.GetDefaultLayer().Add(progress);
- PropertyMap map = new PropertyMap();
- map.Add("visualType", new PropertyValue("IMAGE"));
- map.Add(ImageVisualProperty.URL, new PropertyValue(image_path));
- progress.TrackVisual = map;
- string url = "";
- PropertyValue value = progress.TrackVisual.Find(ImageVisualProperty.URL);
- Assert.IsNotNull(value, "Property Value is NUll.");
- value.Get(out url);
- Assert.AreEqual(image_path, url, "URL IS NOT RIGHT.");
-
- map.Clear();
- progress.TrackVisual = map;
-
- Window.Instance.GetDefaultLayer().Remove(progress);
- }
-
- [Test]
- [Category("P1")]
- [Description("Test SecondaryProgressVisual. Check SecondaryProgressVisual Read and Write.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ProgressBar.SecondaryProgressVisual A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Xuemei Chen, xnicole.chen@samsung.com")]
- public void SecondaryProgressVisual_SET_GET_VALUE()
- {
- ProgressBar progress = new ProgressBar();
- PropertyMap map = new PropertyMap();
- map.Add("visualType", new PropertyValue("IMAGE"));
- map.Add(ImageVisualProperty.URL, new PropertyValue(image_path));
- progress.SecondaryProgressVisual = map;
- string url = "";
- PropertyValue value = progress.SecondaryProgressVisual.Find(ImageVisualProperty.URL);
- Assert.IsNotNull(value, "Property Value is NUll.");
- value.Get(out url);
- Assert.AreEqual(image_path, url, "URL IS NOT RIGHT.");
-
- map.Clear();
- progress.SecondaryProgressVisual = map;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test ProgressVisual. Check ProgressVisual Read and Write.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ProgressBar.ProgressVisual A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Xuemei Chen, xnicole.chen@samsung.com")]
- public async Task ProgressVisual_SET_GET_VALUE()
- {
- ProgressBar progress = new ProgressBar();
-
- progress.ParentOrigin = ParentOrigin.TopLeft;
- progress.PivotPoint = PivotPoint.TopLeft;
- progress.Size = new Size(Window.Instance.Size.Width, 20.0f, 0.0f);
- progress.Position = new Position(0.0f, 0.0f, 0.0f);
- progress.BackgroundColor = new Color(255, 0, 0, 255);
- Window.Instance.GetDefaultLayer().Add(progress);
- PropertyMap map = new PropertyMap();
- map.Add("visualType", new PropertyValue("IMAGE"));
- map.Add(ImageVisualProperty.URL, new PropertyValue(image_path));
-
- await Task.Delay(2000);
- progress.ProgressVisual = map;
- string url = "";
- PropertyMap rMap = progress.ProgressVisual;
- Assert.IsNotNull(rMap, "RETURN IS NULL");
- PropertyValue pvalue = rMap.Find(ImageVisualProperty.URL);
- Assert.IsNotNull(pvalue, "RETURN IS NULL 2");
- pvalue.Get(out url);
- Assert.AreEqual(image_path, url, "URL IS NOT RIGHT.");
-
- map.Clear();
- progress.ProgressVisual = map;
-
- Window.Instance.GetDefaultLayer().Remove(progress);
- }
-
- [Test]
- [Category("P1")]
- [Description("Test IndeterminateVisual. Check IndeterminateVisual Read and Write.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ProgressBar.IndeterminateVisual A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Xuemei Chen, xnicole.chen@samsung.com")]
-
- public void IndeterminateVisual_SET_GET_VALUE()
- {
- ProgressBar progress = new ProgressBar();
- PropertyMap map = new PropertyMap();
- map.Add("visualType", new PropertyValue("IMAGE"));
- map.Add(ImageVisualProperty.URL, new PropertyValue(image_path));
-
- progress.IndeterminateVisual = map;
- string url = "";
- PropertyValue pValue = progress.IndeterminateVisual.Find(ImageVisualProperty.URL);
- Assert.IsNotNull(pValue, "RETURN IS NULL 2");
- pValue.Get(out url);
- Assert.AreEqual(image_path, url, "URL IS NOT RIGHT.");
-
- map.Clear();
- progress.IndeterminateVisual = map;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test LabelVisual. Check LabelVisual Read and Write.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ProgressBar.LabelVisual A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Xuemei Chen, xnicole.chen@samsung.com")]
-
- public void LabelVisual_SET_GET_VALUE()
- {
- ProgressBar progress = new ProgressBar();
- progress.Size2D = new Size2D(0, 100);
- progress.ProgressValue = 0.5f;
- progress.SecondaryProgressValue = 0.61f;
- PropertyMap map = new PropertyMap();
- map.Add(Visual.Property.Type, new PropertyValue((int)Tizen.NUI.Visual.Type.Text));
- map.Add(TextVisualProperty.PointSize, new PropertyValue(10.0f));
- map.Add(TextVisualProperty.Text, new PropertyValue(Math.Round(progress.ProgressValue, 2) + " / " + Math.Round(progress.SecondaryProgressValue, 2)));
- progress.LabelVisual = map;
-
- PropertyValue value = progress.LabelVisual.Find(TextVisualProperty.Text);
- Assert.IsNotNull(progress.LabelVisual.Find(TextVisualProperty.Text), "Should not be null");
- String text = "";
- (progress.LabelVisual.Find(TextVisualProperty.Text)).Get(out text);
- Assert.AreEqual("0.5 / 0.61", text, "SelectedStateImage does not work well here!");
-
- map.Clear();
- progress.LabelVisual = map;
-
- }
-
- [Test]
- [Category("P1")]
- [Description("dali progress bar indeterminatw visual animation test")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ProgressBar.IndeterminateVisualAnimation A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void IndeterminateVisualAnimation_SET_GET_VALUE()
- {
- ProgressBar progress = new ProgressBar();
- PropertyArray transitionMap = new PropertyArray();
- PropertyMap animatorMap = new PropertyMap();
- PropertyMap timeMap = new PropertyMap();
- timeMap.Add("delay", new PropertyValue(0.5f));
- timeMap.Add("duration", new PropertyValue(1.0f));
- animatorMap.Add("alphaFunction", new PropertyValue("EASE_IN_OUT_BACK"));
- animatorMap.Add("timePeriod", new PropertyValue( timeMap));
-
- transitionMap.PushBack( new PropertyValue("indeterminateVisual"));
- transitionMap.PushBack(new PropertyValue("offset"));
- transitionMap.PushBack( new PropertyValue(new Vector2(0.0f, 0.0f)));
- transitionMap.PushBack( new PropertyValue(new Vector2(10.0f, 0.0f)));
- transitionMap.PushBack(new PropertyValue(animatorMap));
-
- progress.IndeterminateVisualAnimation = transitionMap;
-
- transitionMap.Clear();
- progress.IndeterminateVisualAnimation = transitionMap;
- }
-
- [Test]
- [Category("P1")]
- [Description("dali progressbar ValueChanged test, Try to change the value of the progressBar and check whether the ValueChanged event has been trrigged")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ProgressBar.ValueChanged E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void ValueChanged_CHECK_EVENT()
- {
- ProgressBar progress = new ProgressBar();
- progress.ProgressValue = 0.2f;
- bool flag = false;
- progress.ValueChanged += (obj, ee) =>
- {
- flag = true;
- };
- progress.ProgressValue = 0.4f;
- Assert.IsTrue(flag, "The ValueChanged event not been triggerred!");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test Dispose, try to dispose the ProgressBar.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ProgressBar.Dispose M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR MCST")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void Dispose_TEST()
- {
- /* TEST CODE */
- try
- {
- ProgressBar progressBar = new ProgressBar();
- progressBar.Dispose();
- }
- 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());
- }
- }
- }
-}
Assert.IsInstanceOf<PropertyValue>(proVal, "Should return PropertyValue instance.");
}
- [Test]
- [Category("P1")]
- [Description("Test GetKey. Check whether GetKey returns expected value or not.")]
- [Property("SPEC", "Tizen.NUI.PropertyMap.GetKey M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR MCST")]
- [Property("AUTHOR", "Zaijuan Sui, z6177.sui@samsung.com")]
- public void GetKey_CHECK_RETURN_VALUE()
- {
- /* TEST CODE */
- PropertyMap propertymap = new PropertyMap();
- PropertyValue propertyValue = new PropertyValue(4.0f);
- propertymap.Add("hello", propertyValue);
- PropertyKey key = propertymap.GetKeyAt(0);
- }
[Test]
[Category("P1")]
public void GetKeyAt_CHECK_RETURN_VALUE()
{
/* TEST CODE */
- PropertyMap propertymap = new PropertyMap();
- PropertyValue propertyValue = new PropertyValue(4.0f);
- propertymap.Insert("hello", propertyValue);
- var propertykey = propertymap.GetKeyAt(0);
+ var propertymap = new PropertyMap();
+ var propertyValue = new PropertyValue(4.0f);
+
+ Assert.IsNotNull(propertymap, "Should not be null");
+
+ propertymap.Add("hello", propertyValue);
+ PropertyKey key = propertymap.GetKeyAt(0);
+
+ if (key.Type == PropertyKey.KeyType.String)
+ {
+ Tizen.Log.Debug("NUI", $"GetKeyAt_CHECK_RETURN_VALUE: StringKey={key.StringKey}");
+ Assert.AreEqual("hello", key.StringKey, "values must be equal");
+ }
+ else
+ {
+ Tizen.Log.Error("NUI", $"GetKeyAt_CHECK_RETURN_VALUE: error");
+ Assert.Fail("PropertyKey Type must be String");
+ }
}
[Test]
+++ /dev/null
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System;
-using Tizen.NUI;
-using Tizen.NUI.UIComponents;
-using Tizen.NUI.Test;
-
-namespace Tizen.NUI.Tests
-{
- [TestFixture]
- [Description("Tizen.NUI.UIComponents.ScrollBar.PanFinishedEventArgs Tests")]
- public class PanFinishedEventArgsTests
- {
- private string TAG = "NUI";
-
- [SetUp]
- public void Init()
- {
- Tizen.Log.Info(TAG, "Init() is called!");
- App.MainTitleChangeText("PanFinishedEventArgsTests");
- App.MainTitleChangeBackgroundColor(null);
- }
-
- [TearDown]
- public void Destroy()
- {
- Tizen.Log.Info(TAG, "Destroy() is called!");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a PanFinishedEventArgs object. Check whether PanFinishedEventArgs is successfully created or not.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ScrollBar.PanFinishedEventArgs.PanFinishedEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Wu Youxia, youxia.wu@partner.samsung.com")]
- public void PanFinishedEventArgs_INIT()
- {
- /* TEST CODE */
- var panFinishedEventArgs = new ScrollBar.PanFinishedEventArgs();
- Assert.IsNotNull(panFinishedEventArgs, "Can't create success object PanFinishedEventArgs");
- Assert.IsInstanceOf<ScrollBar.PanFinishedEventArgs>(panFinishedEventArgs, "Should be an instance of PanFinishedEventArgs type.");
- }
- }
-}
+++ /dev/null
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System;
-using Tizen.NUI;
-using Tizen.NUI.UIComponents;
-using Tizen.NUI.Test;
-
-namespace Tizen.NUI.Tests
-{
- [TestFixture]
- [Description("Tizen.NUI.UIComponents.ScrollBar.ScrollIntervalEventArgs Tests")]
- public class ScrollIntervalEventArgsTests
- {
- private string TAG = "NUI";
-
- [SetUp]
- public void Init()
- {
- Tizen.Log.Info(TAG, "Init() is called!");
- App.MainTitleChangeText("ScrollIntervalEventArgsTests");
- App.MainTitleChangeBackgroundColor(null);
- }
-
- [TearDown]
- public void Destroy()
- {
- Tizen.Log.Info(TAG, "Destroy() is called!");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ScrollIntervalEventArgs object. Check whether ScrollIntervalEventArgs is successfully created or not.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ScrollBar.ScrollIntervalEventArgs.ScrollIntervalEventArgs C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("AUTHOR", "Wu Youxia, youxia.wu@partner.samsung.com")]
- public void ScrollIntervalEventArgs_INIT()
- {
- /* TEST CODE */
- var scrollIntervalEventArgs = new ScrollBar.ScrollIntervalEventArgs();
- Assert.IsNotNull(scrollIntervalEventArgs, "Can't create success object ScrollIntervalEventArgs");
- Assert.IsInstanceOf<ScrollBar.ScrollIntervalEventArgs>(scrollIntervalEventArgs, "Should be an instance of ScrollIntervalEventArgs type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test CurrentScrollPosition. Check whether CurrentScrollPosition is readable and writable.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ScrollBar.ScrollIntervalEventArgs.CurrentScrollPosition A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA","PRW")]
- [Property("AUTHOR", "Wu Youxia, youxia.wu@partner.samsung.com")]
- public void CurrentScrollPosition_SET_GET_VALUE()
- {
- /* TEST CODE */
- ScrollBar.ScrollIntervalEventArgs scrollIntervalEventArgs = new ScrollBar.ScrollIntervalEventArgs();
- scrollIntervalEventArgs.CurrentScrollPosition = 1.0f;
- Assert.AreEqual(1.0f, scrollIntervalEventArgs.CurrentScrollPosition, "Retrieved CurrentScrollPosition should be equal to set value");
- }
- }
-}
+++ /dev/null
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using System;
-using Tizen.NUI;
-using Tizen.NUI.BaseComponents;
-using Tizen.NUI.UIComponents;
-using Tizen.NUI.Test;
-using System.Threading.Tasks;
-
-namespace Tizen.NUI.Tests
-{
- [TestFixture]
- [Description("Tizen.NUI.UIComponents.ScrollBar Tests")]
- public class ScrollBarTests
- {
- private string TAG = "NUI";
- private bool _flagScrollInterval;
-
- private void OnScrollInterval(object sender, EventArgs e)
- {
- _flagScrollInterval = true;
- }
-
- [SetUp]
- public void Init()
- {
- Tizen.Log.Info(TAG, "Init() is called!");
- App.MainTitleChangeText("ScrollBarTests");
- App.MainTitleChangeBackgroundColor(null);
- }
-
- [TearDown]
- public void Destroy()
- {
- Tizen.Log.Info(TAG, "Destroy() is called!");
- }\r
-
- [Test]
- [Category("P1")]
- [Description("Create a ScrollBar object. Check whether object is successfully created or not.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ScrollBar.ScrollBar C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("COVPARAM", "")]
- [Property("AUTHOR", "Wu Youxia, youxia.wu@partner.samsung.com")]
- public void ScrollBar_INIT()
- {
- /* TEST CODE */
- var scrollBar = new ScrollBar();
- Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar");
- Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar type.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Create a ScrollBar object. Check whether ScrollBar object which set direction is successfully created or not.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ScrollBar.ScrollBar C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("COVPARAM", "Direction")]
- [Property("AUTHOR", "Wu Youxia, youxia.wu@partner.samsung.com")]
- public void ScrollBar_INIT_WITH_DIRECTION()
- {
- /* TEST CODE */
- var scrollBar = new ScrollBar(ScrollBar.Direction.Horizontal);
- Assert.IsNotNull(scrollBar, "Can't create success object ScrollBar");
- Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar type.");
- Assert.AreEqual(ScrollBar.Direction.Horizontal, scrollBar.ScrollDirection, "Should be equals to the set value of ScrollDirection.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test ScrollDirection.Check whether ScrollDirection is readable ahd writeable.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ScrollBar.ScrollDirection A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Wu Youxia, youxia.wu@partner.samsung.com")]
- public void ScrollDirection_SET_GET_VALUE()
- {
- /* TEST CODE */
- ScrollBar scrollBar = new ScrollBar();
- scrollBar.ScrollDirection = ScrollBar.Direction.Vertical;
- Assert.AreEqual(ScrollBar.Direction.Vertical, scrollBar.ScrollDirection, "Should be equals to the set value of ScrollDirection.");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test IndicatorHeightPolicy.Check whether IndicatorHeightPolicy is readable ahd writeable.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ScrollBar.IndicatorHeightPolicy A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Wu Youxia, youxia.wu@partner.samsung.com")]
- public void IndicatorHeightPolicy_SET_GET_VALUE()
- {
- /* TEST CODE */
- ScrollBar scrollBar = new ScrollBar();
- scrollBar.IndicatorHeightPolicy = ScrollBar.IndicatorHeightPolicyType.Fixed;
- Assert.AreEqual(ScrollBar.IndicatorHeightPolicyType.Fixed, scrollBar.IndicatorHeightPolicy, "Should be equals to the set value of IndicatorHeightPolicy");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test IndicatorFixedHeight.Check whether IndicatorFixedHeight is readable ahd writeable.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ScrollBar.IndicatorFixedHeight A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Wu Youxia, youxia.wu@partner.samsung.com")]
- public void IndicatorFixedHeight_SET_GET_VALUE()
- {
- /* TEST CODE */
- ScrollBar scrollBar = new ScrollBar();
- scrollBar.IndicatorFixedHeight = 1.0f;
- Assert.AreEqual(1.0f, scrollBar.IndicatorFixedHeight, "Should be equals to the set value of IndicatorFixedHeight");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test IndicatorShowDuration.Check whether IndicatorShowDuration is readable ahd writeable.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ScrollBar.IndicatorShowDuration A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Wu Youxia, youxia.wu@partner.samsung.com")]
- public void IndicatorShowDuration_SET_GET_VALUE()
- {
- /* TEST CODE */
- ScrollBar scrollBar = new ScrollBar();
- scrollBar.IndicatorShowDuration = 1.0f;
- Assert.AreEqual(1.0f, scrollBar.IndicatorShowDuration, "Should be equals to the set value of IndicatorShowDuration");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test IndicatorHideDuration.Check whether IndicatorHideDuration is readable ahd writeable.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ScrollBar.IndicatorHideDuration A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Wu Youxia, youxia.wu@partner.samsung.com")]
- public void IndicatorHideDuration_SET_GET_VALUE()
- {
- /* TEST CODE */
- ScrollBar scrollBar = new ScrollBar();
- scrollBar.IndicatorHideDuration = 1.0f;
- Assert.AreEqual(1.0f, scrollBar.IndicatorHideDuration, "Should be equals to the set value of IndicatorHideDuration");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test ScrollPositionIntervals.Check whether ScrollPositionIntervals is readable ahd writeable.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ScrollBar.ScrollPositionIntervals A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Wu Youxia, youxia.wu@partner.samsung.com")]
- public void ScrollPositionIntervals_SET_GET_VALUE()
- {
- /* TEST CODE */
- ScrollBar scrollBar = new ScrollBar(ScrollBar.Direction.Vertical);
- Window.Instance.GetDefaultLayer().Add(scrollBar);
- PropertyArray array = new PropertyArray();
- for (uint i = 0; i < 10; i++)
- {
- array.Add(new PropertyValue(-80.0f * i));
- }
- scrollBar.ScrollPositionIntervals = array;
- }
-
- [Test]
- [Category("P1")]
- [Description("Test IndicatorMinimumHeight.Check whether IndicatorMinimumHeight is readable ahd writeable.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ScrollBar.IndicatorMinimumHeight A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Wu Youxia, youxia.wu@partner.samsung.com")]
- public void IndicatorMinimumHeight_SET_GET_VALUE()
- {
- /* TEST CODE */
- ScrollBar scrollBar = new ScrollBar();
- scrollBar.IndicatorMinimumHeight = 1.0f;
- Assert.AreEqual(1.0f, scrollBar.IndicatorMinimumHeight, "Should be equals to the set value of IndicatorMinimumHeight");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test IndicatorStartPadding.Check whether IndicatorStartPadding is readable ahd writeable.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ScrollBar.IndicatorStartPadding A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Wu Youxia, youxia.wu@partner.samsung.com")]
- public void IndicatorStartPadding_SET_GET_VALUE()
- {
- /* TEST CODE */
- ScrollBar scrollBar = new ScrollBar();
- scrollBar.IndicatorStartPadding = 1.0f;
- Assert.AreEqual(1.0f, scrollBar.IndicatorStartPadding, "Should be equals to the set value of IndicatorStartPadding");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test IndicatorEndPadding.Check whether IndicatorEndPadding is readable ahd writeable.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ScrollBar.IndicatorEndPadding A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRW")]
- [Property("AUTHOR", "Wu Youxia, youxia.wu@partner.samsung.com")]
- public void IndicatorEndPadding_SET_GET_VALUE()
- {
- /* TEST CODE */
- ScrollBar scrollBar = new ScrollBar();
- scrollBar.IndicatorEndPadding = 1.0f;
- Assert.AreEqual(1.0f, scrollBar.IndicatorEndPadding, "Should be equals to the set value of IndicatorEndPadding");
- }
-
- [Test]
- [Category("P1")]
- [Description("Test Dispose, try to dispose the ScrollBar.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ScrollBar.Dispose M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR MCST")]
- [Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")]
- public void Dispose_CHECK_RETURN_TYPE()
- {
- /* TEST CODE */
- try
- {
- ScrollBar scrollBar = new ScrollBar();
- scrollBar.Dispose();
- }
- 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 ScrollInterval. Test whether the ScrollInterval event will be triggered.")]
- [Property("SPEC", "Tizen.NUI.UIComponents.ScrollBar.ScrollInterval E")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "EVL")]
- [Property("AUTHOR", "Xianbing teng, xb.teng@samsung.com")]
- public async Task ScrollInterval_CHECK_EVENT()
- {
- /*TEST CODE*/
- var scrollBar = new ScrollBar();
- Assert.IsInstanceOf<ScrollBar>(scrollBar, "Should be an instance of ScrollBar type.");
- Window.Instance.Add(scrollBar);
- View sourceView = new View();
- Assert.IsInstanceOf<View>(sourceView, "Should be an instance of View type.");
- Window.Instance.Add(sourceView);
- try\r
- {\r
- _flagScrollInterval = false;\r
- Assert.False(_flagScrollInterval, "_flagScrollInterval should false initial");\r
- scrollBar.ScrollInterval += OnScrollInterval;\r
- int propertyScrollPosition = sourceView.RegisterProperty("sourcePosition", new PropertyValue(0.0f));\r
- int propertyMinScrollPosition = sourceView.RegisterProperty("sourcePositionMin", new PropertyValue(0.0f));\r
- int propertyMaxScrollPosition = sourceView.RegisterProperty("sourcePositionMax", new PropertyValue(800.0f));\r
- int propertyScrollContentSize = sourceView.RegisterProperty("sourceContentSize", new PropertyValue(2000.0f));\r
- scrollBar.SetScrollPropertySource(sourceView, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);\r
- PropertyArray positionIntervals = new PropertyArray();\r
- for (int i = 0; i != 10; ++i)\r
- {\r
- positionIntervals.PushBack(new PropertyValue(-80.0f * i)); // should get notified for each 80 pixels\r
- }\r
- scrollBar.ScrollPositionIntervals = (positionIntervals);\r
- Animation animation = new Animation(100);\r
- animation.AnimateTo(sourceView, "sourcePosition", -170.0f);\r
- animation.Play();\r
-\r
- await Task.Delay(110);\r
- Assert.True(_flagScrollInterval, "_flagScrollInterval should be true.");
- }
- catch (Exception e)
- {\r
- Tizen.Log.Error(TAG, "Caught Exception" + e.ToString());\r
- LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());\r
- Assert.Fail("Caught Exception" + e.ToString());\r
- }
- finally
- {\r
- scrollBar.ScrollInterval -= OnScrollInterval;\r
- Window.Instance.Remove(scrollBar);\r
- Window.Instance.Remove(sourceView);\r
- }
- }
- }
-}
{
private string TAG = "NUI";
private string _videoPath = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "demoVideo.mp4";
- private bool _flagOnFinished;\r
+ private bool _flagOnFinished;
private VideoView _videoView;
private void OnFinished(object obj, VideoView.FinishedEventArgs args)
Tizen.Log.Info(TAG, "Destroy() is called!");
_videoView.Dispose();
_videoView = null;
- }\r
+ }
[Test]
[Category("P1")]
[Property("AUTHOR", "Zaijuan Sui, z6177.sui@samsung.com")]
[Property("COVPARAM", "")]
public void VideoView_INIT_WITH_NULL()
- {\r
- /* TEST CODE */\r
+ {
+ /* TEST CODE */
Assert.IsNotNull(_videoView, "_videoView is null.");
Assert.IsInstanceOf<VideoView>(_videoView, "Should return VideoView instance.");
}
public void VideoView_INIT_WITH_URL()
{
/* TEST CODE */
- var videoView = new VideoView("DALI");\r
+ var videoView = new VideoView("DALI");
Assert.IsNotNull(videoView, "videoView is null.");
Assert.IsInstanceOf<VideoView>(videoView, "Should return VideoView instance.");
videoView.Dispose();
}
else
{
- Tizen.Log.Error(TAG, "Error checking if raw_video is supported(systeminfo)");\r
+ Tizen.Log.Error(TAG, "Error checking if raw_video is supported(systeminfo)");
}
}
{
/* TEST CODE */
PropertyMap propertyMap = new PropertyMap();
- propertyMap.Add("volumeLeft", new PropertyValue(0.0f));
- propertyMap.Add("volumeRight", new PropertyValue(5.0f));
+ propertyMap.Add("volumeLeft", new PropertyValue(0.3f));
+ // left/right volumes can not be different
+ propertyMap.Add("volumeRight", new PropertyValue(0.3f));
_videoView.Volume = propertyMap;
- float left = 0.0f;
- float right = 0.0f;
+ float left;
+ float right;
_videoView.Volume.Find(0, "volumeLeft").Get(out left);
_videoView.Volume.Find(1, "volumeRight").Get(out right);
+
+ Tizen.Log.Debug("NUI", $"Volume_SET_GET_VALUE: left={left}");
+ Tizen.Log.Debug("NUI", $"Volume_SET_GET_VALUE: right={right}");
+
+ Assert.AreEqual(0.3f, left, "values must be equal");
+ Assert.AreEqual(0.3f, right, "values must be equal");
}
[Test]
[Property("AUTHOR", "Xianbing Teng, xb.teng@samsung.com")]
public async Task Finished_CHECK_EVENT()
{
- /* TEST CODE */\r
- _videoView.ResourceUrl = _videoPath;\r
+ /* TEST CODE */
+ _videoView.ResourceUrl = _videoPath;
Assert.IsInstanceOf<VideoView>(_videoView, "Should be an instance of VideoView type.");
try
{
- _flagOnFinished = false;\r
+ _flagOnFinished = false;
Assert.False(_flagOnFinished, "_flagOnFinished should false initial");
- _videoView.Finished += OnFinished;\r
+ _videoView.Finished += OnFinished;
_videoView.Play();
await Task.Delay(1000);
Assert.True(_flagOnFinished, "_flagOnFinished should be true after Finished triggered");
Assert.Fail("Caught Exception" + e.ToString());
}
finally
- {\r
- _videoView.Finished -= OnFinished;\r
+ {
+ _videoView.Finished -= OnFinished;
}
}
}