*/
using NUnit.Framework;
+using System;
namespace Tizen.Multimedia.Remoting.Tests {
Assert.That(() => new MediaFileSource(MediaType.Video, null), Throws.ArgumentNullException,
"Should throw ArgumentNullException");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether IsLooping returns expected value or not.")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaFileSource.IsLooping A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void IsLooping_READ_WRITE()
+ {
+ using (var webRtc = new WebRTC())
+ {
+ var source = new MediaFileSource(MediaType.Video, VideoFilePath);
+ webRtc.AddSource(source);
+
+ source.IsLooping = true;
+ Assert.That(source.IsLooping, Is.EqualTo(true),
+ "Should return same value");
+
+ source.IsLooping = false;
+ Assert.That(source.IsLooping, Is.EqualTo(false),
+ "Should return same value");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether IsLooping returns expected default value or not.")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaFileSource.IsLooping A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PDV")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void IsLooping_CHECK_DEFAULT_VALUE()
+ {
+ using (var webRtc = new WebRTC())
+ {
+ var source = new MediaFileSource(MediaType.Video, VideoFilePath);
+ webRtc.AddSource(source);
+
+ Assert.That(source.IsLooping, Is.EqualTo(false),
+ "Should return proper default value - false");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether IsLooping throws exception(setter) or return false(getter) when it's not attached.")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaFileSource.IsLooping A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void IsLooping_THROWS_IF_NOT_ATTACHED()
+ {
+ var source = new MediaFileSource(MediaType.Video, VideoFilePath);
+
+ Assert.That(() => source.IsLooping = true, Throws.InvalidOperationException,
+ "Should return InvalidOperationException");
+
+ Assert.That(() => source.IsLooping, Is.EqualTo(false),
+ "Should return default value - false");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether IsLooping throws exception when it's already disposed.")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaFileSource.IsLooping A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void IsLooping_THROWS_IF_ALREADY_DISPOSED()
+ {
+ using (var webRtc = new WebRTC())
+ {
+ var source = new MediaFileSource(MediaType.Video, VideoFilePath);
+ webRtc.AddSource(source);
+
+ webRtc.Dispose();
+
+ Assert.That(() => source.IsLooping, Throws.TypeOf<ObjectDisposedException>(),
+ "Should return ObjectDisposedException");
+
+ Assert.That(() => source.IsLooping = true, Throws.TypeOf<ObjectDisposedException>(),
+ "Should return ObjectDisposedException");
+ }
+
+ }
}
}
\ No newline at end of file