--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using System.Collections.Generic;
+
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Utility/Capture")]
+ class PublicCaptureTest
+ {
+ private const string tag = "NUITEST";
+ private string path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
+ private string jpg_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "arrow.jpg";
+
+ private delegate bool dummyCallback(IntPtr captureSignal);
+ private bool OnDummyCallback(IntPtr data)
+ {
+ return false;
+ }
+
+
+ internal class MyCapture : Capture
+ {
+ public MyCapture() : base()
+ { }
+
+ public void OnDispose(DisposeTypes type)
+ {
+ base.Dispose(type);
+ }
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Capture constructor.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Capture C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureConstructor()
+ {
+ tlog.Debug(tag, $"CaptureConstructor START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CaptureConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Capture Dispose.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Dispose M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureDispose()
+ {
+ tlog.Debug(tag, $"CaptureDispose START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ try
+ {
+ testingTarget.Dispose();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ /** disposed is true */
+ try
+ {
+ testingTarget.Dispose();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"CaptureDispose END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Capture SetImageQuality.")]
+ [Property("SPEC", "Tizen.NUI.Capture.SetImageQuality M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureSetImageQuality()
+ {
+ tlog.Debug(tag, $"CaptureSetImageQuality START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ try
+ {
+ testingTarget.SetImageQuality(30);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CaptureSetImageQuality END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Capture SetImageQuality. With invalid operation.")]
+ [Property("SPEC", "Tizen.NUI.Capture.SetImageQuality M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureSetImageQualityWithInvalidOperation()
+ {
+ tlog.Debug(tag, $"CaptureSetImageQualityWithInvalidOperation START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ try
+ {
+ testingTarget.SetImageQuality(120);
+ }
+ catch (InvalidOperationException)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CaptureSetImageQualityWithInvalidOperation END (OK)");
+ Assert.Pass("Caught InvalidOperationException: Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Capture Dispose. Capture is disposed.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Dispose M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureDisposeWithDisposedInstance()
+ {
+ tlog.Debug(tag, $"CaptureDisposeWithDisposedInstance START");
+
+ var testingTarget = new MyCapture();
+ Assert.IsNotNull(testingTarget, "Can't create success object MyCapture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of MyCapture type.");
+
+ testingTarget.OnDispose(DisposeTypes.Explicit);
+
+ try
+ {
+ testingTarget.OnDispose(DisposeTypes.Explicit);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"CaptureDisposeWithDisposedInstance END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Capture Start.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureStart()
+ {
+ tlog.Debug(tag, $"CaptureStart START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ using (Container container = new View())
+ {
+ using (Size size = new Size(100, 80))
+ {
+ try
+ {
+ testingTarget.Start(container, size, path);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+ }
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CaptureStart END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Capture Start. Size is null.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureStartWithNullSize()
+ {
+ tlog.Debug(tag, $"CaptureStartWithNullSize START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ using (Container container = new View())
+ {
+ try
+ {
+ testingTarget.Start(container, null, path);
+ }
+ catch (ArgumentNullException e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"CaptureStartWithNullSize END (OK)");
+ Assert.Pass("Caught ArgumentNullException: Passed!");
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Capture Start. Size is invalid.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureStartWithInvalidSize()
+ {
+ tlog.Debug(tag, $"CaptureStartWithInvalidSize START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ using (Container container = new View())
+ {
+ using (Size size = new Size(0, 0))
+ {
+ try
+ {
+ testingTarget.Start(container, size, path);
+ }
+ catch (InvalidOperationException e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"CaptureStartWithInvalidSize END (OK)");
+ Assert.Pass("Caught InvalidOperationException: Passed!");
+ }
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Capture Start. path is null.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureStartWithNullPath()
+ {
+ tlog.Debug(tag, $"CaptureStartWithNullPath START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ using (Container container = new View())
+ {
+ using (Size size = new Size(100, 80))
+ {
+ try
+ {
+ testingTarget.Start(container, size, null);
+ }
+ catch (ArgumentNullException e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"CaptureStartWithNullPath END (OK)");
+ Assert.Pass("Caught ArgumentNullException: Passed!");
+ }
+ }
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Capture Start include Color.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureStartIncludeColor()
+ {
+ tlog.Debug(tag, $"CaptureStartIncludeColor START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ using (Container container = new View())
+ {
+ using (Size size = new Size(100, 80))
+ {
+ using (Color color = Color.Cyan)
+ {
+ try
+ {
+ testingTarget.Start(container, size, path, color);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+ }
+ }
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CaptureStartIncludeColor END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Capture Start include Color. Color is null.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureStartIncludeColorWithNullColor()
+ {
+ tlog.Debug(tag, $"CaptureStartIncludeColorWithNullColor START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ using (Container container = new View())
+ {
+ using (Size size = new Size(100, 80))
+ {
+ try
+ {
+ testingTarget.Start(container, size, path, null);
+ }
+ catch (ArgumentNullException e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"CaptureStartIncludeColorWithNullColor END (OK)");
+ Assert.Pass("Caught ArgumentNullException: Passed!");
+ }
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Capture Start include color. Size is null.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureStartIncludeColorWithNullSize()
+ {
+ tlog.Debug(tag, $"CaptureStartIncludeColorWithNullSize START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ using (Container container = new View())
+ {
+ using (Color color = Color.Cyan)
+ {
+ try
+ {
+ testingTarget.Start(container, null, path, color);
+ }
+ catch (ArgumentNullException e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"CaptureStartIncludeColorWithNullSize END (OK)");
+ Assert.Pass("Caught ArgumentNullException: Passed!");
+ }
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Capture Start include color. Path is null.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureStartIncludeColorWithNullPath()
+ {
+ tlog.Debug(tag, $"CaptureStartIncludeColorWithNullPath START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ using (Container container = new View())
+ {
+ using (Size size = new Size(100, 80))
+ {
+ using (Color color = Color.Cyan)
+ {
+ try
+ {
+ testingTarget.Start(container, size, null, color);
+ }
+ catch (ArgumentNullException e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"CaptureStartIncludeColorWithNullPath END (OK)");
+ Assert.Pass("Caught ArgumentNullException: Passed!");
+ }
+ }
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Capture Start include color. Size is invalid.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureStartIncludeColorWithInvalidSize()
+ {
+ tlog.Debug(tag, $"CaptureStartIncludeColorWithInvalidSize START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ using (Container container = new View())
+ {
+ using (Size size = new Size(0, 0))
+ {
+ using (Color color = Color.Cyan)
+ {
+ try
+ {
+ testingTarget.Start(container, size, path, color);
+ }
+ catch (InvalidOperationException e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"CaptureStartIncludeColorWithInvalidSize END (OK)");
+ Assert.Pass("Caught InvalidOperationException: Passed!");
+ }
+ }
+ }
+ }
+ }
+
+ //[Test]
+ //[Category("P1")]
+ //[Description("Capture Start include quality.")]
+ //[Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ //[Property("SPEC_URL", "-")]
+ //[Property("CRITERIA", "MR")]
+ //[Property("AUTHOR", "guowei.wang@samsung.com")]
+ //public void CaptureStartIncludeQuality()
+ //{
+ // tlog.Debug(tag, $"CaptureStartIncludeQuality START");
+
+ // var testingTarget = new Capture();
+ // Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ // Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ // using (Container container = new View())
+ // {
+ // using (Size size = new Size(100, 80))
+ // {
+ // using (Color color = Color.Cyan)
+ // {
+ // try
+ // {
+ // testingTarget.Start(container, size, jpg_path, color, 30);
+ // }
+ // catch (Exception e)
+ // {
+ // tlog.Debug(tag, e.Message.ToString());
+ // Assert.Fail("Caught Exception: Failed!");
+ // }
+ // }
+ // }
+ // }
+
+ // testingTarget.Dispose();
+ // tlog.Debug(tag, $"CaptureStartIncludeQuality END (OK)");
+ //}
+
+ [Test]
+ [Category("P2")]
+ [Description("Capture Start include quality. Color is null.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureStartIncludeQualityWithNullColor()
+ {
+ tlog.Debug(tag, $"CaptureStartIncludeQualityWithNullColor START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ using (Container container = new View())
+ {
+ using (Size size = new Size(100, 80))
+ {
+ try
+ {
+ testingTarget.Start(container, size, jpg_path, null, 30);
+ }
+ catch (ArgumentNullException e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"CaptureStartIncludeQualityWithNullColor END (OK)");
+ Assert.Pass("Caught ArgumentNullException: Passed!");
+ }
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Capture Start include quality. Size is null.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureStartIncludeQualityWithNullSize()
+ {
+ tlog.Debug(tag, $"CaptureStartIncludeQualityWithNullSize START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ using (Container container = new View())
+ {
+ using (Color color = Color.Cyan)
+ {
+ try
+ {
+ testingTarget.Start(container, null, jpg_path, color, 30);
+ }
+ catch (ArgumentNullException e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"CaptureStartIncludeQualityWithNullSize END (OK)");
+ Assert.Pass("Caught ArgumentNullException: Passed!");
+ }
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Capture Start include quality. Path is null.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureStartIncludeQualityWithNullPath()
+ {
+ tlog.Debug(tag, $"CaptureStartIncludeQualityWithNullPath START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ using (Container container = new View())
+ {
+ using (Size size = new Size(100, 80))
+ {
+ using (Color color = Color.Cyan)
+ {
+ try
+ {
+ testingTarget.Start(container, size, null, color, 30);
+ }
+ catch (ArgumentNullException e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"CaptureStartIncludeQualityWithNullPath END (OK)");
+ Assert.Pass("Caught ArgumentNullException: Passed!");
+ }
+ }
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Capture Start include quality. Quality is invalid.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureStartIncludeQualityWithInvalidQuality()
+ {
+ tlog.Debug(tag, $"CaptureStartIncludeQualityWithInvalidQuality START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ using (Container container = new View())
+ {
+ using (Size size = new Size(100, 80))
+ {
+ using (Color color = Color.Cyan)
+ {
+ try
+ {
+ testingTarget.Start(container, size, jpg_path, color, 130);
+ }
+ catch (InvalidOperationException e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"CaptureStartIncludeQualityWithInvalidQuality END (OK)");
+ Assert.Pass("Caught InvalidOperationException: Passed!");
+ }
+ }
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Capture Start include quality. Size is invalid.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureStartIncludeQualityWithInvalidSize()
+ {
+ tlog.Debug(tag, $"CaptureStartIncludeQualityWithInvalidSize START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ using (Container container = new View())
+ {
+ using (Size size = new Size(0, 0))
+ {
+ using (Color color = Color.Cyan)
+ {
+ try
+ {
+ testingTarget.Start(container, size, path, color, 30);
+ }
+ catch (InvalidOperationException e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"CaptureStartIncludeQualityWithInvalidSize END (OK)");
+ Assert.Pass("Caught InvalidOperationException: Passed!");
+ }
+ }
+ }
+ }
+ }
+
+ //[Test]
+ //[Category("P1")]
+ //[Description("Capture Start include position.")]
+ //[Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ //[Property("SPEC_URL", "-")]
+ //[Property("CRITERIA", "MR")]
+ //[Property("AUTHOR", "guowei.wang@samsung.com")]
+ //public void CaptureStartIncludePosition()
+ //{
+ // tlog.Debug(tag, $"CaptureStartIncludePosition START");
+
+ // var testingTarget = new Capture();
+ // Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ // Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ // using (Container container = new View())
+ // {
+ // using (Position position = new Position(50, 100))
+ // {
+ // using (Size size = new Size(100, 80))
+ // {
+ // using (Color color = Color.Cyan)
+ // {
+ // try
+ // {
+ // testingTarget.Start(container, position, size, path, color);
+ // }
+ // catch (Exception e)
+ // {
+ // tlog.Debug(tag, e.Message.ToString());
+ // Assert.Fail("Caught Exception: Failed!");
+ // }
+ // }
+ // }
+ // }
+ // }
+
+ // testingTarget.Dispose();
+ // tlog.Debug(tag, $"CaptureStartIncludePosition END (OK)");
+ //}
+
+ [Test]
+ [Category("P2")]
+ [Description("Capture Start include position. Position is null.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureStartIncludePositionWithNullPosition()
+ {
+ tlog.Debug(tag, $"CaptureStartIncludePositionWithNullPosition START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ using (Container container = new View())
+ {
+ using (Size size = new Size(100, 80))
+ {
+ using (Color color = Color.Cyan)
+ {
+ try
+ {
+ testingTarget.Start(container, null, size, path, color);
+ }
+ catch (ArgumentNullException e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"CaptureStartIncludePositionWithNullPosition END (OK)");
+ Assert.Pass("Caught ArgumentNullException: Passed!");
+ }
+ }
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Capture Start include position. Size is null.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureStartIncludePositionWithNullSize()
+ {
+ tlog.Debug(tag, $"CaptureStartIncludePositionWithNullSize START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ using (Container container = new View())
+ {
+ using (Position position = new Position(100, 80))
+ {
+ using (Color color = Color.Cyan)
+ {
+ try
+ {
+ testingTarget.Start(container, position, null, path, color);
+ }
+ catch (ArgumentNullException e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"CaptureStartIncludePositionWithNullSize END (OK)");
+ Assert.Pass("Caught ArgumentNullException: Passed!");
+ }
+ }
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Capture Start include position. Color is null.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureStartIncludePositionWithNullColor()
+ {
+ tlog.Debug(tag, $"CaptureStartIncludePositionWithNullColor START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ using (Container container = new View())
+ {
+ using (Position position = new Position(50, 100))
+ {
+ using (Size size = new Size(100, 80))
+ {
+ try
+ {
+ testingTarget.Start(container, position, size, path, null);
+ }
+ catch (ArgumentNullException e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"CaptureStartIncludePositionWithNullColor END (OK)");
+ Assert.Pass("Caught ArgumentNullException: Passed!");
+ }
+ }
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Capture Start include position. Color is null.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureStartIncludePositionWithNullPath()
+ {
+ tlog.Debug(tag, $"CaptureStartIncludePositionWithNullPath START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ using (Container container = new View())
+ {
+ using (Position position = new Position(50, 100))
+ {
+ using (Size size = new Size(100, 80))
+ {
+ using (Color color = Color.Cyan)
+ {
+ try
+ {
+ testingTarget.Start(container, position, size, null, color);
+ }
+ catch (ArgumentNullException e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"CaptureStartIncludePositionWithNullPath END (OK)");
+ Assert.Pass("Caught ArgumentNullException: Passed!");
+ }
+ }
+ }
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Capture Start include position. Size is invalid.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureStartIncludePositionWithInvalidSize()
+ {
+ tlog.Debug(tag, $"CaptureStartIncludePositionWithInvalidSize START");
+
+ var testingTarget = new Capture();
+ Assert.IsNotNull(testingTarget, "Can't create success object Capture");
+ Assert.IsInstanceOf<Capture>(testingTarget, "Should be an instance of Capture type.");
+
+ using (Container container = new View())
+ {
+ using (Position position = new Position(50, 100))
+ {
+ using (Size size = new Size(0, 0))
+ {
+ using (Color color = Color.Cyan)
+ {
+ try
+ {
+ testingTarget.Start(container, position, size, path, color);
+ }
+ catch (InvalidOperationException e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"CaptureStartIncludePositionWithInvalidSize END (OK)");
+ Assert.Pass("Caught InvalidOperationException: Passed!");
+ }
+ }
+ }
+ }
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Capture Finished.")]
+ [Property("SPEC", "Tizen.NUI.Capture.Finished M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureFinished()
+ {
+ tlog.Debug(tag, $"CaptureFinished START");
+
+ var testingTarget = new MyCapture();
+ Assert.IsNotNull(testingTarget, "Can't create success object MyCapture");
+ Assert.IsInstanceOf<MyCapture>(testingTarget, "Should be an instance of MyCapture type.");
+
+ testingTarget.Finished += OnFinishedEvent;
+ testingTarget.Finished -= OnFinishedEvent;
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CaptureFinished END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Capture GetNativeImageSource.")]
+ [Property("SPEC", "Tizen.NUI.Capture.GetNativeImageSource M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureGetNativeImageSource()
+ {
+ tlog.Debug(tag, $"CaptureGetNativeImageSource START");
+
+ var testingTarget = new MyCapture();
+ Assert.IsNotNull(testingTarget, "Can't create success object MyCapture");
+ Assert.IsInstanceOf<MyCapture>(testingTarget, "Should be an instance of MyCapture type.");
+
+ var result = testingTarget.GetNativeImageSource();
+ Assert.IsNotNull(result, "Can't create success object NativeImageSource ");
+ Assert.IsInstanceOf<NativeImageSource>(result, "Should be an instance of NativeImageSource type.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CaptureGetNativeImageSource END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Capture.CaptureFinishedEventArgs Success.")]
+ [Property("SPEC", "Tizen.NUI.Capture.CaptureFinishedEventArgs.Success A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureCaptureFinishedEventArgsSuccess()
+ {
+ tlog.Debug(tag, $"CaptureCaptureFinishedEventArgsSuccess START");
+
+ var testingTarget = new CaptureFinishedEventArgs();
+ Assert.IsNotNull(testingTarget, "Can't create success object CaptureFinishedEventArgs");
+ Assert.IsInstanceOf<CaptureFinishedEventArgs>(testingTarget, "Should be an instance of CaptureFinishedEventArgs type.");
+
+ Assert.AreEqual(false, testingTarget.Success, "Should be equal!");
+
+ testingTarget.Success = true;
+ Assert.AreEqual(true, testingTarget.Success, "Should be equal!");
+
+ tlog.Debug(tag, $"CaptureCaptureFinishedEventArgsSuccess END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Capture.CaptureSignal constructor.")]
+ [Property("SPEC", "Tizen.NUI.Capture.CaptureSignal.CaptureSignal M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureCaptureSignalConstructor()
+ {
+ tlog.Debug(tag, $"CaptureCaptureSignalConstructor START");
+
+ using (Capture capture = new Capture())
+ {
+ var testingTarget = new CaptureSignal(capture.SwigCPtr.Handle, true);
+ Assert.IsNotNull(testingTarget, "Can't create success object CaptureSignal");
+ Assert.IsInstanceOf<CaptureSignal>(testingTarget, "Should be an instance of CaptureSignal type.");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"CaptureCaptureSignalConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Capture.CaptureSignal Empty.")]
+ [Property("SPEC", "Tizen.NUI.Capture.CaptureSignal.Empty M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureCaptureSignalEmpty()
+ {
+ tlog.Debug(tag, $"CaptureCaptureSignalEmpty START");
+
+ using (Capture capture = new Capture())
+ {
+ var testingTarget = new CaptureSignal(capture.SwigCPtr.Handle, true);
+ Assert.IsNotNull(testingTarget, "Can't create success object CaptureSignal");
+ Assert.IsInstanceOf<CaptureSignal>(testingTarget, "Should be an instance of CaptureSignal type.");
+
+ var result = testingTarget.Empty();
+ Assert.IsTrue(result);
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"CaptureCaptureSignalEmpty END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Capture.CaptureSignal GetConnectionCount.")]
+ [Property("SPEC", "Tizen.NUI.Capture.CaptureSignal.GetConnectionCount M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureCaptureSignalGetConnectionCount()
+ {
+ tlog.Debug(tag, $"CaptureCaptureSignalGetConnectionCount START");
+
+ using (Capture capture = new Capture())
+ {
+ var testingTarget = new CaptureSignal(capture.SwigCPtr.Handle, true);
+ Assert.IsNotNull(testingTarget, "Can't create success object CaptureSignal");
+ Assert.IsInstanceOf<CaptureSignal>(testingTarget, "Should be an instance of CaptureSignal type.");
+
+ var result = testingTarget.GetConnectionCount();
+ Assert.AreEqual(0, result, "Should be equal!");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"CaptureCaptureSignalGetConnectionCount END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Capture.CaptureSignal Emit.")]
+ [Property("SPEC", "Tizen.NUI.Capture.CaptureSignal.Emit M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CaptureCaptureSignalEmit()
+ {
+ tlog.Debug(tag, $"CaptureCaptureSignalEmit START");
+
+ var currentPid = global::System.Diagnostics.Process.GetCurrentProcess().Id;
+ var currentTid = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
+
+ tlog.Debug(tag, $"thread check! main pid={App.mainPid}, current pid={currentPid}, main tid={App.mainTid}, current tid={currentTid}");
+
+ using (Capture capture = new Capture())
+ {
+ var testingTarget = new CaptureSignal(capture.SwigCPtr.Handle, true);
+ Assert.IsNotNull(testingTarget, "Can't create success object CaptureSignal");
+ Assert.IsInstanceOf<CaptureSignal>(testingTarget, "Should be an instance of CaptureSignal type.");
+
+ testingTarget.Emit(capture, true);
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"CaptureCaptureSignalEmit END (OK)");
+ }
+
+ private void OnFinishedEvent(object sender, CaptureFinishedEventArgs e)
+ {
+ // Do not implementation
+ }
+ }
+}
--- /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;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Utility/CubeTransitionEffect")]
+ class PublicCubeTransitionEffectTest
+ {
+ private const string tag = "NUITEST";
+ private string currentpath = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
+ private string targetpath = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
+
+ private bool OnTransitionCompletedFlag = false;
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CubeTransitionEffect SetTransitionDuration / GetTransitionDuration.")]
+ [Property("SPEC", "Tizen.NUI.CubeTransitionEffect.SetTransitionDuration / GetTransitionDuration M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CubeTransitionEffectTransitionDuration()
+ {
+ tlog.Debug(tag, $"CubeTransitionEffectTransitionDuration START");
+
+ var testingTarget = new CubeTransitionWaveEffect(20, 10);
+ Assert.IsNotNull(testingTarget, "Can't create success object CubeTransitionEffect");
+ Assert.IsInstanceOf<CubeTransitionEffect>(testingTarget, "Should be an instance of CubeTransitionEffect type.");
+
+ testingTarget.SetTransitionDuration(1.5f);
+
+ var result = testingTarget.GetTransitionDuration();
+ Assert.AreEqual(1.5f, result, "Should be equal!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CubeTransitionEffectTransitionDuration END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CubeTransitionEffect SetCubeDisplacement / GetCubeDisplacement.")]
+ [Property("SPEC", "Tizen.NUI.CubeTransitionEffect.SetCubeDisplacement / GetCubeDisplacement M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CubeTransitionEffectCubeDisplacement()
+ {
+ tlog.Debug(tag, $"CubeTransitionEffectCubeDisplacement START");
+
+ var testingTarget = new CubeTransitionWaveEffect(20, 10);
+ Assert.IsNotNull(testingTarget, "Can't create success object CubeTransitionEffect");
+ Assert.IsInstanceOf<CubeTransitionEffect>(testingTarget, "Should be an instance of CubeTransitionEffect type.");
+
+ testingTarget.SetCubeDisplacement(70.0f);
+
+ var result = testingTarget.GetCubeDisplacement();
+ Assert.AreEqual(70.0f, result, "Should be equal!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CubeTransitionEffectCubeDisplacement END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CubeTransitionEffect IsTransitioning.")]
+ [Property("SPEC", "Tizen.NUI.CubeTransitionEffect.IsTransitioning M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CubeTransitionEffectIsTransitioning()
+ {
+ tlog.Debug(tag, $"CubeTransitionEffectIsTransitioning START");
+
+ var testingTarget = new CubeTransitionWaveEffect(20, 10);
+ Assert.IsNotNull(testingTarget, "Can't create success object CubeTransitionEffect");
+ Assert.IsInstanceOf<CubeTransitionEffect>(testingTarget, "Should be an instance of CubeTransitionEffect type.");
+
+ var result = testingTarget.IsTransitioning();
+ Assert.AreEqual(false, result, "Should be equal!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CubeTransitionEffectIsTransitioning END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CubeTransitionEffect SetCurrentTexture.")]
+ [Property("SPEC", "Tizen.NUI.CubeTransitionEffect.SetCurrentTexture M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CubeTransitionEffectSetCurrentTexture()
+ {
+ tlog.Debug(tag, $"CubeTransitionEffectSetCurrentTexture START");
+
+ var testingTarget = new CubeTransitionWaveEffect(20, 10);
+ Assert.IsNotNull(testingTarget, "Can't create success object CubeTransitionEffect");
+ Assert.IsInstanceOf<CubeTransitionEffect>(testingTarget, "Should be an instance of CubeTransitionEffect type.");
+
+ try
+ {
+ testingTarget.SetCurrentTexture(LoadStageFillingTexture(currentpath));
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CubeTransitionEffectSetCurrentTexture END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CubeTransitionEffect SetTargetTexture.")]
+ [Property("SPEC", "Tizen.NUI.CubeTransitionEffect.SetTargetTexture M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CubeTransitionEffectSetTargetTexture()
+ {
+ tlog.Debug(tag, $"CubeTransitionEffectSetTargetTexture START");
+
+ var testingTarget = new CubeTransitionWaveEffect(20, 10);
+ Assert.IsNotNull(testingTarget, "Can't create success object CubeTransitionEffect");
+ Assert.IsInstanceOf<CubeTransitionEffect>(testingTarget, "Should be an instance of CubeTransitionEffect type.");
+
+ try
+ {
+ testingTarget.SetTargetTexture(LoadStageFillingTexture(targetpath));
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CubeTransitionEffectSetTargetTexture END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CubeTransitionEffect StartTransition.")]
+ [Property("SPEC", "Tizen.NUI.CubeTransitionEffect.StartTransition M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CubeTransitionEffectStartTransition()
+ {
+ tlog.Debug(tag, $"CubeTransitionEffectStartTransition START");
+
+ var testingTarget = new CubeTransitionWaveEffect(20, 10);
+ Assert.IsNotNull(testingTarget, "Can't create success object CubeTransitionEffect");
+ Assert.IsInstanceOf<CubeTransitionEffect>(testingTarget, "Should be an instance of CubeTransitionEffect type.");
+
+ testingTarget.SetTransitionDuration(1.5f);
+
+ testingTarget.SetCurrentTexture(LoadStageFillingTexture(currentpath));
+ testingTarget.SetTargetTexture(LoadStageFillingTexture(targetpath));
+
+ try
+ {
+ testingTarget.StartTransition(true);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget?.Dispose();
+ tlog.Debug(tag, $"CubeTransitionEffectStartTransition END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CubeTransitionEffect PauseTransition.")]
+ [Property("SPEC", "Tizen.NUI.CubeTransitionEffect.PauseTransition M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public async Task CubeTransitionEffectPauseTransition()
+ {
+ tlog.Debug(tag, $"CubeTransitionEffectPauseTransition START");
+
+ var testingTarget = new CubeTransitionWaveEffect(20, 10);
+ Assert.IsNotNull(testingTarget, "Can't create success object CubeTransitionEffect");
+ Assert.IsInstanceOf<CubeTransitionEffect>(testingTarget, "Should be an instance of CubeTransitionEffect type.");
+
+ testingTarget.SetTransitionDuration(300);
+
+ testingTarget.SetCurrentTexture(LoadStageFillingTexture(currentpath));
+ testingTarget.SetTargetTexture(LoadStageFillingTexture(targetpath));
+ testingTarget.StartTransition(true);
+
+ await Task.Delay(50);
+
+ try
+ {
+ testingTarget.PauseTransition();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.ResumeTransition();
+ testingTarget.StopTransition();
+
+ testingTarget?.Dispose();
+ tlog.Debug(tag, $"CubeTransitionEffectPauseTransition END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CubeTransitionEffect ResumeTransition.")]
+ [Property("SPEC", "Tizen.NUI.CubeTransitionEffect.ResumeTransition M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public async Task CubeTransitionEffectResumeTransition()
+ {
+ tlog.Debug(tag, $"CubeTransitionEffectResumeTransition START");
+
+ var testingTarget = new CubeTransitionWaveEffect(20, 10);
+ Assert.IsNotNull(testingTarget, "Can't create success object CubeTransitionEffect");
+ Assert.IsInstanceOf<CubeTransitionEffect>(testingTarget, "Should be an instance of CubeTransitionEffect type.");
+
+ testingTarget.SetTransitionDuration(300);
+
+ testingTarget.SetCurrentTexture(LoadStageFillingTexture(currentpath));
+ testingTarget.SetTargetTexture(LoadStageFillingTexture(targetpath));
+ testingTarget.StartTransition(true);
+
+ await Task.Delay(50);
+ testingTarget.PauseTransition();
+
+ try
+ {
+ testingTarget.ResumeTransition();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.StopTransition();
+
+ testingTarget?.Dispose();
+ tlog.Debug(tag, $"CubeTransitionEffectResumeTransition END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CubeTransitionEffect TransitionCompleted.")]
+ [Property("SPEC", "Tizen.NUI.CubeTransitionEffect.TransitionCompleted M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CubeTransitionEffectTransitionCompleted()
+ {
+ tlog.Debug(tag, $"CubeTransitionEffectTransitionCompleted START");
+
+ var testingTarget = new CubeTransitionWaveEffect(20, 10);
+ Assert.IsNotNull(testingTarget, "Can't create success object CubeTransitionEffect");
+ Assert.IsInstanceOf<CubeTransitionEffect>(testingTarget, "Should be an instance of CubeTransitionEffect type.");
+
+ try
+ {
+ testingTarget.TransitionCompleted += OnCubeEffectCompleted;
+ testingTarget.TransitionCompleted -= OnCubeEffectCompleted;
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CubeTransitionEffectTransitionCompleted END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CubeTransitionEffectSignal GetConnectionCount.")]
+ [Property("SPEC", "Tizen.NUI.CubeTransitionEffectSignal.GetConnectionCount M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CubeTransitionEffectSignalGetConnectionCount()
+ {
+ tlog.Debug(tag, $"CubeTransitionEffectSignalGetConnectionCount START");
+
+ var testingTarget = new CubeTransitionEffectSignal();
+ Assert.IsNotNull(testingTarget, "Can't create success object CubeTransitionEffectSignal");
+ Assert.IsInstanceOf<CubeTransitionEffectSignal>(testingTarget, "Should be an instance of CubeTransitionEffectSignal type.");
+
+ var result = testingTarget.GetConnectionCount();
+ Assert.IsTrue(result == 0, "result should be 0");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CubeTransitionEffectSignalGetConnectionCount END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CubeTransitionEffectSignal Emit.")]
+ [Property("SPEC", "Tizen.NUI.CubeTransitionEffectSignal.Emit M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CubeTransitionEffectSignalEmit()
+ {
+ tlog.Debug(tag, $"CubeTransitionEffectSignalEmit START");
+
+ var currentPid = global::System.Diagnostics.Process.GetCurrentProcess().Id;
+ var currentTid = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
+
+ tlog.Debug(tag, $"thread check! main pid={App.mainPid}, current pid={currentPid}, main tid={App.mainTid}, current tid={currentTid}");
+
+ var testingTarget = new CubeTransitionEffectSignal();
+ Assert.IsNotNull(testingTarget, "Can't create success object CubeTransitionEffectSignal");
+ Assert.IsInstanceOf<CubeTransitionEffectSignal>(testingTarget, "Should be an instance of CubeTransitionEffectSignal type.");
+
+ using (CubeTransitionEffect effect = new CubeTransitionCrossEffect(10, 8))
+ {
+ testingTarget.Emit(effect);
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CubeTransitionEffectSignalEmit END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CubeTransitionWaveEffect constructor.")]
+ [Property("SPEC", "Tizen.NUI.CubeTransitionWaveEffect.CubeTransitionWaveEffect C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CubeTransitionWaveEffectConstructor()
+ {
+ tlog.Debug(tag, $"CubeTransitionWaveEffectConstructor START");
+
+ var testingTarget = new CubeTransitionWaveEffect(20, 10);
+ Assert.IsNotNull(testingTarget, "Can't create success object CubeTransitionEffect");
+ Assert.IsInstanceOf<CubeTransitionEffect>(testingTarget, "Should be an instance of CubeTransitionEffect type.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CubeTransitionWaveEffectConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CubeTransitionCrossEffect constructor.")]
+ [Property("SPEC", "Tizen.NUI.CubeTransitionCrossEffect.CubeTransitionCrossEffect M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CubeTransitionCrossEffectConstructor()
+ {
+ tlog.Debug(tag, $"CubeTransitionCrossEffectConstructor START");
+
+ var testingTarget = new CubeTransitionCrossEffect(10, 8);
+ Assert.IsNotNull(testingTarget, "Can't create success object CubeTransitionEffect");
+ Assert.IsInstanceOf<CubeTransitionEffect>(testingTarget, "Should be an instance of CubeTransitionEffect type.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CubeTransitionCrossEffectConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CubeTransitionFoldEffect constructor.")]
+ [Property("SPEC", "Tizen.NUI.CubeTransitionFoldEffect.CubeTransitionFoldEffect M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CubeTransitionFoldEffectConstructor()
+ {
+ tlog.Debug(tag, $"CubeTransitionFoldEffectConstructor START");
+
+ var testingTarget = new CubeTransitionFoldEffect(10, 8);
+ Assert.IsNotNull(testingTarget, "Can't create success object CubeTransitionEffect");
+ Assert.IsInstanceOf<CubeTransitionEffect>(testingTarget, "Should be an instance of CubeTransitionEffect type.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CubeTransitionFoldEffectConstructor END (OK)");
+ }
+
+ private void OnCubeEffectCompleted(object sender, CubeTransitionEffect.TransitionCompletedEventArgs args)
+ {
+ OnTransitionCompletedFlag = true;
+ }
+
+ private Texture LoadStageFillingTexture(string filepath)
+ {
+ Size2D dimensions = new Size2D(NUIApplication.GetDefaultWindow().WindowSize.Width, NUIApplication.GetDefaultWindow().WindowSize.Height);
+ PixelBuffer pb = ImageLoading.LoadImageFromFile(filepath, dimensions, FittingModeType.ScaleToFill);
+ PixelData pd = PixelBuffer.Convert(pb);
+
+ Texture texture = new Texture(TextureType.TEXTURE_2D, pd.GetPixelFormat(), pd.GetWidth(), pd.GetHeight());
+ texture.Upload(pd);
+
+ return texture;
+ }
+ }
+}
--- /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;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Utility/FontClient")]
+ class TSFontClient
+ {
+ private const string tag = "NUITEST";
+ private string ttf_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "TizenSansRegular.ttf";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ internal class MySWIGTYPE_p_unsigned_int : SWIGTYPE_p_unsigned_int
+ {
+ public MySWIGTYPE_p_unsigned_int() : base()
+ { }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FontClient constructor.")]
+ [Property("SPEC", "Tizen.NUI.FontClient.FontClient C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void FontClientConstructor()
+ {
+ tlog.Debug(tag, $"FontClientConstructor START");
+
+ var testingTarget = new FontClient();
+ Assert.IsNotNull(testingTarget, "Return a null object of FontClient");
+ Assert.IsInstanceOf<FontClient>(testingTarget, "Should be an instance of FontClient type.");
+
+ testingTarget.Dispose();
+
+ tlog.Debug(tag, $"FontClientConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FontClient constructor. With FontClient")]
+ [Property("SPEC", "Tizen.NUI.FontClient.FontClient C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void FontClientConstructorWithFontClient()
+ {
+ tlog.Debug(tag, $"FontClientConstructorWithFontClient START");
+
+ using (FontClient instance = FontClient.Instance)
+ {
+ var testingTarget = new FontClient(instance);
+ Assert.IsNotNull(testingTarget, "Return a null object of FontClient");
+ Assert.IsInstanceOf<FontClient>(testingTarget, "Should be an instance of FontClient type.");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"FontClientConstructorWithFontClient END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FontClient DefaultPointSize.")]
+ [Property("SPEC", "Tizen.NUI.FontClient.DefaultPointSize A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void FontClientDefaultPointSize()
+ {
+ tlog.Debug(tag, $"FontClientDefaultPointSize START");
+
+ var testingTarget = FontClient.DefaultPointSize;
+ Assert.AreEqual(768, testingTarget, "Should be equal!");
+
+ tlog.Debug(tag, $"FontClientDefaultPointSize END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FontClient Assign.")]
+ [Property("SPEC", "Tizen.NUI.FontClient.Assign M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void FontClientAssign()
+ {
+ tlog.Debug(tag, $"FontClientAssign START");
+
+ using (FontClient fontClient = FontClient.Instance)
+ {
+ try
+ {
+ var testingTarget = fontClient.Assign(fontClient);
+ Assert.IsNotNull(testingTarget, "Return a null object of FontClient");
+ Assert.IsInstanceOf<FontClient>(testingTarget, "Should be an instance of FontClient type.");
+
+ testingTarget.Dispose();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+ }
+
+ tlog.Debug(tag, $"FontClientAssign END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FontClient GetDpi.")]
+ [Property("SPEC", "Tizen.NUI.FontClient.GetDpi M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void FontClientGetDpi()
+ {
+ tlog.Debug(tag, $"FontClientGetDpi START");
+
+ var testingTarget = new FontClient(FontClient.Instance);
+ Assert.IsNotNull(testingTarget, "Return a null object of FontClient");
+ Assert.IsInstanceOf<FontClient>(testingTarget, "Should be an instance of FontClient type.");
+
+ testingTarget.SetDpi(50, 60);
+
+ try
+ {
+ var horizontalDpi = new SWIGTYPE_p_unsigned_int(testingTarget.GetBaseHandleCPtrHandleRef.Handle);
+ var verticalDpi = new SWIGTYPE_p_unsigned_int(new FontClient().GetBaseHandleCPtrHandleRef.Handle);
+ testingTarget.GetDpi(horizontalDpi, verticalDpi);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"FontClientGetDpi END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FontClient GetDefaultFontSize.")]
+ [Property("SPEC", "Tizen.NUI.FontClient.GetDefaultFontSize M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void FontClientGetDefaultFontSize()
+ {
+ tlog.Debug(tag, $"FontClientGetDefaultFontSize START");
+
+ var testingTarget = new FontClient(FontClient.Instance);
+ Assert.IsNotNull(testingTarget, "Return a null object of FontClient");
+ Assert.IsInstanceOf<FontClient>(testingTarget, "Should be an instance of FontClient type.");
+
+ Assert.IsNotNull(testingTarget.GetDefaultFontSize());
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"FontClientGetDefaultFontSize END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FontClient GetDefaultPlatformFontDescription.")]
+ [Property("SPEC", "Tizen.NUI.FontClient.GetDefaultPlatformFontDescription M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void FontClientGetDefaultPlatformFontDescription()
+ {
+ tlog.Debug(tag, $"FontClientGetDefaultPlatformFontDescription START");
+
+ using (FontDescription description = new FontDescription())
+ {
+ description.Path = ttf_path;
+
+ var testingTarget = new FontClient(FontClient.Instance);
+ Assert.IsNotNull(testingTarget, "Return a null object of FontClient");
+ Assert.IsInstanceOf<FontClient>(testingTarget, "Should be an instance of FontClient type.");
+
+ try
+ {
+ testingTarget.GetDefaultPlatformFontDescription(description);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed");
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"FontClientGetDefaultPlatformFontDescription END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FontClient IsScalable.")]
+ [Property("SPEC", "Tizen.NUI.FontClient.IsScalable M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void FontClientIsScalable()
+ {
+ tlog.Debug(tag, $"FontClientIsScalable START");
+
+ using (FontDescription description = new FontDescription())
+ {
+ description.Path = ttf_path;
+
+ var testingTarget = new FontClient(FontClient.Instance);
+ Assert.IsNotNull(testingTarget, "Return a null object of FontClient");
+ Assert.IsInstanceOf<FontClient>(testingTarget, "Should be an instance of FontClient type.");
+
+ var result = testingTarget.IsScalable(description);
+ Assert.IsNotNull(result);
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"FontClientIsScalable END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FontClient CreateVectorBlob.")]
+ [Property("SPEC", "Tizen.NUI.FontClient.CreateVectorBlob M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void FontClientCreateVectorBlob()
+ {
+ tlog.Debug(tag, $"FontClientCreateVectorBlob START");
+
+ using (FontClient fontClient = FontClient.Instance)
+ {
+ var testingTarget = new FontClient(fontClient);
+
+ using (Color color = new Color(0.4f, 1.0f, 0.3f, 0.0f))
+ {
+ var blob = new SWIGTYPE_p_p_Dali__TextAbstraction__VectorBlob(color.SwigCPtr.Handle);
+ var blobLegnth = new SWIGTYPE_p_unsigned_int(color.SwigCPtr.Handle);
+
+ var nominalWidth = new SWIGTYPE_p_unsigned_int(fontClient.SwigCPtr.Handle);
+ var nominalHeight = new SWIGTYPE_p_unsigned_int(testingTarget.SwigCPtr.Handle);
+
+ try
+ {
+ testingTarget.CreateVectorBlob(0, 0, blob, blobLegnth, nominalWidth, nominalHeight);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ }
+ }
+
+ tlog.Debug(tag, $"FontClientCreateVectorBlob END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FontClient GetEllipsisGlyph.")]
+ [Property("SPEC", "Tizen.NUI.FontClient.GetEllipsisGlyph M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void FontClientGetEllipsisGlyph()
+ {
+ tlog.Debug(tag, $"FontClientGetEllipsisGlyph START");
+
+ var testingTarget = new FontClient(FontClient.Instance);
+ Assert.IsNotNull(testingTarget, "Return a null object of FontClient");
+ Assert.IsInstanceOf<FontClient>(testingTarget, "Should be an instance of FontClient type.");
+
+ var result = testingTarget.GetEllipsisGlyph(10);
+ Assert.IsInstanceOf<GlyphInfo>(result, "Should be an instance of GlyphInfo type.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"FontClientGetEllipsisGlyph END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FontClient IsColorGlyph.")]
+ [Property("SPEC", "Tizen.NUI.FontClient.IsColorGlyph M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void FontClientIsColorGlyph()
+ {
+ tlog.Debug(tag, $"FontClientIsColorGlyph START");
+
+ var testingTarget = new FontClient(FontClient.Instance);
+ Assert.IsNotNull(testingTarget, "Return a null object of FontClient");
+ Assert.IsInstanceOf<FontClient>(testingTarget, "Should be an instance of FontClient type.");
+
+ try
+ {
+ testingTarget.IsColorGlyph(testingTarget.GetFontId(ttf_path), testingTarget.GetGlyphIndex(0, 0x0041));
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caugth Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"FontClientIsColorGlyph END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GlyphBufferData constructor.")]
+ [Property("SPEC", "Tizen.NUI.FontClient.GlyphBufferData.GlyphBufferData C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void FontClientGlyphBufferDataConstructor()
+ {
+ tlog.Debug(tag, $"FontClientGlyphBufferDataConstructor START");
+
+ using (FontClient.GlyphBufferData data = new FontClient.GlyphBufferData())
+ {
+ var testingTarget = new FontClient.GlyphBufferData(FontClient.GlyphBufferData.getCPtr(data).Handle, true);
+ Assert.IsNotNull(testingTarget, "Return a null object of GlyphBufferData");
+ Assert.IsInstanceOf<FontClient.GlyphBufferData>(testingTarget, "Should be an instance of GlyphBufferData type.");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"FontClientGlyphBufferDataConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GlyphBufferData Width.")]
+ [Property("SPEC", "Tizen.NUI.FontClient.GlyphBufferData.Width A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void FontClientGlyphBufferDataWidth()
+ {
+ tlog.Debug(tag, $"FontClientGlyphBufferDataWidth START");
+
+ var testingTarget = new FontClient.GlyphBufferData();
+ Assert.IsNotNull(testingTarget, "Return a null object of GlyphBufferData");
+ Assert.IsInstanceOf<FontClient.GlyphBufferData>(testingTarget, "Should be an instance of GlyphBufferData type.");
+
+ testingTarget.Width = 100;
+ Assert.AreEqual(100, testingTarget.Width, "Should be equal!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"FontClientGlyphBufferDataWidth END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GlyphBufferData Height.")]
+ [Property("SPEC", "Tizen.NUI.FontClient.GlyphBufferData.Height A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void FontClientGlyphBufferDataHeight()
+ {
+ tlog.Debug(tag, $"FontClientGlyphBufferDataHeight START");
+
+ var testingTarget = new FontClient.GlyphBufferData(); ;
+ Assert.IsNotNull(testingTarget, "Return a null object of GlyphBufferData");
+ Assert.IsInstanceOf<FontClient.GlyphBufferData>(testingTarget, "Should be an instance of GlyphBufferData type.");
+
+ testingTarget.Height = 50;
+ Assert.AreEqual(50, testingTarget.Height, "Should be equal!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"FontClientGlyphBufferDataHeight END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GlyphBufferData Format.")]
+ [Property("SPEC", "Tizen.NUI.FontClient.GlyphBufferData.Format A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void FontClientGlyphBufferDataFormat()
+ {
+ tlog.Debug(tag, $"FontClientGlyphBufferDataFormat START");
+
+ var testingTarget = new FontClient.GlyphBufferData();
+ Assert.IsNotNull(testingTarget, "Return a null object of GlyphBufferData");
+ Assert.IsInstanceOf<FontClient.GlyphBufferData>(testingTarget, "Should be an instance of GlyphBufferData type.");
+
+ testingTarget.Format = PixelFormat.BGR8888;
+ Assert.AreEqual(PixelFormat.BGR8888, testingTarget.Format, "Should be equal!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"FontClientGlyphBufferDataFormat 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;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Utility/GraphicsCapabilities")]
+ public class PublicGraphicsCapabilitiesTest
+ {
+ private const string tag = "NUITEST";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GraphicsCapabilities IsBlendEquationSupported.")]
+ [Property("SPEC", "Tizen.NUI.GraphicsCapabilities.IsBlendEquationSupported M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void GraphicsCapabilitiesIsBlendEquationSupported()
+ {
+ tlog.Debug(tag, $"GraphicsCapabilitiesIsBlendEquationSupported START");
+
+ try
+ {
+ GraphicsCapabilities.IsBlendEquationSupported(BlendEquationType.Color);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"GraphicsCapabilitiesIsBlendEquationSupported 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;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Utility/GraphicsTypeConverter")]
+ public class PublicGraphicsTypeConverterTest
+ {
+ private const string tag = "NUITEST";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GraphicsTypeConverter ConvertScriptToPixel.")]
+ [Property("SPEC", "Tizen.NUI.GraphicsTypeConverter.ConvertScriptToPixel M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void GraphicsTypeConverterConvertScriptToPixel()
+ {
+ tlog.Debug(tag, $"GraphicsTypeConverterConvertScriptToPixel START");
+
+ var testingTarget = new GraphicsTypeConverter();
+ Assert.IsNotNull(testingTarget, "Can't create success object GraphicsTypeConverter");
+ Assert.IsInstanceOf<GraphicsTypeConverter>(testingTarget, "Should be an instance of GraphicsTypeConverter type.");
+
+ var result = testingTarget.ConvertScriptToPixel("160dp");
+ Assert.IsNotNull(result);
+
+ result = testingTarget.ConvertScriptToPixel("160px");
+ Assert.AreEqual(160.0f, result, "Should be equal!");
+
+ result = testingTarget.ConvertScriptToPixel("160.0f");
+ Assert.AreEqual(0.0f, result, "Should be equal!");
+
+ tlog.Debug(tag, $"GraphicsTypeConverterConvertScriptToPixel END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GraphicsTypeConverter ConvertFromPixel.")]
+ [Property("SPEC", "Tizen.NUI.GraphicsTypeConverter.ConvertFromPixel M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void GraphicsTypeConverterConvertFromPixel()
+ {
+ tlog.Debug(tag, $"GraphicsTypeConverterConvertFromPixel START");
+
+ var testingTarget = new GraphicsTypeConverter();
+ Assert.IsNotNull(testingTarget, "Can't create success object GraphicsTypeConverter");
+ Assert.IsInstanceOf<GraphicsTypeConverter>(testingTarget, "Should be an instance of GraphicsTypeConverter type.");
+
+ var result = testingTarget.ConvertFromPixel(160.0f);
+ Assert.IsNotNull(result);
+
+ tlog.Debug(tag, $"GraphicsTypeConverterConvertFromPixel 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;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Utility/GraphicsTypeManager")]
+ public class PublicGraphicsTypeManagerTest
+ {
+ private const string tag = "NUITEST";
+
+ internal class MyTypeConverter : Tizen.NUI.Binding.TypeConverter
+ {
+ public MyTypeConverter() : base()
+ { }
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GraphicsTypeManager SetTypeConverter.")]
+ [Property("SPEC", "Tizen.NUI.GraphicsTypeManager.SetTypeConverter M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void GraphicsTypeManagerSetTypeConverter()
+ {
+ tlog.Debug(tag, $"GraphicsTypeManagerSetTypeConverter START");
+
+ try
+ {
+ GraphicsTypeManager.Instance.SetTypeConverter(new GraphicsTypeConverter());
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"GraphicsTypeManagerSetTypeConverter END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GraphicsTypeManager ConvertScriptToPixel.")]
+ [Property("SPEC", "Tizen.NUI.GraphicsTypeManager.ConvertScriptToPixel M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void GraphicsTypeManagerConvertScriptToPixel()
+ {
+ tlog.Debug(tag, $"GraphicsTypeManagerConvertScriptToPixel START");
+
+ try
+ {
+ GraphicsTypeManager.Instance.ConvertScriptToPixel("160px");
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"GraphicsTypeManagerConvertScriptToPixel END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GraphicsTypeManager ConvertToPixel.")]
+ [Property("SPEC", "Tizen.NUI.GraphicsTypeManager.ConvertToPixel M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void GraphicsTypeManagerConvertToPixel()
+ {
+ tlog.Debug(tag, $"GraphicsTypeManagerConvertToPixel START");
+
+ try
+ {
+ GraphicsTypeManager.Instance.ConvertToPixel(160.0f);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"GraphicsTypeManagerConvertToPixel END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GraphicsTypeManager ConvertFromPixel.")]
+ [Property("SPEC", "Tizen.NUI.GraphicsTypeManager.ConvertFromPixel M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void GraphicsTypeManagerConvertFromPixel()
+ {
+ tlog.Debug(tag, $"GraphicsTypeManagerConvertFromPixel START");
+
+ try
+ {
+ GraphicsTypeManager.Instance.ConvertFromPixel(160.0f);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"GraphicsTypeManagerConvertFromPixel END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GraphicsTypeManager RegisterCustomConverterForDynamicResourceBinding.")]
+ [Property("SPEC", "Tizen.NUI.GraphicsTypeManager.RegisterCustomConverterForDynamicResourceBinding M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void GraphicsTypeManagerRegisterCustomConverterForDynamicResourceBinding()
+ {
+ tlog.Debug(tag, $"GraphicsTypeManagerRegisterCustomConverterForDynamicResourceBinding START");
+
+ string str = "GraphicsTypeManager";
+ Tizen.NUI.Binding.TypeConverter converter = new MyTypeConverter();
+
+ try
+ {
+ GraphicsTypeManager.Instance.RegisterCustomConverterForDynamicResourceBinding(str.GetType(), converter);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"GraphicsTypeManagerRegisterCustomConverterForDynamicResourceBinding 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;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Utility/Palette")]
+ public class PublicPaletteTest
+ {
+ private const string tag = "NUITEST";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Palette Generate.")]
+ [Property("SPEC", "Tizen.NUI.Palette.Generate M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PaletteGenerate()
+ {
+ tlog.Debug(tag, $"PaletteGenerate START");
+
+ try
+ {
+ using (PixelBuffer buffer = new PixelBuffer(100, 80, PixelFormat.A8))
+ {
+ var testingTarget = Palette.Generate(buffer);
+ Assert.IsNotNull(testingTarget, "Can't create success object Palette");
+ Assert.IsInstanceOf<Palette>(testingTarget, "Should be an instance of Palette type.");
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"PaletteGenerate END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Palette Generate. With Rectangle.")]
+ [Property("SPEC", "Tizen.NUI.Palette.Generate M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PaletteGenerateWithRectangle()
+ {
+ tlog.Debug(tag, $"PaletteGenerateWithRectangle START");
+
+ try
+ {
+ using (PixelBuffer buffer = new PixelBuffer(150, 120, PixelFormat.A8))
+ {
+ using (Rectangle region = new Rectangle(24, 24, 24, 24))
+ {
+ var testingTarget = Palette.Generate(buffer, region);
+ Assert.IsNotNull(testingTarget, "Can't create success object Palette");
+ Assert.IsInstanceOf<Palette>(testingTarget, "Should be an instance of Palette type.");
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"PaletteGenerateWithRectangle END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Palette Generate. PixelBuffer is null.")]
+ [Property("SPEC", "Tizen.NUI.Palette.Generate M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PaletteGenerateWithNullPixelBuffer()
+ {
+ tlog.Debug(tag, $"PaletteGenerateWithNullPixelBuffer START");
+
+ try
+ {
+ using (Rectangle region = new Rectangle(24, 24, 24, 24))
+ {
+ var testingTarget = Palette.Generate(null, region);
+ }
+ }
+ catch (ArgumentNullException e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"PaletteGenerateWithNullPixelBuffer END (OK)");
+ Assert.Pass("Caught ArgumentNullException: Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Palette GetSwatches.")]
+ [Property("SPEC", "Tizen.NUI.Palette.GetSwatches M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PaletteGetSwatches()
+ {
+ tlog.Debug(tag, $"PaletteGetSwatches START");
+
+ try
+ {
+ using (PixelBuffer buffer = new PixelBuffer(100, 80, PixelFormat.A8))
+ {
+ using (Rectangle region = new Rectangle(24, 24, 24, 24))
+ {
+ var testingTarget = Palette.Generate(buffer, region);
+ Assert.IsNotNull(testingTarget, "Can't create success object Palette");
+ Assert.IsInstanceOf<Palette>(testingTarget, "Should be an instance of Palette type.");
+
+ testingTarget.GetSwatches();
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"PaletteGetSwatches END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Palette GetDominantSwatch.")]
+ [Property("SPEC", "Tizen.NUI.Palette.GetDominantSwatch M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PaletteGetDominantSwatch()
+ {
+ tlog.Debug(tag, $"PaletteGetDominantSwatch START");
+
+ try
+ {
+ using (PixelBuffer buffer = new PixelBuffer(100, 80, PixelFormat.A8))
+ {
+ using (Rectangle region = new Rectangle(24, 24, 24, 24))
+ {
+ var testingTarget = Palette.Generate(buffer, region);
+ Assert.IsNotNull(testingTarget, "Can't create success object Palette");
+ Assert.IsInstanceOf<Palette>(testingTarget, "Should be an instance of Palette type.");
+
+ testingTarget.GetDominantSwatch();
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"PaletteGetDominantSwatch END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Palette GetVibrantSwatch.")]
+ [Property("SPEC", "Tizen.NUI.Palette.GetVibrantSwatch M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PaletteGetVibrantSwatch()
+ {
+ tlog.Debug(tag, $"PaletteGetVibrantSwatch START");
+
+ try
+ {
+ using (PixelBuffer buffer = new PixelBuffer(100, 80, PixelFormat.A8))
+ {
+ using (Rectangle region = new Rectangle(24, 24, 24, 24))
+ {
+ var testingTarget = Palette.Generate(buffer, region);
+ Assert.IsNotNull(testingTarget, "Can't create success object Palette");
+ Assert.IsInstanceOf<Palette>(testingTarget, "Should be an instance of Palette type.");
+
+ testingTarget.GetVibrantSwatch();
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"PaletteGetVibrantSwatch END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Palette GetLightVibrantSwatch.")]
+ [Property("SPEC", "Tizen.NUI.Palette.GetLightVibrantSwatch M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PaletteGetLightVibrantSwatch()
+ {
+ tlog.Debug(tag, $"PaletteGetLightVibrantSwatch START");
+
+ try
+ {
+ using (PixelBuffer buffer = new PixelBuffer(100, 80, PixelFormat.A8))
+ {
+ using (Rectangle region = new Rectangle(24, 24, 24, 24))
+ {
+ var testingTarget = Palette.Generate(buffer, region);
+ Assert.IsNotNull(testingTarget, "Can't create success object Palette");
+ Assert.IsInstanceOf<Palette>(testingTarget, "Should be an instance of Palette type.");
+
+ testingTarget.GetLightVibrantSwatch();
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"PaletteGetLightVibrantSwatch END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Palette GetDarkVibrantSwatch.")]
+ [Property("SPEC", "Tizen.NUI.Palette.GetDarkVibrantSwatch M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PaletteGetDarkVibrantSwatch()
+ {
+ tlog.Debug(tag, $"PaletteGetDarkVibrantSwatch START");
+
+ try
+ {
+ using (PixelBuffer buffer = new PixelBuffer(100, 80, PixelFormat.A8))
+ {
+ using (Rectangle region = new Rectangle(24, 24, 24, 24))
+ {
+ var testingTarget = Palette.Generate(buffer, region);
+ Assert.IsNotNull(testingTarget, "Can't create success object Palette");
+ Assert.IsInstanceOf<Palette>(testingTarget, "Should be an instance of Palette type.");
+
+ testingTarget.GetDarkVibrantSwatch();
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"PaletteGetDarkVibrantSwatch END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Palette GetMutedSwatch.")]
+ [Property("SPEC", "Tizen.NUI.Palette.GetMutedSwatch M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PaletteGetMutedSwatch()
+ {
+ tlog.Debug(tag, $"PaletteGetMutedSwatch START");
+
+ try
+ {
+ using (PixelBuffer buffer = new PixelBuffer(100, 80, PixelFormat.A8))
+ {
+ using (Rectangle region = new Rectangle(24, 24, 24, 24))
+ {
+ var testingTarget = Palette.Generate(buffer, region);
+ Assert.IsNotNull(testingTarget, "Can't create success object Palette");
+ Assert.IsInstanceOf<Palette>(testingTarget, "Should be an instance of Palette type.");
+
+ testingTarget.GetMutedSwatch();
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"PaletteGetMutedSwatch END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Palette GetLightMutedSwatch.")]
+ [Property("SPEC", "Tizen.NUI.Palette.GetLightMutedSwatch M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PaletteGetLightMutedSwatch()
+ {
+ tlog.Debug(tag, $"PaletteGetLightMutedSwatch START");
+
+ try
+ {
+ using (PixelBuffer buffer = new PixelBuffer(100, 80, PixelFormat.A8))
+ {
+ using (Rectangle region = new Rectangle(24, 24, 24, 24))
+ {
+ var testingTarget = Palette.Generate(buffer, region);
+ Assert.IsNotNull(testingTarget, "Can't create success object Palette");
+ Assert.IsInstanceOf<Palette>(testingTarget, "Should be an instance of Palette type.");
+
+ testingTarget.GetLightMutedSwatch();
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"PaletteGetLightMutedSwatch END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Palette GetDarkMutedSwatch.")]
+ [Property("SPEC", "Tizen.NUI.Palette.GetDarkMutedSwatch M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PaletteGetDarkMutedSwatch()
+ {
+ tlog.Debug(tag, $"PaletteGetDarkMutedSwatch START");
+
+ try
+ {
+ using (PixelBuffer buffer = new PixelBuffer(100, 80, PixelFormat.A8))
+ {
+ using (Rectangle region = new Rectangle(24, 24, 24, 24))
+ {
+ var testingTarget = Palette.Generate(buffer, region);
+ Assert.IsNotNull(testingTarget, "Can't create success object Palette");
+ Assert.IsInstanceOf<Palette>(testingTarget, "Should be an instance of Palette type.");
+
+ testingTarget.GetDarkMutedSwatch();
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"PaletteGetDarkMutedSwatch END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Palette.Swatch constructor.")]
+ [Property("SPEC", "Tizen.NUI.Palette.Swatch.Swatch C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PaletteSwatchConstructor()
+ {
+ tlog.Debug(tag, $"PaletteSwatchConstructor START");
+
+ var testingTarget = new Palette.Swatch(221, 125);
+ Assert.IsNotNull(testingTarget, "Can't create success object Swatch");
+ Assert.IsInstanceOf<Palette.Swatch>(testingTarget, "Should be an instance of Swatch type.");
+
+ tlog.Debug(tag, $"PaletteSwatchConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Palette.Swatch GetRgb.")]
+ [Property("SPEC", "Tizen.NUI.Palette.Swatch.GetRgb M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PaletteSwatchGetRgb()
+ {
+ tlog.Debug(tag, $"PaletteSwatchGetRgb START");
+
+ var testingTarget = new Palette.Swatch(221, 125, 128, 55);
+ Assert.IsNotNull(testingTarget, "Can't create success object Swatch");
+ Assert.IsInstanceOf<Palette.Swatch>(testingTarget, "Should be an instance of Swatch type.");
+
+ var result = testingTarget.GetRgb();
+ Assert.IsNotNull(result, "Can't create success object Color");
+ Assert.IsInstanceOf<Color>(result, "Should be an instance of Color type.");
+
+ tlog.Debug(tag, $"PaletteSwatchGetRgb END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Palette.Swatch GetTitleTextColor.")]
+ [Property("SPEC", "Tizen.NUI.Palette.Swatch.GetTitleTextColor M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PaletteSwatchGetTitleTextColor()
+ {
+ tlog.Debug(tag, $"PaletteSwatchGetTitleTextColor START");
+
+ var testingTarget = new Palette.Swatch(221, 125, 128, 55);
+ Assert.IsNotNull(testingTarget, "Can't create success object Swatch");
+ Assert.IsInstanceOf<Palette.Swatch>(testingTarget, "Should be an instance of Swatch type.");
+
+ var result = testingTarget.GetTitleTextColor();
+ Assert.IsNotNull(result, "Can't create success object Color");
+ Assert.IsInstanceOf<Color>(result, "Should be an instance of Color type.");
+
+ tlog.Debug(tag, $"PaletteSwatchGetTitleTextColor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Palette.Swatch GetBodyTextColor.")]
+ [Property("SPEC", "Tizen.NUI.Palette.Swatch.GetBodyTextColor M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void PaletteSwatchGetBodyTextColor()
+ {
+ tlog.Debug(tag, $"PaletteSwatchGetBodyTextColor START");
+
+ var testingTarget = new Palette.Swatch(221, 125, 128, 55);
+ Assert.IsNotNull(testingTarget, "Can't create success object Swatch");
+ Assert.IsInstanceOf<Palette.Swatch>(testingTarget, "Should be an instance of Swatch type.");
+
+ var result = testingTarget.GetBodyTextColor();
+ Assert.IsNotNull(result, "Can't create success object Color");
+ Assert.IsInstanceOf<Color>(result, "Should be an instance of Color type.");
+
+ /** lightBodyAlpha != -1 && lightTitleAlpha != -1 */
+ testingTarget = new Palette.Swatch(22, 45, 28, 55);
+
+ try
+ {
+ testingTarget.GetBodyTextColor();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"PaletteSwatchGetBodyTextColor END (OK)");
+ }
+
+ //[Test]
+ //[Category("P1")]
+ //[Description("Palette GenerateAsync.")]
+ //[Property("SPEC", "Tizen.NUI.Palette.GenerateAsync M")]
+ //[Property("SPEC_URL", "-")]
+ //[Property("CRITERIA", "MR")]
+ //[Property("AUTHOR", "guowei.wang@samsung.com")]
+ //public void PaletteGenerateAsync()
+ //{
+ // tlog.Debug(tag, $"PaletteGenerateAsync START");
+
+ // try
+ // {
+ // using (PixelBuffer buffer = new PixelBuffer(100, 80, PixelFormat.A8))
+ // {
+ // _ = Palette.GenerateAsync(buffer);
+ // }
+ // }
+ // catch (Exception e)
+ // {
+ // tlog.Debug(tag, e.Message.ToString());
+ // Assert.Fail("Caught Exception: Failed!");
+ // }
+
+ // tlog.Debug(tag, $"PaletteGenerateAsync END (OK)");
+ //}
+
+ //[Test]
+ //[Category("P1")]
+ //[Description("Palette GenerateAsync. With Rectangle.")]
+ //[Property("SPEC", "Tizen.NUI.Palette.GenerateAsync M")]
+ //[Property("SPEC_URL", "-")]
+ //[Property("CRITERIA", "MR")]
+ //[Property("AUTHOR", "guowei.wang@samsung.com")]
+ //public void PaletteGenerateAsyncWithRectangle()
+ //{
+ // tlog.Debug(tag, $"PaletteGenerateAsyncWithRectangle START");
+
+ // try
+ // {
+ // using (PixelBuffer buffer = new PixelBuffer(100, 80, PixelFormat.A8))
+ // {
+ // using (Rectangle region = new Rectangle(24, 24, 24, 24))
+ // {
+ // _ = Palette.GenerateAsync(buffer, region);
+ // }
+ // }
+ // }
+ // catch (Exception e)
+ // {
+ // tlog.Debug(tag, e.Message.ToString());
+ // Assert.Fail("Caught Exception: Failed!");
+ // }
+
+ // tlog.Debug(tag, $"PaletteGenerateAsyncWithRectangle 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;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Utility/ScrollView")]
+ class PublicScrollViewTest
+ {
+ private const string tag = "NUITEST";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView WrapEnabled.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.WrapEnabled A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewWrapEnabled()
+ {
+ tlog.Debug(tag, $"ScrollViewWrapEnabled START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ Assert.AreEqual(false, testingTarget.WrapEnabled);
+
+ testingTarget.WrapEnabled = true;
+ Assert.AreEqual(true, testingTarget.WrapEnabled);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewWrapEnabled END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView PanningEnabled.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.PanningEnabled A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewPanningEnabled()
+ {
+ tlog.Debug(tag, $"ScrollViewPanningEnabled START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ testingTarget.WrapEnabled = true;
+ Assert.AreEqual(true, testingTarget.PanningEnabled);
+
+ testingTarget.WrapEnabled = false;
+ Assert.AreEqual(false, testingTarget.PanningEnabled);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewPanningEnabled END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView AxisAutoLockEnabled.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.AxisAutoLockEnabled A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewAxisAutoLockEnabled()
+ {
+ tlog.Debug(tag, $"ScrollViewAxisAutoLockEnabled START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ Assert.AreEqual(false, testingTarget.AxisAutoLockEnabled);
+
+ testingTarget.AxisAutoLockEnabled = true;
+ Assert.AreEqual(true, testingTarget.AxisAutoLockEnabled);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewAxisAutoLockEnabled END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView WheelScrollDistanceStep.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.WheelScrollDistanceStep A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewWheelScrollDistanceStep()
+ {
+ tlog.Debug(tag, $"ScrollViewWheelScrollDistanceStep START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ Assert.IsNotNull(testingTarget.WheelScrollDistanceStep.X);
+ Assert.IsNotNull(testingTarget.WheelScrollDistanceStep.Y);
+
+ using (Vector2 vector = new Vector2(100, 80))
+ {
+ testingTarget.WheelScrollDistanceStep = vector;
+ Assert.AreEqual(100, testingTarget.WheelScrollDistanceStep.X);
+ Assert.AreEqual( 80, testingTarget.WheelScrollDistanceStep.Y);
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewWheelScrollDistanceStep END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView ScrollPosition.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.ScrollPosition A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewScrollPosition()
+ {
+ tlog.Debug(tag, $"ScrollViewScrollPosition START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ Assert.AreEqual(0, testingTarget.ScrollPosition.X);
+ Assert.AreEqual(0, testingTarget.ScrollPosition.Y);
+
+ using (Vector2 vector = new Vector2(80, 100))
+ {
+ testingTarget.ScrollPosition = vector;
+ Assert.AreEqual(80, testingTarget.ScrollPosition.X);
+ Assert.AreEqual(100, testingTarget.ScrollPosition.Y);
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewScrollPosition END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView ScrollPrePosition.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.ScrollPrePosition A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewScrollPrePosition()
+ {
+ tlog.Debug(tag, $"ScrollViewScrollPrePosition START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ Assert.AreEqual(0, testingTarget.ScrollPrePosition.X);
+ Assert.AreEqual(0, testingTarget.ScrollPrePosition.Y);
+
+ using (Vector2 vector = new Vector2(80, 100))
+ {
+ testingTarget.ScrollPrePosition = vector;
+ Assert.AreEqual(80, testingTarget.ScrollPrePosition.X);
+ Assert.AreEqual(100, testingTarget.ScrollPrePosition.Y);
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewScrollPrePosition END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView ScrollPrePositionMax.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.ScrollPrePositionMax A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewScrollPrePositionMax()
+ {
+ tlog.Debug(tag, $"ScrollViewScrollPrePositionMax START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ Assert.AreEqual(0, testingTarget.ScrollPrePositionMax.X);
+ Assert.AreEqual(0, testingTarget.ScrollPrePositionMax.Y);
+
+ using (Vector2 vector = new Vector2(80, 100))
+ {
+ testingTarget.ScrollPrePositionMax = vector;
+ Assert.AreEqual(80, testingTarget.ScrollPrePositionMax.X);
+ Assert.AreEqual(100, testingTarget.ScrollPrePositionMax.Y);
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewScrollPrePositionMax END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView OvershootX.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.OvershootX A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewOvershootX()
+ {
+ tlog.Debug(tag, $"ScrollViewOvershootX START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ Assert.AreEqual(0, testingTarget.OvershootX);
+
+ testingTarget.OvershootX = 1.5f;
+ Assert.AreEqual(1.5f, testingTarget.OvershootX);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewOvershootX END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView OvershootY.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.OvershootY A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewOvershootY()
+ {
+ tlog.Debug(tag, $"ScrollViewOvershootY START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ Assert.AreEqual(0, testingTarget.OvershootY);
+
+ testingTarget.OvershootY = 1.5f;
+ Assert.AreEqual(1.5f, testingTarget.OvershootY);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewOvershootY END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView ScrollFinal.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.ScrollFinal A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewScrollFinal()
+ {
+ tlog.Debug(tag, $"ScrollViewScrollFinal START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ Assert.AreEqual(0, testingTarget.ScrollFinal.X);
+ Assert.AreEqual(0, testingTarget.ScrollFinal.Y);
+
+ using (Vector2 vector = new Vector2(80, 100))
+ {
+ testingTarget.ScrollFinal = vector;
+ Assert.AreEqual(80, testingTarget.ScrollFinal.X);
+ Assert.AreEqual(100, testingTarget.ScrollFinal.Y);
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewScrollFinal END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView Wrap.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.Wrap A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewWrap()
+ {
+ tlog.Debug(tag, $"ScrollViewWrap START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ Assert.AreEqual(false, testingTarget.Wrap);
+
+ testingTarget.Wrap = true;
+ Assert.AreEqual(true, testingTarget.Wrap);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewWrap END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView Panning.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.Panning A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewPanning()
+ {
+ tlog.Debug(tag, $"ScrollViewPanning START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ Assert.AreEqual(false, testingTarget.Panning);
+
+ testingTarget.Panning = true;
+ Assert.AreEqual(true, testingTarget.Panning);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewPanning END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView Scrolling.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.Scrolling A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewScrolling()
+ {
+ tlog.Debug(tag, $"ScrollViewScrolling START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ Assert.AreEqual(false, testingTarget.Scrolling);
+
+ testingTarget.Scrolling = true;
+ Assert.AreEqual(true, testingTarget.Scrolling);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewScrolling END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView ScrollDomainSize.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.ScrollDomainSize A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewScrollDomainSize()
+ {
+ tlog.Debug(tag, $"ScrollViewScrollDomainSize START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ Assert.AreEqual(0, testingTarget.ScrollDomainSize.X);
+ Assert.AreEqual(0, testingTarget.ScrollDomainSize.Y);
+
+ using (Vector2 vector = new Vector2(80, 100))
+ {
+ testingTarget.ScrollDomainSize = vector;
+ Assert.AreEqual(80, testingTarget.ScrollDomainSize.X);
+ Assert.AreEqual(100, testingTarget.ScrollDomainSize.Y);
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewScrollDomainSize END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView ScrollDomainOffset.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.ScrollDomainOffset A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewScrollDomainOffset()
+ {
+ tlog.Debug(tag, $"ScrollViewScrollDomainOffset START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ Assert.AreEqual(0, testingTarget.ScrollDomainOffset.X);
+ Assert.AreEqual(0, testingTarget.ScrollDomainOffset.Y);
+
+ using (Vector2 vector = new Vector2(80, 100))
+ {
+ testingTarget.ScrollDomainOffset = vector;
+ Assert.AreEqual(80, testingTarget.ScrollDomainOffset.X);
+ Assert.AreEqual(100, testingTarget.ScrollDomainOffset.Y);
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewScrollDomainOffset END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView ScrollPositionDelta.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.ScrollPositionDelta A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewScrollPositionDelta()
+ {
+ tlog.Debug(tag, $"ScrollViewScrollPositionDelta START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ Assert.AreEqual(0, testingTarget.ScrollPositionDelta.X);
+ Assert.AreEqual(0, testingTarget.ScrollPositionDelta.Y);
+
+ using (Vector2 vector = new Vector2(80, 100))
+ {
+ testingTarget.ScrollPositionDelta = vector;
+ Assert.AreEqual(80, testingTarget.ScrollPositionDelta.X);
+ Assert.AreEqual(100, testingTarget.ScrollPositionDelta.Y);
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewScrollPositionDelta END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView StartPagePosition.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.StartPagePosition A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewStartPagePosition()
+ {
+ tlog.Debug(tag, $"ScrollViewStartPagePosition START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ Assert.AreEqual(0, testingTarget.StartPagePosition.X);
+ Assert.AreEqual(0, testingTarget.StartPagePosition.Y);
+ Assert.AreEqual(0, testingTarget.StartPagePosition.Z);
+
+ using (Vector3 vector = new Vector3(50, 80, 100))
+ {
+ testingTarget.StartPagePosition = vector;
+ Assert.AreEqual(50, testingTarget.StartPagePosition.X);
+ Assert.AreEqual(80, testingTarget.StartPagePosition.Y);
+ Assert.AreEqual(100, testingTarget.StartPagePosition.Z);
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewStartPagePosition END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView ScrollMode.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.ScrollMode A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewScrollMode()
+ {
+ tlog.Debug(tag, $"ScrollViewScrollMode START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ using (PropertyMap map = new PropertyMap())
+ {
+ using (PropertyValue value = new PropertyValue("horizontal"))
+ {
+ map.Add("direction", value);
+ testingTarget.ScrollMode = map;
+
+ Assert.IsNotNull(testingTarget.ScrollMode);
+ }
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewScrollMode END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView GetScrollSnapAlphaFunction.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.GetScrollSnapAlphaFunction M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewGetScrollSnapAlphaFunction()
+ {
+ tlog.Debug(tag, $"ScrollViewGetScrollSnapAlphaFunction START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ var result = testingTarget.GetScrollSnapAlphaFunction();
+ Assert.IsNotNull(result, "Can't create success object AlphaFunction");
+ Assert.IsInstanceOf<AlphaFunction>(result, "Should be an instance of AlphaFunction type.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewGetScrollSnapAlphaFunction END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetScrollSnapAlphaFunction.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetScrollSnapAlphaFunction M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetScrollSnapAlphaFunction()
+ {
+ tlog.Debug(tag, $"ScrollViewSetScrollSnapAlphaFunction START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ using (AlphaFunction alpha = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseInSine))
+ {
+ testingTarget.SetScrollSnapAlphaFunction(alpha);
+ Assert.IsNotNull(testingTarget.GetScrollSnapAlphaFunction());
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetScrollSnapAlphaFunction END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView GetScrollFlickAlphaFunction.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.GetScrollFlickAlphaFunction M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewGetScrollFlickAlphaFunction()
+ {
+ tlog.Debug(tag, $"ScrollViewGetScrollFlickAlphaFunction START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ var result = testingTarget.GetScrollFlickAlphaFunction();
+ Assert.IsNotNull(result, "Can't create success object AlphaFunction");
+ Assert.IsInstanceOf<AlphaFunction>(result, "Should be an instance of AlphaFunction type.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewGetScrollFlickAlphaFunction END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetScrollFlickAlphaFunction.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetScrollFlickAlphaFunction M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetScrollFlickAlphaFunction()
+ {
+ tlog.Debug(tag, $"ScrollViewSetScrollFlickAlphaFunction START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ using (AlphaFunction alpha = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseOutBack))
+ {
+ testingTarget.SetScrollFlickAlphaFunction(alpha);
+ Assert.IsNotNull(testingTarget.GetScrollFlickAlphaFunction());
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetScrollFlickAlphaFunction END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView GetScrollSnapDuration.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.GetScrollSnapDuration M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewGetScrollSnapDuration()
+ {
+ tlog.Debug(tag, $"ScrollViewGetScrollSnapDuration START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ var result = testingTarget.GetScrollSnapDuration();
+ Assert.IsNotNull(result, "Can't create success object AlphaFunction");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewGetScrollSnapDuration END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetScrollSnapDuration.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetScrollSnapDuration M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetScrollSnapDuration()
+ {
+ tlog.Debug(tag, $"ScrollViewSetScrollSnapDuration START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ testingTarget.SetScrollSnapDuration(1.5f);
+ Assert.AreEqual(1.5f, testingTarget.GetScrollSnapDuration(), "Should be equal!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetScrollSnapDuration END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView GetScrollFlickDuration.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.GetScrollFlickDuration M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewGetScrollFlickDuration()
+ {
+ tlog.Debug(tag, $"ScrollViewGetScrollFlickDuration START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ var result = testingTarget.GetScrollFlickDuration();
+ Assert.IsNotNull(result, "Can't create success object AlphaFunction");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewGetScrollFlickDuration END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetScrollFlickDuration.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetScrollFlickDuration M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetScrollFlickDuration()
+ {
+ tlog.Debug(tag, $"ScrollViewSetScrollFlickDuration START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ testingTarget.SetScrollFlickDuration(1.5f);
+ Assert.AreEqual(1.5f, testingTarget.GetScrollFlickDuration(), "Should be equal!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetScrollFlickDuration END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetScrollSensitive.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetScrollSensitive M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetScrollSensitive()
+ {
+ tlog.Debug(tag, $"ScrollViewSetScrollSensitive START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ try
+ {
+ testingTarget.SetScrollSensitive(true);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetScrollSensitive END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetMaxOvershoot.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetMaxOvershoot M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetMaxOvershoot()
+ {
+ tlog.Debug(tag, $"ScrollViewSetMaxOvershoot START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ try
+ {
+ testingTarget.SetMaxOvershoot(0.2f, 0.4f);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetMaxOvershoot END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetSnapOvershootAlphaFunction.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetSnapOvershootAlphaFunction M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetSnapOvershootAlphaFunction()
+ {
+ tlog.Debug(tag, $"ScrollViewSetSnapOvershootAlphaFunction START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ try
+ {
+ using (AlphaFunction alpha = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseOutBack))
+ {
+ testingTarget.SetSnapOvershootAlphaFunction(alpha);
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetSnapOvershootAlphaFunction END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetSnapOvershootDuration.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetSnapOvershootDuration M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetSnapOvershootDuration()
+ {
+ tlog.Debug(tag, $"ScrollViewSetSnapOvershootDuration START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ try
+ {
+ testingTarget.SetSnapOvershootDuration(0.8f);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetSnapOvershootDuration END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetViewAutoSnap.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetViewAutoSnap M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetViewAutoSnap()
+ {
+ tlog.Debug(tag, $"ScrollViewSetViewAutoSnap START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ try
+ {
+ testingTarget.SetViewAutoSnap(true);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetViewAutoSnap END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetWrapMode.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetWrapMode M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetWrapMode()
+ {
+ tlog.Debug(tag, $"ScrollViewSetWrapMode START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ try
+ {
+ testingTarget.SetWrapMode(true);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetWrapMode END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView GetScrollUpdateDistance.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.GetScrollUpdateDistance M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewGetScrollUpdateDistance()
+ {
+ tlog.Debug(tag, $"ScrollViewGetScrollUpdateDistance START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ try
+ {
+ var result = testingTarget.GetScrollUpdateDistance();
+ Assert.IsNotNull(result);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewGetScrollUpdateDistance END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetScrollUpdateDistance.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetScrollUpdateDistance M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetScrollUpdateDistance()
+ {
+ tlog.Debug(tag, $"ScrollViewSetScrollUpdateDistance START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ try
+ {
+ testingTarget.SetScrollUpdateDistance(50);
+ Assert.AreEqual(50, testingTarget.GetScrollUpdateDistance(), "Should be equal!");
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetScrollUpdateDistance END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetAxisAutoLock.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetAxisAutoLock M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetAxisAutoLock()
+ {
+ tlog.Debug(tag, $"ScrollViewSetAxisAutoLock START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ try
+ {
+ testingTarget.SetAxisAutoLock(true);
+ Assert.AreEqual(true, testingTarget.GetAxisAutoLock(), "Should be equal!");
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetAxisAutoLock END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetAxisAutoLockGradient.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetAxisAutoLockGradient M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetAxisAutoLockGradient()
+ {
+ tlog.Debug(tag, $"ScrollViewSetAxisAutoLockGradient START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ try
+ {
+ testingTarget.SetAxisAutoLockGradient(0.6f);
+ Assert.AreEqual(0.6f, testingTarget.GetAxisAutoLockGradient(), "Should be equal!");
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetAxisAutoLockGradient END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetFrictionCoefficient.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetFrictionCoefficient M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetFrictionCoefficient()
+ {
+ tlog.Debug(tag, $"ScrollViewSetFrictionCoefficient START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ try
+ {
+ testingTarget.SetFrictionCoefficient(0.6f);
+ Assert.AreEqual(0.6f, testingTarget.GetFrictionCoefficient(), "Should be equal!");
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetFrictionCoefficient END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetFlickSpeedCoefficient.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetFlickSpeedCoefficient M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetFlickSpeedCoefficient()
+ {
+ tlog.Debug(tag, $"ScrollViewSetFlickSpeedCoefficient START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ try
+ {
+ testingTarget.SetFlickSpeedCoefficient(0.6f);
+ Assert.AreEqual(0.6f, testingTarget.GetFlickSpeedCoefficient(), "Should be equal!");
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetFlickSpeedCoefficient END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetMinimumDistanceForFlick.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetMinimumDistanceForFlick M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetMinimumDistanceForFlick()
+ {
+ tlog.Debug(tag, $"ScrollViewSetMinimumDistanceForFlick START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ try
+ {
+ using (Vector2 vector = new Vector2(0.3f, 0.5f))
+ {
+ testingTarget.SetMinimumDistanceForFlick(vector);
+ Assert.IsNotNull(testingTarget.GetMinimumDistanceForFlick().X);
+ Assert.IsNotNull(testingTarget.GetMinimumDistanceForFlick().Y);
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetMinimumDistanceForFlick END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetMinimumSpeedForFlick.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetMinimumSpeedForFlick M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetMinimumSpeedForFlick()
+ {
+ tlog.Debug(tag, $"ScrollViewSetMinimumSpeedForFlick START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ try
+ {
+ testingTarget.SetMinimumSpeedForFlick(0.6f);
+ Assert.AreEqual(0.6f, testingTarget.GetMinimumSpeedForFlick(), "Should be equal!");
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetMinimumSpeedForFlick END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetMaxFlickSpeed.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetMaxFlickSpeed M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetMaxFlickSpeed()
+ {
+ tlog.Debug(tag, $"ScrollViewSetMaxFlickSpeed START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ try
+ {
+ testingTarget.SetMaxFlickSpeed(2.0f);
+ Assert.AreEqual(2.0f, testingTarget.GetMaxFlickSpeed(), "Should be equal!");
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetMaxFlickSpeed END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView GetCurrentScrollPosition.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.GetCurrentScrollPosition M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewGetCurrentScrollPosition()
+ {
+ tlog.Debug(tag, $"ScrollViewGetCurrentScrollPosition START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ try
+ {
+ var result = testingTarget.GetCurrentScrollPosition();
+ Assert.IsNotNull(result.X);
+ Assert.IsNotNull(result.Y);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewGetCurrentScrollPosition END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView GetCurrentPage.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.GetCurrentPage M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewGetCurrentPage()
+ {
+ tlog.Debug(tag, $"ScrollViewGetCurrentPage START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ try
+ {
+ var result = testingTarget.GetCurrentPage();
+ Assert.IsNotNull(result);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewGetCurrentPage END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView ScrollTo.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.ScrollTo M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewScrollTo()
+ {
+ tlog.Debug(tag, $"ScrollViewScrollTo START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ try
+ {
+ using (Vector2 vector = new Vector2(0.3f, 0.5f))
+ {
+ testingTarget.ScrollTo(vector);
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewScrollTo END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView ScrollTo. With duration.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.ScrollTo M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewScrollToSpecifyDuration()
+ {
+ tlog.Debug(tag, $"ScrollViewScrollToSpecifyDuration START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ try
+ {
+ using (Vector2 vector = new Vector2(0.3f, 0.5f))
+ {
+ testingTarget.ScrollTo(vector, 300);
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewScrollToSpecifyDuration END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView ScrollToSnapPoint.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.ScrollToSnapPoint M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewScrollToSnapPoint()
+ {
+ tlog.Debug(tag, $"ScrollViewScrollToSnapPoint START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ try
+ {
+ var result = testingTarget.ScrollToSnapPoint();
+ Assert.IsNotNull(result);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewScrollToSnapPoint END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView ApplyEffect.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.ApplyEffect M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewApplyEffect()
+ {
+ tlog.Debug(tag, $"ScrollViewApplyEffect START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ using (Path path = new Path())
+ {
+ using (Vector2 stageSize = Window.Instance.WindowSize)
+ {
+ using (Vector3 TABLE_RELATIVE_SIZE = new Vector3(0.95f, 0.9f, 0.8f))
+ {
+ ScrollViewPagePathEffect effect = new ScrollViewPagePathEffect(path,
+ new Vector3(-1.0f, 0.0f, 0.0f),
+ ScrollView.Property.ScrollFinalX,
+ new Vector3(stageSize.X * TABLE_RELATIVE_SIZE.X, stageSize.Y * TABLE_RELATIVE_SIZE.Y, 0.0f),
+ 3);
+ try
+ {
+ testingTarget.ApplyEffect(effect);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+ }
+ }
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewApplyEffect END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView RemoveEffect.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.RemoveEffect M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewRemoveEffect()
+ {
+ tlog.Debug(tag, $"ScrollViewRemoveEffect START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ using (Path path = new Path())
+ {
+ using (Vector2 stageSize = Window.Instance.WindowSize)
+ {
+ using (Vector3 TABLE_RELATIVE_SIZE = new Vector3(0.95f, 0.9f, 0.8f))
+ {
+ ScrollViewPagePathEffect effect = new ScrollViewPagePathEffect(path,
+ new Vector3(-1.0f, 0.0f, 0.0f),
+ ScrollView.Property.ScrollFinalX,
+ new Vector3(stageSize.X * TABLE_RELATIVE_SIZE.X, stageSize.Y * TABLE_RELATIVE_SIZE.Y, 0.0f),
+ 3);
+ testingTarget.ApplyEffect(effect);
+
+ try
+ {
+ testingTarget.RemoveEffect(effect);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+ }
+ }
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewRemoveEffect END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView BindView.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.BindView M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewBindView()
+ {
+ tlog.Debug(tag, $"ScrollViewBindView START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ using (View view = new View())
+ {
+ view.Size = new Size(80, 120);
+
+ try
+ {
+ testingTarget.BindView(view);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewBindView END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView UnbindView.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.UnbindView M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewUnbindView()
+ {
+ tlog.Debug(tag, $"ScrollViewUnbindView START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ using (View view = new View())
+ {
+ view.Size = new Size(80, 120);
+ testingTarget.BindView(view);
+
+ try
+ {
+ testingTarget.UnbindView(view);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewUnbindView END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetScrollingDirection. With threshold.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetScrollingDirection M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetScrollingDirectionWithThreshold()
+ {
+ tlog.Debug(tag, $"ScrollViewSetScrollingDirectionWithThreshold START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ using (Radian direction = new Radian(2.0f))
+ {
+ using (Radian threshold = new Radian(4.5f))
+ {
+ try
+ {
+ testingTarget.SetScrollingDirection(direction, threshold);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+ }
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetScrollingDirectionWithThreshold END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetScrollingDirection.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetScrollingDirection M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetScrollingDirection()
+ {
+ tlog.Debug(tag, $"ScrollViewSetScrollingDirection START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ using (Radian direction = new Radian(2.0f))
+ {
+ try
+ {
+ testingTarget.SetScrollingDirection(direction);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetScrollingDirection END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView RemoveScrollingDirection.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetScrollingDirection M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewRemoveScrollingDirection()
+ {
+ tlog.Debug(tag, $"ScrollViewRemoveScrollingDirection START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ using (Radian direction = new Radian(2.0f))
+ {
+ testingTarget.SetScrollingDirection(direction);
+
+ try
+ {
+ testingTarget.RemoveScrollingDirection(direction);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewRemoveScrollingDirection END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollView SetRulerX.")]
+ [Property("SPEC", "Tizen.NUI.ScrollView.SetRulerX M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewSetRulerX()
+ {
+ tlog.Debug(tag, $"ScrollViewSetRulerX START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ using (TableView page = new TableView(3, 2))
+ {
+ testingTarget.Add(page);
+
+ try
+ {
+ testingTarget.SetRulerX(new RulerPtr(new FixedRuler(1024.0f)));
+ testingTarget.SetRulerY(new RulerPtr(new DefaultRuler()));
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewSetRulerX 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;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Utility/ScrollViewEffect")]
+ public class PublicScrollViewEffectTest
+ {
+ private const string tag = "NUITEST";
+
+ internal class MyScrollViewEffect : ScrollViewEffect
+ {
+ public MyScrollViewEffect() : base()
+ { }
+
+ public void OnReleaseSwigCPtr(global::System.Runtime.InteropServices.HandleRef swigCPtr)
+ {
+ base.ReleaseSwigCPtr(swigCPtr);
+ }
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollViewEffect constructor.")]
+ [Property("SPEC", "Tizen.NUI.ScrollViewEffect.ScrollViewEffect C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewEffectConstructor()
+ {
+ tlog.Debug(tag, $"ScrollViewEffectConstructor START");
+
+ var testingTarget = new ScrollViewEffect();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollViewEffect");
+ Assert.IsInstanceOf<ScrollViewEffect>(testingTarget, "Should be an instance of ScrollViewEffect type.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewEffectConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollViewEffect ReleaseSwigCPtr.")]
+ [Property("SPEC", "Tizen.NUI.ScrollViewEffect.ReleaseSwigCPtr M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewEffectReleaseSwigCPtr()
+ {
+ tlog.Debug(tag, $"ScrollViewEffectReleaseSwigCPtr START");
+
+ var testingTarget = new MyScrollViewEffect();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollViewEffect");
+ Assert.IsInstanceOf<ScrollViewEffect>(testingTarget, "Should be an instance of ScrollViewEffect type.");
+
+ try
+ {
+ testingTarget.OnReleaseSwigCPtr(testingTarget.SwigCPtr);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"ScrollViewEffectReleaseSwigCPtr 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;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Utility/ScrollViewEvent")]
+ public class PublicScrollViewEventTest
+ {
+ private const string tag = "NUITEST";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollViewEvent.SnapEvent constructor.")]
+ [Property("SPEC", "Tizen.NUI.ScrollViewEvent.SnapEvent.SnapEvent C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewEventSnapEventConstructor()
+ {
+ tlog.Debug(tag, $"ScrollViewEventSnapEventConstructor START");
+
+ var testingTarget = new ScrollView.SnapEvent();
+ Assert.IsNotNull(testingTarget, "Can't create success object SnapEvent");
+ Assert.IsInstanceOf<ScrollView.SnapEvent>(testingTarget, "Should be an instance of SnapEvent type.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewEventSnapEventConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollViewEvent.SnapEvent SnapStarted.")]
+ [Property("SPEC", "Tizen.NUI.ScrollViewEvent.SnapEvent.SnapStarted A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewEventSnapEventSnapStarted()
+ {
+ tlog.Debug(tag, $"ScrollViewEventSnapEventSnapStarted START");
+
+ var testingTarget = new ScrollView();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollView");
+ Assert.IsInstanceOf<ScrollView>(testingTarget, "Should be an instance of ScrollView type.");
+
+ testingTarget.SnapStarted += OnSnapStarted;
+ testingTarget.SnapStarted -= OnSnapStarted;
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewEventSnapEventSnapStarted END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollViewEvent.SnapEvent position.")]
+ [Property("SPEC", "Tizen.NUI.ScrollViewEvent.SnapEvent.position A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewEventSnapEventPosition()
+ {
+ tlog.Debug(tag, $"ScrollViewEventSnapEventPosition START");
+
+ var testingTarget = new ScrollView.SnapEvent();
+ Assert.IsNotNull(testingTarget, "Can't create success object SnapEvent");
+ Assert.IsInstanceOf<ScrollView.SnapEvent>(testingTarget, "Should be an instance of SnapEvent type.");
+
+ testingTarget.position = new Vector2(20, 30);
+ Assert.AreEqual(20, testingTarget.position.X, "Should be equal!");
+ Assert.AreEqual(30, testingTarget.position.Y, "Should be equal!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewEventSnapEventPosition END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollViewEvent.SnapEvent duration.")]
+ [Property("SPEC", "Tizen.NUI.ScrollViewEvent.SnapEvent.duration A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewEventSnapEventDuration()
+ {
+ tlog.Debug(tag, $"ScrollViewEventSnapEventDuration START");
+
+ var testingTarget = new ScrollView.SnapEvent();
+ Assert.IsNotNull(testingTarget, "Can't create success object SnapEvent");
+ Assert.IsInstanceOf<ScrollView.SnapEvent>(testingTarget, "Should be an instance of SnapEvent type.");
+
+ testingTarget.duration = 0.5f;
+ Assert.AreEqual(0.5f, testingTarget.duration, "Should be equal!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewEventSnapEventDuration END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollViewEvent.SnapEvent type.")]
+ [Property("SPEC", "Tizen.NUI.ScrollViewEvent.SnapEvent.type A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewEventSnapEventType()
+ {
+ tlog.Debug(tag, $"ScrollViewEventSnapEventType START");
+
+ var testingTarget = new ScrollView.SnapEvent();
+ Assert.IsNotNull(testingTarget, "Can't create success object SnapEvent");
+ Assert.IsInstanceOf<ScrollView.SnapEvent>(testingTarget, "Should be an instance of SnapEvent type.");
+
+ testingTarget.type = SnapType.Snap;
+ Assert.AreEqual(SnapType.Snap, testingTarget.type, "Should be equal!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewEventSnapEventType END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollViewEvent.SnapEvent GetSnapEventFromPtr.")]
+ [Property("SPEC", "Tizen.NUI.ScrollViewEvent.SnapEvent.GetSnapEventFromPtr M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewEventSnapEventGetSnapEventFromPtr()
+ {
+ tlog.Debug(tag, $"ScrollViewEventSnapEventGetSnapEventFromPtr START");
+
+ var testingTarget = new ScrollView.SnapEvent();
+ Assert.IsNotNull(testingTarget, "Can't create success object SnapEvent");
+ Assert.IsInstanceOf<ScrollView.SnapEvent>(testingTarget, "Should be an instance of SnapEvent type.");
+
+ var result = ScrollView.SnapEvent.GetSnapEventFromPtr(testingTarget.SwigCPtr.Handle);
+ Assert.IsNotNull(result, "Can't create success object SnapEvent");
+ Assert.IsInstanceOf<ScrollView.SnapEvent>(result, "Should be an instance of SnapEvent type.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollViewEventSnapEventGetSnapEventFromPtr END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollViewEvent.SnapStartedEventArgs SnapEventInfo.")]
+ [Property("SPEC", "Tizen.NUI.ScrollViewEvent.SnapStartedEventArgs.SnapEventInfo A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewEventSnapStartedEventArgsSnapEventInfo()
+ {
+ tlog.Debug(tag, $"ScrollViewEventSnapStartedEventArgsSnapEventInfo START");
+
+ var testingTarget = new ScrollView.SnapStartedEventArgs();
+ Assert.IsNotNull(testingTarget, "Can't create success object SnapStartedEventArgs");
+ Assert.IsInstanceOf<ScrollView.SnapStartedEventArgs>(testingTarget, "Should be an instance of SnapStartedEventArgs type.");
+
+ testingTarget.SnapEventInfo = new ScrollView.SnapEvent();
+ Assert.IsNotNull(testingTarget.SnapEventInfo);
+
+ tlog.Debug(tag, $"ScrollViewEventSnapStartedEventArgsSnapEventInfo END (OK)");
+ }
+
+ private void OnSnapStarted(object sender, ScrollView.SnapStartedEventArgs e)
+ { }
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using System.Collections.Generic;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Utility/ScrollViewPagePathEffect")]
+ public class PublicScrollViewPagePathEffectTest
+ {
+ private const string tag = "NUITEST";
+
+ internal class MyScrollViewPagePathEffect : ScrollViewPagePathEffect
+ {
+ private static Path path = new Path();
+ private static Vector3 forward = new Vector3(2, 4, 6);
+ private static int inputPropertyIndex = 1;
+ private static Vector3 pageSize = new Vector3(6, 8, 10);
+ private static uint pageCount = 5;
+
+ public MyScrollViewPagePathEffect() : base(path, forward, inputPropertyIndex, pageSize, pageCount)
+ { }
+
+ public void OnReleaseSwigCPtr(global::System.Runtime.InteropServices.HandleRef swigCPtr)
+ {
+ base.ReleaseSwigCPtr(swigCPtr);
+ }
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollViewPagePathEffect constructor.")]
+ [Property("SPEC", "Tizen.NUI.ScrollViewPagePathEffect.ScrollViewPagePathEffect C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewPagePathEffectConstructor()
+ {
+ tlog.Debug(tag, $"ScrollViewPagePathEffectConstructor START");
+
+ using (Path path = new Path())
+ {
+ using (Vector3 forword = new Vector3(2, 4, 6))
+ {
+ using (Vector3 pageSize = new Vector3(6, 8, 10))
+ {
+ var testingTarget = new ScrollViewPagePathEffect(path, forword, 1, pageSize, 5);
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollViewPagePathEffect");
+ Assert.IsInstanceOf<ScrollViewPagePathEffect>(testingTarget, "Should be an instance of ScrollViewPagePathEffect type.");
+
+ testingTarget.Dispose();
+ }
+ }
+ }
+
+ tlog.Debug(tag, $"ScrollViewPagePathEffectConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollViewPagePathEffect DownCast.")]
+ [Property("SPEC", "Tizen.NUI.ScrollViewPagePathEffect.DownCast M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewPagePathEffectDownCast()
+ {
+ tlog.Debug(tag, $"ScrollViewPagePathEffectDownCast START");
+
+ using (Path path = new Path())
+ {
+ using (Vector3 forword = new Vector3(2, 4, 6))
+ {
+ using (Vector3 pageSize = new Vector3(6, 8, 10))
+ {
+ var testingTarget = new ScrollViewPagePathEffect(path, forword, 1, pageSize, 5);
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollViewPagePathEffect");
+ Assert.IsInstanceOf<ScrollViewPagePathEffect>(testingTarget, "Should be an instance of ScrollViewPagePathEffect type.");
+
+ var result = ScrollViewPagePathEffect.DownCast(testingTarget);
+ Assert.IsNotNull(result, "Can't create success object ScrollViewPagePathEffect");
+ Assert.IsInstanceOf<ScrollViewPagePathEffect>(result, "Should be an instance of ScrollViewPagePathEffect type.");
+
+ testingTarget.Dispose();
+ }
+ }
+ }
+
+ tlog.Debug(tag, $"ScrollViewPagePathEffectDownCast END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollViewPagePathEffect ApplyToPage.")]
+ [Property("SPEC", "Tizen.NUI.ScrollViewPagePathEffect.ApplyToPage M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewPagePathEffectApplyToPage()
+ {
+ tlog.Debug(tag, $"ScrollViewPagePathEffectApplyToPage START");
+
+ using (Path path = new Path())
+ {
+ using (Vector3 forword = new Vector3(2, 4, 6))
+ {
+ using (Vector3 pageSize = new Vector3(6, 8, 10))
+ {
+ var testingTarget = new ScrollViewPagePathEffect(path, forword, 1, pageSize, 5);
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollViewPagePathEffect");
+ Assert.IsInstanceOf<ScrollViewPagePathEffect>(testingTarget, "Should be an instance of ScrollViewPagePathEffect type.");
+
+ try
+ {
+ using (View view = new View())
+ {
+ testingTarget.ApplyToPage(view, 2);
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ testingTarget.Dispose();
+ }
+ }
+ }
+
+ tlog.Debug(tag, $"ScrollViewPagePathEffectApplyToPage END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollViewPagePathEffect ReleaseSwigCPtr.")]
+ [Property("SPEC", "Tizen.NUI.ScrollViewPagePathEffect.ReleaseSwigCPtr M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollViewPagePathEffectReleaseSwigCPtr()
+ {
+ tlog.Debug(tag, $"ScrollViewPagePathEffectReleaseSwigCPtr START");
+
+ var testingTarget = new MyScrollViewPagePathEffect();
+ Assert.IsNotNull(testingTarget, "Can't create success object ScrollViewPagePathEffect");
+ Assert.IsInstanceOf<ScrollViewPagePathEffect>(testingTarget, "Should be an instance of ScrollViewPagePathEffect type.");
+
+ try
+ {
+ testingTarget.OnReleaseSwigCPtr(testingTarget.SwigCPtr);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"ScrollViewPagePathEffectReleaseSwigCPtr 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;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Utility/TTSPlayer")]
+ class PublicTTSPlayerTest
+ {
+ private const string tag = "NUITEST";
+ private bool flagStateChanged = false;
+ private string image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("TTSPlayer constructor. With TTSPlayer handler.")]
+ [Property("SPEC", "Tizen.NUI.TTSPlayer.TTSPlayer C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TTSPlayerConstructorWithTTSPlayerHandler()
+ {
+ tlog.Debug(tag, $"TTSPlayerConstructorWithTTSPlayerHandler START");
+
+ using (TTSPlayer player = TTSPlayer.Get())
+ {
+ var testingTarget = new TTSPlayer(player);
+ Assert.IsNotNull(testingTarget, "Can't create success object TTSPlayer");
+ Assert.IsInstanceOf<TTSPlayer>(testingTarget, "Should be an instance of TTSPlayer type.");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"TTSPlayerConstructorWithTTSPlayerHandler END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("TTSPlayer StateChanged.")]
+ [Property("SPEC", "Tizen.NUI.TTSPlayer.StateChanged A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TTSPlayerStateChanged()
+ {
+ tlog.Debug(tag, $"TTSPlayerStateChanged START");
+
+ using (TTSPlayer player = TTSPlayer.Get())
+ {
+ var testingTarget = new TTSPlayer(player);
+ Assert.IsNotNull(testingTarget, "Can't create success object TTSPlayer");
+ Assert.IsInstanceOf<TTSPlayer>(testingTarget, "Should be an instance of TTSPlayer type.");
+
+ testingTarget.StateChanged += StateChangedEvent;
+ testingTarget.StateChanged -= StateChangedEvent;
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"TTSPlayerStateChanged END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("TTSPlayer StateChangedSignal.")]
+ [Property("SPEC", "Tizen.NUI.TTSPlayer.StateChangedSignal M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TTSPlayerStateChangedSignal()
+ {
+ tlog.Debug(tag, $"TTSPlayerStateChangedSignal START");
+
+ using (TTSPlayer player = TTSPlayer.Get())
+ {
+ var testingTarget = new TTSPlayer(player);
+ Assert.IsNotNull(testingTarget, "Can't create success object TTSPlayer");
+ Assert.IsInstanceOf<TTSPlayer>(testingTarget, "Should be an instance of TTSPlayer type.");
+
+ var result = testingTarget.StateChangedSignal();
+ Assert.IsNotNull(result, "Can't create success object StateChangedSignalType");
+ Assert.IsInstanceOf<StateChangedSignalType>(result, "Should be an instance of StateChangedSignalType type.");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"TTSPlayerStateChangedSignal END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("TTSPlayer Assign.")]
+ [Property("SPEC", "Tizen.NUI.TTSPlayer.Assign M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TTSPlayerAssign()
+ {
+ tlog.Debug(tag, $"TTSPlayerAssign START");
+
+ using (TTSPlayer player = new TTSPlayer())
+ {
+ using (TTSPlayer rhs = TTSPlayer.Get(TTSPlayer.TTSMode.ScreenReader))
+ {
+ var testingTarget = player.Assign(rhs);
+ Assert.IsNotNull(testingTarget, "Can't create success object TTSPlayer");
+ Assert.IsInstanceOf<TTSPlayer>(testingTarget, "Should be an instance of TTSPlayer type.");
+
+ testingTarget.Dispose();
+ }
+ }
+
+ tlog.Debug(tag, $"TTSPlayerAssign END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("StateChangedEventArgs PrevState.")]
+ [Property("SPEC", "Tizen.NUI.StateChangedEventArgs.PrevState A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TTSPlayerStateChangedEventArgsPrevState()
+ {
+ tlog.Debug(tag, $"TTSPlayerStateChangedEventArgsPrevState START");
+
+ var testingTarget = new TTSPlayer.StateChangedEventArgs();
+ Assert.IsNotNull(testingTarget, "Can't create success object StateChangedEventArgs");
+ Assert.IsInstanceOf<TTSPlayer.StateChangedEventArgs>(testingTarget, "Should be an instance of StateChangedEventArgs type.");
+
+ testingTarget.PrevState = TTSPlayer.TTSState.Ready;
+ Assert.AreEqual(TTSPlayer.TTSState.Ready, testingTarget.PrevState);
+
+ tlog.Debug(tag, $"TTSPlayerStateChangedEventArgsPrevState END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("StateChangedEventArgs NextState.")]
+ [Property("SPEC", "Tizen.NUI.StateChangedEventArgs.NextState A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TTSPlayerStateChangedEventArgsNextState()
+ {
+ tlog.Debug(tag, $"TTSPlayerStateChangedEventArgsNextState START");
+
+ var testingTarget = new TTSPlayer.StateChangedEventArgs();
+ Assert.IsNotNull(testingTarget, "Can't create success object StateChangedEventArgs");
+ Assert.IsInstanceOf<TTSPlayer.StateChangedEventArgs>(testingTarget, "Should be an instance of StateChangedEventArgs type.");
+
+ testingTarget.NextState = TTSPlayer.TTSState.Playing;
+ Assert.AreEqual(TTSPlayer.TTSState.Playing, testingTarget.NextState);
+
+ tlog.Debug(tag, $"TTSPlayerStateChangedEventArgsNextState END (OK)");
+ }
+
+ private void StateChangedEvent(object sender, TTSPlayer.StateChangedEventArgs args)
+ {
+ flagStateChanged = true;
+ }
+ }
+}
--- /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.Utility;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Utility/TextPageUtil")]
+ class PublicTextPageUtilTest
+ {
+ private const string tag = "NUITEST";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("TextPageUtil SetText.")]
+ [Property("SPEC", "Tizen.NUI.TextPageUtil.SetText M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TextPageUtilSetText()
+ {
+ tlog.Debug(tag, $"TextPageUtilSetText START");
+
+ TextPageUtil testingTarget = new TextPageUtil();
+ Assert.IsNotNull(testingTarget, "Can't create success object TextPageUtil");
+ Assert.IsInstanceOf<TextPageUtil>(testingTarget, "Should be an instance of TextPageUtil type.");
+
+ using (TextLabel label = new TextLabel())
+ {
+ label.EnableMarkup = true;
+ label.Text = "PublicPageUtilTest";
+ var result = testingTarget.SetText(label, "MyPageUtil");
+ Assert.IsNotNull(result);
+ }
+
+ // label.EnableMarkup = false
+ using (TextLabel label = new TextLabel())
+ {
+ label.EnableMarkup = false;
+ label.Text = "PublicPageUtilTest";
+ var result = testingTarget.SetText(label, "MyPageUtil");
+ Assert.IsNotNull(result);
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"TextPageUtilSetText END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("TextPageUtil GetText.")]
+ [Property("SPEC", "Tizen.NUI.TextPageUtil.GetText M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TextPageUtilGetText()
+ {
+ tlog.Debug(tag, $"TextPageUtilGetText START");
+
+ TextPageUtil testingTarget = new TextPageUtil();
+ Assert.IsNotNull(testingTarget, "Can't create success object TextPageUtil");
+ Assert.IsInstanceOf<TextPageUtil>(testingTarget, "Should be an instance of TextPageUtil type.");
+
+ using (TextLabel label = new TextLabel())
+ {
+ label.EnableMarkup = true;
+ label.Text = "PublicPageUtilTest";
+ var result = testingTarget.SetText(label, "MyPageUtil");
+ Assert.IsNotNull(result);
+
+ /** if param is 0 will return */
+ try
+ {
+ testingTarget.GetText(0);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ try
+ {
+ testingTarget.GetText(1);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"TextPageUtilGetText 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;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Utility/Timer")]
+ class PublicTimerTest
+ {
+ private const string tag = "NUITEST";
+
+ internal class MyTimer : Timer
+ {
+ public MyTimer(uint milliSec) : base(milliSec)
+ { }
+
+ public void OnDispose(DisposeTypes type)
+ {
+ base.Dispose(type);
+ }
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Timer constructor. With Timer instance.")]
+ [Property("SPEC", "Tizen.NUI.Timer.Timer C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TimerConstructorWithTimer()
+ {
+ tlog.Debug(tag, $"TimerConstructorWithTimer START");
+
+ using (var timer = new Timer(100))
+ {
+ var testingTarget = new Timer(timer);
+ Assert.IsNotNull(testingTarget, "Can't create success object Timer");
+ Assert.IsInstanceOf<Timer>(testingTarget, "Should be an instance of Timer type.");
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"TimerConstructorWithTimer END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Timer Tick.")]
+ [Property("SPEC", "Tizen.NUI.Timer.Tick A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TimerTick()
+ {
+ tlog.Debug(tag, $"TimerTick START");
+
+ var testingTarget = new Timer(100);
+ Assert.IsNotNull(testingTarget, "Can't create success object Timer");
+ Assert.IsInstanceOf<Timer>(testingTarget, "Should be an instance of Timer type.");
+
+ testingTarget.Tick += MyTickEvent;
+ testingTarget.Tick -= MyTickEvent;
+
+ testingTarget.Dispose();
+
+ tlog.Debug(tag, $"TimerTick END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Timer SetInterval. Timer is disposed.")]
+ [Property("SPEC", "Tizen.NUI.Timer.SetInterval M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TimerSetIntervalWithDisposedInstance()
+ {
+ tlog.Debug(tag, $"TimerSetIntervalWithDisposedInstance START");
+
+ var testingTarget = new Timer(100);
+ Assert.IsNotNull(testingTarget, "Can't create success object Timer");
+ Assert.IsInstanceOf<Timer>(testingTarget, "Should be an instance of Timer type.");
+
+ testingTarget.Dispose();
+
+ try
+ {
+ testingTarget.SetInterval(100);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"TimerSetIntervalWithDisposedInstance END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Timer GetInterval. Timer is disposed.")]
+ [Property("SPEC", "Tizen.NUI.Timer.GetInterval M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TimerGetIntervalWithDisposedInstance()
+ {
+ tlog.Debug(tag, $"TimerGetIntervalWithDisposedInstance START");
+
+ var testingTarget = new Timer(100);
+ Assert.IsNotNull(testingTarget, "Can't create success object Timer");
+ Assert.IsInstanceOf<Timer>(testingTarget, "Should be an instance of Timer type.");
+
+ testingTarget.SetInterval(100);
+ testingTarget.Dispose();
+
+ try
+ {
+ testingTarget.GetInterval();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"TimerGetIntervalWithDisposedInstance END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Timer Start. Timer is disposed.")]
+ [Property("SPEC", "Tizen.NUI.Timer.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TimerStartWithDisposedInstance()
+ {
+ tlog.Debug(tag, $"TimerStartWithDisposedInstance START");
+
+ var testingTarget = new MyTimer(100);
+ Assert.IsNotNull(testingTarget, "Can't create success object Timer");
+ Assert.IsInstanceOf<Timer>(testingTarget, "Should be an instance of Timer type.");
+
+ testingTarget.OnDispose(DisposeTypes.Explicit);
+
+ try
+ {
+ testingTarget.Start();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"TimerStartWithDisposedInstance END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Timer Stop. Timer is disposed.")]
+ [Property("SPEC", "Tizen.NUI.Timer.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TimerStopWithDisposedInstance()
+ {
+ tlog.Debug(tag, $"TimerStopWithDisposedInstance START");
+
+ var testingTarget = new MyTimer(100);
+ Assert.IsNotNull(testingTarget, "Can't create success object Timer");
+ Assert.IsInstanceOf<Timer>(testingTarget, "Should be an instance of Timer type.");
+
+ testingTarget.Start();
+ testingTarget.OnDispose(DisposeTypes.Explicit);
+
+ try
+ {
+ testingTarget.Stop();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"TimerStopWithDisposedInstance END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Timer IsRunning. Timer is disposed.")]
+ [Property("SPEC", "Tizen.NUI.Timer.Start M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TimerIsRunningWithDisposedInstance()
+ {
+ tlog.Debug(tag, $"TimerIsRunningWithDisposedInstance START");
+
+ var testingTarget = new MyTimer(100);
+ Assert.IsNotNull(testingTarget, "Can't create success object Timer");
+ Assert.IsInstanceOf<Timer>(testingTarget, "Should be an instance of Timer type.");
+
+ testingTarget.Start();
+ testingTarget.OnDispose(DisposeTypes.Explicit);
+
+ try
+ {
+ var result = testingTarget.IsRunning();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"TimerIsRunningWithDisposedInstance END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Timer Dispose. Timer is disposed.")]
+ [Property("SPEC", "Tizen.NUI.Timer.GetInterval M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TimerDisposeWithDisposedInstance()
+ {
+ tlog.Debug(tag, $"TimerDisposeWithDisposedInstance START");
+
+ var testingTarget = new MyTimer(100);
+ Assert.IsNotNull(testingTarget, "Can't create success object Timer");
+ Assert.IsInstanceOf<Timer>(testingTarget, "Should be an instance of Timer type.");
+
+ testingTarget.OnDispose(DisposeTypes.Explicit);
+
+ try
+ {
+ testingTarget.OnDispose(DisposeTypes.Explicit);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception: Failed!");
+ }
+
+ tlog.Debug(tag, $"TimerDisposeWithDisposedInstance END (OK)");
+ }
+
+ private bool MyTickEvent(object source, Timer.TickEventArgs e)
+ {
+ return false;
+ }
+ }
+}