From d3c39da571b87e9ca363627d4ce2916678773fd7 Mon Sep 17 00:00:00 2001 From: Haesu Gwon Date: Wed, 6 Jul 2022 17:23:45 +0900 Subject: [PATCH] [TCSACR-488][WebRTC] Add new MediaFileSource IsLooping API Change-Id: I69ab71c6445b30d68553f671ba7b6196fd0c37f7 --- .../testcase/TSMediaFileSource.cs | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/tct-suite-vs/Tizen.WebRTC.Tests/testcase/TSMediaFileSource.cs b/tct-suite-vs/Tizen.WebRTC.Tests/testcase/TSMediaFileSource.cs index 33a2d5d..bf6360b 100755 --- a/tct-suite-vs/Tizen.WebRTC.Tests/testcase/TSMediaFileSource.cs +++ b/tct-suite-vs/Tizen.WebRTC.Tests/testcase/TSMediaFileSource.cs @@ -15,6 +15,7 @@ */ using NUnit.Framework; +using System; namespace Tizen.Multimedia.Remoting.Tests { @@ -75,5 +76,91 @@ 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(), + "Should return ObjectDisposedException"); + + Assert.That(() => source.IsLooping = true, Throws.TypeOf(), + "Should return ObjectDisposedException"); + } + + } } } \ No newline at end of file -- 2.7.4