[MediaController][TCSACR-186][Add new APIs for event and capabilities.] 95/190195/2
authorHaesu Gwon <haesu.gwon@samsung.com>
Fri, 28 Sep 2018 06:12:20 +0000 (15:12 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Fri, 28 Sep 2018 08:30:49 +0000 (17:30 +0900)
Change-Id: Ib0794faa18db580f2fa7836430f0eee118384039

tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControlSearchCondition.cs [new file with mode: 0644]
tct-suite-vs/Tizen.MediaController.Tests/testcase/TSPlaybackCapabilityUpdatedEventArgs.cs [new file with mode: 0644]
tct-suite-vs/Tizen.MediaController.Tests/testcase/TSRepeatModeCapabilityUpdatedEventArgs.cs [new file with mode: 0644]
tct-suite-vs/Tizen.MediaController.Tests/testcase/TSSearchCommandReceivedEventArgs.cs [new file with mode: 0644]
tct-suite-vs/Tizen.MediaController.Tests/testcase/TSShuffleModeCapabilityUpdatedEventArgs.cs [new file with mode: 0644]

diff --git a/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControlSearchCondition.cs b/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControlSearchCondition.cs
new file mode 100644 (file)
index 0000000..291c050
--- /dev/null
@@ -0,0 +1,118 @@
+using NUnit.Framework;
+using System.Linq;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Tizen.Applications;
+
+namespace Tizen.Multimedia.Remoting.Tests
+{
+    [TestFixture]
+    [Description("Testing Tizen.Multimedia.Remoting.MediaControlSearchCondition class")]
+    public class MediaControlSearchConditionTests
+    {
+        private MediaController _controller;
+        private MediaControllerManager _manager;
+        private MediaControlSearchCondition _condition;
+
+        [SetUp]
+        public void SetUp()
+        {
+            MediaControlServer.Start();
+
+            _manager = new MediaControllerManager();
+            _controller = _manager.GetActiveControllers().Single(
+                    c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+            _condition = new MediaControlSearchCondition(MediaControlContentType.Image,
+                MediaControlSearchCategory.Artist, "GD", new Bundle());
+        }
+
+        [TearDown]
+        public void TearDown()
+        {
+            if (MediaControlServer.IsRunning)
+            {
+                MediaControlServer.Stop();
+            }
+
+            _manager.Dispose();
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Create MediaControlSearchCondition instance")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlSearchCondition.MediaControlSearchCondition C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTR")]
+        [Property("COVPARAM", "MediaControlContentType, MediaControlSearchCategory, string, Bundle")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void MediaControlSearchCondition_CHECK_CREATE_CONSTRUCTOR()
+        {
+            Assert.IsNotNull(_condition, "Object should not be null after initializing");
+            Assert.IsInstanceOf<MediaControlSearchCondition>(_condition, "Should return MediaControlSearchCondition instance");
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Create MediaControlSearchCondition instance")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlSearchCondition.MediaControlSearchCondition C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTR")]
+        [Property("COVPARAM", "MediaControlContentType, string, Bundle")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void MediaControlSearchCondition_CHECK_CREATE_CONSTRUCTOR_WITH_ALL_CATEGORY()
+        {
+            var condition = new MediaControlSearchCondition(MediaControlContentType.Image, "GD", null);
+
+            Assert.IsNotNull(condition, "Object should not be null after initializing");
+            Assert.IsInstanceOf<MediaControlSearchCondition>(condition, "Should return MediaControlSearchCondition instance");
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Is always not null")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlSearchCondition.ContentType A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRO")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void ContentType_READ_ONLY()
+        {
+            Assert.That(() => _condition.ContentType, Is.Not.Null);
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Is always not null")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlSearchCondition.Category A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRO")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void Category_READ_ONLY()
+        {
+            Assert.That(() => _condition.Category, Is.Not.Null);
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Is always not null")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlSearchCondition.Keyword A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRO")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void Keyword_READ_ONLY()
+        {
+            Assert.That(() => _condition.Keyword, Is.Not.Null);
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Is always not null")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlSearchCondition.Bundle A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRO")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void Bundle_READ_ONLY()
+        {
+            Assert.That(() => _condition.Bundle, Is.Not.Null);
+        }
+    }
+}
diff --git a/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSPlaybackCapabilityUpdatedEventArgs.cs b/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSPlaybackCapabilityUpdatedEventArgs.cs
new file mode 100644 (file)
index 0000000..297de4a
--- /dev/null
@@ -0,0 +1,42 @@
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Tizen.Multimedia.Remoting.Tests
+{
+    [TestFixture]
+    [Description("Testing Tizen.Multimedia.Remoting.PlaybackCapabilityUpdatedEventArgs class")]
+    public class PlaybackCapabilityUpdatedEventArgsTests
+    {
+        Dictionary<MediaControlPlaybackCommand, MediaControlCapabilitySupport> _capabilities =
+            new Dictionary<MediaControlPlaybackCommand, MediaControlCapabilitySupport>()
+            {
+                { MediaControlPlaybackCommand.FastForward, MediaControlCapabilitySupport.NotSupported },
+                { MediaControlPlaybackCommand.Next, MediaControlCapabilitySupport.NotSupported}
+            };
+
+        [Test]
+        [Category("P1")]
+        [Description("Constructor")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.PlaybackCapabilityUpdatedEventArgs.PlaybackCapabilityUpdatedEventArgs C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTR")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void PlaybackCapabilityUpdatedEventArgs_CONSTRUCTOR()
+        {
+            Assert.That(() => new PlaybackCapabilityUpdatedEventArgs(_capabilities), Throws.Nothing);
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Is always not null")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.PlaybackCapabilityUpdatedEventArgs.Support A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRO")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void Support_READ_ONLY()
+        {
+            Assert.That(() => new PlaybackActionCommandReceivedEventArgs(
+                new PlaybackCommand(MediaControlPlaybackCommand.Play)).Command, Is.Not.Null);
+        }
+    }
+}
diff --git a/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSRepeatModeCapabilityUpdatedEventArgs.cs b/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSRepeatModeCapabilityUpdatedEventArgs.cs
new file mode 100644 (file)
index 0000000..5b59c75
--- /dev/null
@@ -0,0 +1,34 @@
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Tizen.Multimedia.Remoting.Tests
+{
+    [TestFixture]
+    [Description("Testing Tizen.Multimedia.Remoting.RepeatModeCapabilityUpdatedEventArgs class")]
+    public class RepeatModeCapabilityUpdatedEventArgsTests
+    {
+        [Test]
+        [Category("P1")]
+        [Description("Constructor")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.RepeatModeCapabilityUpdatedEventArgs.RepeatModeCapabilityUpdatedEventArgs C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTR")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void RepeatModeCapabilityUpdatedEventArgs_CONSTRUCTOR()
+        {
+            Assert.That(() => new RepeatModeCapabilityUpdatedEventArgs(MediaControlCapabilitySupport.NotSupported), Throws.Nothing);
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Is always not null")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.RepeatModeCapabilityUpdatedEventArgs.Support A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRO")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void Support_READ_ONLY()
+        {
+            Assert.That(() => new RepeatModeCapabilityUpdatedEventArgs(MediaControlCapabilitySupport.NotSupported).Support, Is.Not.Null);
+        }
+    }
+}
diff --git a/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSSearchCommandReceivedEventArgs.cs b/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSSearchCommandReceivedEventArgs.cs
new file mode 100644 (file)
index 0000000..ed4e31e
--- /dev/null
@@ -0,0 +1,36 @@
+using NUnit.Framework;
+
+namespace Tizen.Multimedia.Remoting.Tests
+{
+    [TestFixture]
+    [Description("Testing Tizen.Multimedia.Remoting.SearchCommandReceivedEventArgs class")]
+    public class SearchCommandReceivedEventArgsTests
+    {
+        private MediaControlSearchCondition _searchCondition =
+            new MediaControlSearchCondition(MediaControlContentType.Image, "image", null);
+        [Test]
+        [Category("P1")]
+        [Description("Constructor")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.SearchCommandReceivedEventArgs.SearchCommandReceivedEventArgs C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTR")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void SearchCommandReceivedEventArgs_CONSTRUCTOR()
+        {
+            Assert.That(() => new SearchCommandReceivedEventArgs(new SearchCommand(_searchCondition)), Throws.Nothing);
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Is always not null")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.SearchCommandReceivedEventArgs.Command A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRO")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void Command_READ_ONLY()
+        {
+            Assert.That(() => new SearchCommandReceivedEventArgs(new SearchCommand(_searchCondition)).Command,
+                Is.Not.Null);
+        }
+    }
+}
diff --git a/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSShuffleModeCapabilityUpdatedEventArgs.cs b/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSShuffleModeCapabilityUpdatedEventArgs.cs
new file mode 100644 (file)
index 0000000..7d83a92
--- /dev/null
@@ -0,0 +1,35 @@
+using NUnit.Framework;
+
+namespace Tizen.Multimedia.Remoting.Tests
+{
+    [TestFixture]
+    [Description("Testing Tizen.Multimedia.Remoting.ShuffleModeCapabilityUpdatedEventArgs class")]
+    public class ShuffleModeCapabilityUpdatedEventArgsTests
+    {
+        [Test]
+        [Category("P1")]
+        [Description("Constructor")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.ShuffleModeCapabilityUpdatedEventArgs.ShuffleModeCapabilityUpdatedEventArgs C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTR")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void ShuffleModeCapabilityUpdatedEventArgs_CONSTRUCTOR()
+        {
+            Assert.That(() => new ShuffleModeCapabilityUpdatedEventArgs(MediaControlCapabilitySupport.NotSupported),
+                Throws.Nothing);
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Is always not null")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.ShuffleModeCapabilityUpdatedEventArgs.Support A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRO")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void Support_READ_ONLY()
+        {
+            Assert.That(() => new ShuffleModeCapabilityUpdatedEventArgs(MediaControlCapabilitySupport.NotSupported).Support,
+                Is.Not.Null);
+        }
+    }
+}