Assert.That(TestPlayer.AdaptiveVariants, Is.Not.Null);
}
#endregion
+
+ #region VideoRoi
+ [Test]
+ [Category("P1")]
+ [Description("SetVideoRoi default test")]
+ [Property("SPEC", "Tizen.Multimedia.Player.SetVideoRoi M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MCST")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public void SetVideoRoi_DEFAULT()
+ {
+ Player player = new Player();
+ player.SetSource(Constants.VideoFileSource);
+ player.Display = new Display(CreateWindow());
+
+ ScaleRectangle sr = new ScaleRectangle(0.19, 0.98765, 1.0, 0.21548);
+
+ Assert.That(() => player.SetVideoRoi(sr), Throws.Nothing);
+ Assert.That(player.GetVideoRoi(), Is.EqualTo(sr), "Invalid value.");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Any attempt to call the SetVideoRoi if the player has been disposed of")]
+ [Property("SPEC", "Tizen.Multimedia.Player.SetVideoRoi M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public void SetVideoRoi_DISPOSED()
+ {
+ GetIdlePlayer().Dispose();
+
+ Assert.That(() => TestPlayer.SetVideoRoi(new ScaleRectangle(0.1, 0.1, 0.3, 0.4)),
+ Throws.TypeOf<ObjectDisposedException>());
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("SetVideoRoi throws exceptions if out of range")]
+ [Property("SPEC", "Tizen.Multimedia.Player.SetVideoRoi M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public void SetVideoRoi_OUT_OF_RANGE()
+ {
+ Player player = new Player();
+ player.SetSource(Constants.VideoFileSource);
+ player.Display = new Display(CreateWindow());
+
+ Assert.That(() => player.SetVideoRoi(new ScaleRectangle(0, 0, 0, 0)), Throws.TypeOf<ArgumentOutOfRangeException>());
+ Assert.That(() => player.SetVideoRoi(new ScaleRectangle(0.1, 0.1, 0.18, 4)), Throws.TypeOf<ArgumentOutOfRangeException>());
+ Assert.That(() => player.SetVideoRoi(new ScaleRectangle(0.99, -0.1, 1, 1)), Throws.TypeOf<ArgumentOutOfRangeException>());
+ Assert.That(() => player.SetVideoRoi(new ScaleRectangle(0.1, 0.1, 1.1, 1)), Throws.TypeOf<ArgumentOutOfRangeException>());
+ Assert.That(() => player.SetVideoRoi(new ScaleRectangle(-3, 0.1, 1, 1)), Throws.TypeOf<ArgumentOutOfRangeException>());
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("SetVideoRoi throws if display has wrong type")]
+ [Property("SPEC", "Tizen.Multimedia.Player.SetVideoRoi M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public void SetVideoRoi_THROWS_IF_WRONG_DISPLAY_SET()
+ {
+ var player = GetIdlePlayer();
+ player.SetSource(Constants.VideoFileSource);
+
+ Assert.That(() => player.SetVideoRoi(new ScaleRectangle(0.1, 0.1, 0.3, 0.4)), Throws.InvalidOperationException);
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GetVideoRoi default test")]
+ [Property("SPEC", "Tizen.Multimedia.Player.GetVideoRoi M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MCST")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public async Task GetVideoRoi_DEFAULT()
+ {
+ var player = await GetPreparedPlayer();
+
+ Assert.That(player.GetVideoRoi().ScaleX, Is.EqualTo(0), "Invalid default value. (ScaleX)");
+ Assert.That(player.GetVideoRoi().ScaleY, Is.EqualTo(0), "Invalid default value. (ScaleY)");
+
+ Assert.That(player.GetVideoRoi().ScaleWidth, Is.EqualTo(1), "Invalid default value. (ScaleWidth)");
+ Assert.That(player.GetVideoRoi().ScaleHeight, Is.EqualTo(1), "Invalid default value. (ScaleHeight)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Any attempt to call the GetVideoRoi if the player has been disposed of")]
+ [Property("SPEC", "Tizen.Multimedia.Player.GetVideoRoi M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public void GetVideoRoi_DISPOSED()
+ {
+ GetIdlePlayer().Dispose();
+
+ Assert.That(() => TestPlayer.GetVideoRoi(), Throws.TypeOf<ObjectDisposedException>());
+ }
+ #endregion
}
}
--- /dev/null
+using NUnit.Framework;
+using System;
+using System.IO;
+using System.Threading.Tasks;
+
+namespace Tizen.Multimedia.Tests
+{
+ [TestFixture]
+ [Description("Tizen.Multimedia.ScaleRectangle Tests")]
+ public class ScaleRectangleoTests : TestBase
+ {
+ [Test]
+ [Category("P1")]
+ [Description("Constructor test")]
+ [Property("SPEC", "Tizen.Multimedia.ScaleRectangle.ScaleRectangle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public static void ScaleRectangle_CHECK_RETURN()
+ {
+ Assert.DoesNotThrow(() => new ScaleRectangle(0, 0, 1, 1));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether ScaleX is readable and writable")]
+ [Property("SPEC", "Tizen.Multimedia.ScaleRectangle.ScaleX A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public static void ScaleX_READ_WRITE()
+ {
+ AssertHelper.PropertyReadWrite<ScaleRectangle>(nameof(ScaleRectangle.ScaleX));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether ScaleY is readable and writable")]
+ [Property("SPEC", "Tizen.Multimedia.ScaleRectangle.ScaleY A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public static void ScaleY_READ_WRITE()
+ {
+ AssertHelper.PropertyReadWrite<ScaleRectangle>(nameof(ScaleRectangle.ScaleY));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether ScaleWidth is readable and writable")]
+ [Property("SPEC", "Tizen.Multimedia.ScaleRectangle.ScaleWidth A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public static void ScaleWidth_READ_WRITE()
+ {
+ AssertHelper.PropertyReadWrite<ScaleRectangle>(nameof(ScaleRectangle.ScaleWidth));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether ScaleHeight is readable and writable")]
+ [Property("SPEC", "Tizen.Multimedia.ScaleRectangle.ScaleHeight A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+ public static void ScaleHeight_READ_WRITE()
+ {
+ AssertHelper.PropertyReadWrite<ScaleRectangle>(nameof(ScaleRectangle.ScaleHeight));
+ }
+ }
+}