public void Action_READ_ONLY()
{
Assert.That(_command.Action, Is.TypeOf<string>());
- Assert.That(() => _command.Action, Is.EqualTo(_action));
+ Assert.That(() => _command.Action, Is.EqualTo(_action), "Should be same value");
}
[Test]
var command = new CustomCommand("test", bundle);
Assert.That(command.Bundle, Is.TypeOf<Bundle>());
- Assert.That(() => command.Bundle.GetItem("test_key"), Is.EqualTo("test_value"));
+ Assert.That(() => command.Bundle.GetItem("test_key"), Is.EqualTo("test_value"), "Should be same value");
}
}
}
\ No newline at end of file
{
var args = new CustomCommandReceivedEventArgs(new CustomCommand("test"));
- Assert.IsInstanceOf<CustomCommand>(args.Command);
- Assert.That(() => args.Command.Action, Is.EqualTo("test"));
+ Assert.IsInstanceOf<CustomCommand>(args.Command, "Should return CustomCommand instance");
+ Assert.That(() => args.Command.Action, Is.EqualTo("test"), "Should be same value");
}
}
}
--- /dev/null
+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.DisplayModeCapabilityUpdatedEventArgs class")]
+ public class DisplayModeCapabilityUpdatedEventArgsTests
+ {
+ private MediaController _controller;
+ private MediaControllerManager _manager;
+
+ [SetUp]
+ public void SetUp()
+ {
+ MediaControlServer.Start();
+
+ _manager = new MediaControllerManager();
+ _controller = _manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ if (MediaControlServer.IsRunning)
+ {
+ MediaControlServer.Stop();
+ }
+
+ _manager.Dispose();
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether the list of display mode capabilities are transfered to controller using EventArgs class")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.DisplayModeCapabilityUpdatedEventArgs.DisplayMode A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task DisplayMode_CHECK_READ_ONLY()
+ {
+ using (var eventWaiter = EventAwaiter<DisplayModeCapabilityUpdatedEventArgs>.Create())
+ {
+ _controller.DisplayModeCapabilityUpdated += eventWaiter;
+
+ var setModes = new List<MediaControlDisplayMode>()
+ {
+ MediaControlDisplayMode.LetterBox, MediaControlDisplayMode.CroppedFull
+ };
+
+ foreach ( var mode in setModes)
+ {
+ MediaControlServer.SetDisplayModeCapability(mode, MediaControlCapabilitySupport.Supported);
+ }
+
+ var args = await eventWaiter.GetResultAsync();
+ Assert.That(args.DisplayMode.Count, Is.EqualTo(setModes.Count), "Should be same value");
+
+ foreach (var mode in args.DisplayMode)
+ {
+ Assert.That(setModes.Contains(mode), "Should be same value");
+ }
+
+ _controller.DisplayModeCapabilityUpdated -= eventWaiter;
+ }
+ }
+ }
+}
+
--- /dev/null
+using NUnit.Framework;
+using System;
+
+namespace Tizen.Multimedia.Remoting.Tests
+{
+ [TestFixture]
+ [Description("Testing Tizen.Multimedia.Remoting.DisplayModeCommand class")]
+ public class DisplayModeCommandTests
+ {
+ [Test]
+ [Category("P1")]
+ [Description("Create the DisplayModeCommand Instance and check whether instance is created properly.")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.DisplayModeCommand.DisplayModeCommand C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void DisplayModeCommand_CHECK_CREATE_CONSTRUCTOR()
+ {
+ foreach (MediaControlDisplayMode mode in Enum.GetValues(typeof(MediaControlDisplayMode)))
+ {
+ var command = new DisplayModeCommand(mode);
+ Assert.IsNotNull(command, "Object should not be null after initializing");
+ Assert.IsInstanceOf<DisplayModeCommand>(command, "Should return DisplayModeCommand instance");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether DisplayModeCommand throws exception if parameter is invalid")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.DisplayModeCommand.DisplayModeCommand C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void DisplayModeCommand_THROWS_IF_PARAM_IS_INVALID()
+ {
+ Assert.Throws<ArgumentException>(() => new DisplayModeCommand(MediaControlDisplayMode.LetterBox - 1));
+ Assert.Throws<ArgumentException>(() => new DisplayModeCommand(MediaControlDisplayMode.CroppedFull + 1));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether Mode property is type of MediaControlDisplayMode or not.")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.DisplayModeCommand.Mode A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void Mode_READ_ONLY()
+ {
+ foreach (MediaControlDisplayMode mode in Enum.GetValues(typeof(MediaControlDisplayMode)))
+ {
+ var command = new DisplayModeCommand(mode);
+ Assert.IsInstanceOf<MediaControlDisplayMode>(command.Mode, "Should return DisplayModeCommand instance");
+ Assert.That(command.Mode, Is.EqualTo(mode), "Should be same value.");
+ }
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+using NUnit.Framework;
+using System;
+using System.Linq;
+using System.Threading.Tasks;
+using Tizen.Applications;
+
+namespace Tizen.Multimedia.Remoting.Tests
+{
+ [TestFixture]
+ [Description("Testing Tizen.Multimedia.Remoting.DisplayModeCommandReceivedEventArgs class")]
+ public class DisplayModeCommandReceivedEventArgsTests
+ {
+ private MediaController _controller;
+ private MediaControllerManager _manager;
+
+ [SetUp]
+ public void SetUp()
+ {
+ MediaControlServer.Start();
+
+ _manager = new MediaControllerManager();
+ _controller = _manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ if (MediaControlServer.IsRunning)
+ {
+ MediaControlServer.Stop();
+ }
+
+ _manager.Dispose();
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether the display mode command is transfered to server using EventArgs class")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.DisplayModeCommandReceivedEventArgs.Command A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task Command_CHECK_READ_ONLY()
+ {
+ foreach(MediaControlDisplayMode mode in Enum.GetValues(typeof(MediaControlDisplayMode)))
+ {
+ MediaControlServer.SetDisplayModeCapability(mode, MediaControlCapabilitySupport.Supported);
+
+ using (var eventWaiter = EventAwaiter<DisplayModeCommandReceivedEventArgs>.Create())
+ {
+ MediaControlServer.DisplayModeCommandReceived += eventWaiter;
+
+ Task.Run(() => _controller.RequestAsync(new DisplayModeCommand(mode)));
+
+ var result = await eventWaiter.GetResultAsync();
+
+ Assert.IsNotNull(result.Command, "Object should not be null after initializing");
+ Assert.IsInstanceOf<DisplayModeCommand>(result.Command, "Should return DisplayModeCommand instance");
+ Assert.That(result.Command.Mode, Is.EqualTo(mode), "Should be same value");
+
+ MediaControlServer.DisplayModeCommandReceived -= eventWaiter;
+ }
+ }
+ }
+ }
+}
+
--- /dev/null
+using NUnit.Framework;
+using System;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tizen.Applications;
+
+namespace Tizen.Multimedia.Remoting.Tests
+{
+ [TestFixture]
+ [Description("Testing Tizen.Multimedia.Remoting.DisplayModeUpdatedEventArgs class")]
+ public class DisplayModeUpdatedEventArgsTests
+ {
+ private MediaController _controller;
+ private MediaControllerManager _manager;
+
+ [SetUp]
+ public void SetUp()
+ {
+ MediaControlServer.Start();
+
+ _manager = new MediaControllerManager();
+ _controller = _manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ if (MediaControlServer.IsRunning)
+ {
+ MediaControlServer.Stop();
+ }
+
+ _manager.Dispose();
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether the display mode is transfered to controller using EventArgs class")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.DisplayModeUpdatedEventArgs.DisplayMode A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task DisplayMode_CHECK_READ_ONLY()
+ {
+ foreach (MediaControlDisplayMode mode in Enum.GetValues(typeof(MediaControlDisplayMode)))
+ {
+ MediaControlServer.SetDisplayModeCapability(mode, MediaControlCapabilitySupport.Supported);
+
+ using (var eventWaiter = EventAwaiter<DisplayModeUpdatedEventArgs>.Create())
+ {
+ _controller.DisplayModeUpdated += eventWaiter;
+
+ MediaControlServer.SetDisplayMode(mode);
+
+ var args = await eventWaiter.GetResultAsync();
+ Assert.IsTrue(args.DisplayMode.Equals(mode), "Should be same value.");
+
+ _controller.DisplayModeUpdated -= eventWaiter;
+ }
+ }
+ }
+ }
+}
--- /dev/null
+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.DisplayRotationCapabilityUpdatedEventArgs class")]
+ public class DisplayRotationCapabilityUpdatedEventArgsTests
+ {
+ private MediaController _controller;
+ private MediaControllerManager _manager;
+
+ [SetUp]
+ public void SetUp()
+ {
+ MediaControlServer.Start();
+
+ _manager = new MediaControllerManager();
+ _controller = _manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ if (MediaControlServer.IsRunning)
+ {
+ MediaControlServer.Stop();
+ }
+
+ _manager.Dispose();
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether the list of display rotation capabilities are transfered to controller using EventArgs class")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.DisplayRotationCapabilityUpdatedEventArgs.DisplayRotation A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task DisplayRotation_CHECK_READ_ONLY()
+ {
+ using (var eventWaiter = EventAwaiter<DisplayRotationCapabilityUpdatedEventArgs>.Create())
+ {
+ _controller.DisplayRotationCapabilityUpdated += eventWaiter;
+
+ var setRotations = new List<Rotation>() { Rotation.Rotate0, Rotation.Rotate180 };
+
+ foreach (var rotation in setRotations)
+ {
+ MediaControlServer.SetDisplayRotationCapability(rotation, MediaControlCapabilitySupport.Supported);
+ }
+
+ var args = await eventWaiter.GetResultAsync();
+ Assert.That(args.DisplayRotation.Count, Is.EqualTo(setRotations.Count), "Should be same value");
+
+ foreach (var rotation in args.DisplayRotation)
+ {
+ Assert.That(setRotations.Contains(rotation), "Should be same value");
+ }
+
+ _controller.DisplayRotationCapabilityUpdated -= eventWaiter;
+ }
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using System;
+using System.Linq;
+using Tizen.Applications;
+
+namespace Tizen.Multimedia.Remoting.Tests
+{
+ [TestFixture]
+ [Description("Testing Tizen.Multimedia.Remoting.DisplayRotationCommand class")]
+ public class DisplayRotationCommandTests
+ {
+ [Test]
+ [Category("P1")]
+ [Description("Create DisplayRotationCommand instance")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.DisplayRotationCommand.DisplayRotationCommand C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void DisplayRotationCommand_CHECK_CREATE_CONSTRUCTOR()
+ {
+ foreach (Rotation rotation in Enum.GetValues(typeof(Rotation)))
+ {
+ var command = new DisplayRotationCommand(rotation);
+
+ Assert.IsNotNull(command, "Object should not be null after initializing");
+ Assert.IsInstanceOf<DisplayRotationCommand>(command,
+ "Should return DisplayRotationCommand instance");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether DisplayRotationCommand throws exception if parameter is invalid")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.DisplayRotationCommand.DisplayRotationCommand C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void DisplayRotationCommand_THROWS_IF_PARAM_IS_INVALID()
+ {
+ Assert.Throws<ArgumentException>(() => new DisplayRotationCommand(Rotation.Rotate0 - 1));
+ Assert.Throws<ArgumentException>(() => new DisplayRotationCommand(Rotation.Rotate270 + 1));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether Rotation property is type of Rotation or not.")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.DisplayRotationCommand.Rotation A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void Rotation_READ_ONLY()
+ {
+ foreach (Rotation rotation in Enum.GetValues(typeof(Rotation)))
+ {
+ var command = new DisplayRotationCommand(rotation);
+ Assert.IsInstanceOf<Rotation>(command.Rotation, "Should return DisplayRotationCommand instance");
+ Assert.That(command.Rotation, Is.EqualTo(rotation), "Should be same value.");
+ }
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using System;
+using System.Linq;
+using System.Threading.Tasks;
+using Tizen.Applications;
+
+namespace Tizen.Multimedia.Remoting.Tests
+{
+ [TestFixture]
+ [Description("Testing Tizen.Multimedia.Remoting.DisplayRotationCommandReceivedEventArgs class")]
+ public class DisplayRotationCommandReceivedEventArgsTests
+ {
+ private MediaController _controller;
+ private MediaControllerManager _manager;
+
+ [SetUp]
+ public void SetUp()
+ {
+ MediaControlServer.Start();
+
+ _manager = new MediaControllerManager();
+ _controller = _manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ if (MediaControlServer.IsRunning)
+ {
+ MediaControlServer.Stop();
+ }
+
+ _manager.Dispose();
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether the display rotation command is transfered to server using EventArgs class")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.DisplayRotationCommandReceivedEventArgs.Command A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task Command_CHECK_READ_ONLY()
+ {
+ foreach (Rotation rotation in Enum.GetValues(typeof(Rotation)))
+ {
+ Log.Info("Tizen.MediaController.Tests", $"Enter : {rotation}");
+ MediaControlServer.SetDisplayRotationCapability(rotation, MediaControlCapabilitySupport.Supported);
+
+ using (var eventWaiter = EventAwaiter<DisplayRotationCommandReceivedEventArgs>.Create())
+ {
+ MediaControlServer.DisplayRotationCommandReceived += eventWaiter;
+
+ Task.Run(() => _controller.RequestAsync(new DisplayRotationCommand(rotation)));
+
+ var result = await eventWaiter.GetResultAsync();
+
+ Assert.IsNotNull(result.Command, "Object should not be null after initializing");
+ Assert.IsInstanceOf<DisplayRotationCommand>(result.Command, "Should return DisplayRotationCommand instance");
+ Assert.That(result.Command.Rotation, Is.EqualTo(rotation), "Should be same value");
+
+ MediaControlServer.DisplayRotationCommandReceived -= eventWaiter;
+ }
+ }
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using System;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tizen.Applications;
+
+namespace Tizen.Multimedia.Remoting.Tests
+{
+ [TestFixture]
+ [Description("Testing Tizen.Multimedia.Remoting.DisplayRotationUpdatedEventArgs class")]
+ public class DisplayRotationUpdatedEventArgsTests
+ {
+ private MediaController _controller;
+ private MediaControllerManager _manager;
+
+ [SetUp]
+ public void SetUp()
+ {
+ MediaControlServer.Start();
+
+ _manager = new MediaControllerManager();
+ _controller = _manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ if (MediaControlServer.IsRunning)
+ {
+ MediaControlServer.Stop();
+ }
+
+ _manager.Dispose();
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether the display rotation is transfered to controller using EventArgs class")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.DisplayRotationUpdatedEventArgs.Rotation A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task Rotation_CHECK_READ_ONLY()
+ {
+ foreach (Rotation rotation in Enum.GetValues(typeof(Rotation)))
+ {
+ MediaControlServer.SetDisplayRotationCapability(rotation, MediaControlCapabilitySupport.Supported);
+
+ using (var eventWaiter = EventAwaiter<DisplayRotationUpdatedEventArgs>.Create())
+ {
+ _controller.DisplayRotationUpdated += eventWaiter;
+
+ MediaControlServer.SetDisplayRotation(rotation);
+
+ var args = await eventWaiter.GetResultAsync();
+ Assert.IsTrue(args.Rotation.Equals(rotation), "Should be same value.");
+
+ _controller.DisplayRotationUpdated -= eventWaiter;
+ }
+ }
+ }
+ }
+}
metadata.Title = value;
- Assert.That(metadata.Title, Is.EqualTo(value));
+ Assert.That(metadata.Title, Is.EqualTo(value), "Should be same value");
}
[Test]
metadata.Artist = value;
- Assert.That(metadata.Artist, Is.EqualTo(value));
+ Assert.That(metadata.Artist, Is.EqualTo(value), "Should be same value");
}
[Test]
metadata.Album = value;
- Assert.That(metadata.Album, Is.EqualTo(value));
+ Assert.That(metadata.Album, Is.EqualTo(value), "Should be same value");
}
[Test]
metadata.Author = value;
- Assert.That(metadata.Author, Is.EqualTo(value));
+ Assert.That(metadata.Author, Is.EqualTo(value), "Should be same value");
}
[Test]
metadata.Genre = value;
- Assert.That(metadata.Genre, Is.EqualTo(value));
+ Assert.That(metadata.Genre, Is.EqualTo(value), "Should be same value");
}
[Test]
metadata.Duration = value;
- Assert.That(metadata.Duration, Is.EqualTo(value));
+ Assert.That(metadata.Duration, Is.EqualTo(value), "Should be same value");
}
[Test]
metadata.Date = value;
- Assert.That(metadata.Date, Is.EqualTo(value));
+ Assert.That(metadata.Date, Is.EqualTo(value), "Should be same value");
}
[Test]
metadata.Copyright = value;
- Assert.That(metadata.Copyright, Is.EqualTo(value));
+ Assert.That(metadata.Copyright, Is.EqualTo(value), "Should be same value");
}
[Test]
metadata.Description = value;
- Assert.That(metadata.Description, Is.EqualTo(value));
+ Assert.That(metadata.Description, Is.EqualTo(value), "Should be same value");
}
[Test]
metadata.TrackNumber = value;
- Assert.That(metadata.TrackNumber, Is.EqualTo(value));
+ Assert.That(metadata.TrackNumber, Is.EqualTo(value), "Should be same value");
}
[Test]
metadata.AlbumArtPath = value;
- Assert.That(metadata.AlbumArtPath, Is.EqualTo(value));
+ Assert.That(metadata.AlbumArtPath, Is.EqualTo(value), "Should be same value");
}
[Test]
metadata.Season = season;
AssertHelper.PropertyReadWrite<MediaControlMetadata>(nameof(MediaControlMetadata.Season));
- Assert.That(metadata.Season.Number, Is.EqualTo(season.Number));
- Assert.That(metadata.Season.Title, Is.EqualTo(season.Title));
+ Assert.That(metadata.Season.Number, Is.EqualTo(season.Number), "Should be same value");
+ Assert.That(metadata.Season.Title, Is.EqualTo(season.Title), "Should be same value");
}
[Test]
metadata.Episode = episode;
AssertHelper.PropertyReadWrite<MediaControlMetadata>(nameof(MediaControlMetadata.Episode));
- Assert.That(metadata.Episode.Number, Is.EqualTo(episode.Number));
- Assert.That(metadata.Episode.Title, Is.EqualTo(episode.Title));
+ Assert.That(metadata.Episode.Number, Is.EqualTo(episode.Number), "Should be same value");
+ Assert.That(metadata.Episode.Title, Is.EqualTo(episode.Title), "Should be same value");
}
[Test]
metadata.Resolution = resolution;
AssertHelper.PropertyReadWrite<MediaControlMetadata>(nameof(MediaControlMetadata.Resolution));
- Assert.That(metadata.Resolution, Is.EqualTo(resolution));
+ Assert.That(metadata.Resolution, Is.EqualTo(resolution), "Should be same value");
}
}
}
\ No newline at end of file
{
using (var playlist = new MediaControlPlaylist("MyFavorite"))
{
- Assert.That(playlist.Name, Is.EqualTo("MyFavorite"));
+ Assert.That(playlist.Name, Is.EqualTo("MyFavorite"), "Should be same value");
}
}
{
playlist.AddMetadata("Song1", new MediaControlMetadata());
- Assert.That(playlist.TotalCount, Is.GreaterThan(0));
+ Assert.That(playlist.TotalCount, Is.GreaterThan(0), "Should be greater than 0");
}
}
playlist.AddMetadata(metadatasPair);
- Assert.That(playlist.GetMetadata(), Is.EqualTo(metadatasPair));
+ Assert.That(playlist.GetMetadata(), Is.EqualTo(metadatasPair), "Should be same value");
}
}
playlist.AddMetadata("ID1", metadata);
- Assert.That(playlist.GetMetadata("ID1"), Is.EqualTo(metadata));
+ Assert.That(playlist.GetMetadata("ID1"), Is.EqualTo(metadata), "Should be same value");
}
}
playlist.AddMetadata(metadatasPair);
- Assert.That(playlist.GetMetadata(), Is.EqualTo(metadatasPair));
+ Assert.That(playlist.GetMetadata(), Is.EqualTo(metadatasPair), "Should be same value");
}
}
playlist.AddMetadata("ID1", metadata);
- Assert.That(playlist.GetMetadata("ID1"), Is.EqualTo(metadata));
+ Assert.That(playlist.GetMetadata("ID1"), Is.EqualTo(metadata), "Should be same value");
}
}
playlist.AddMetadata("ID1", metadata);
- Assert.That(playlist.GetMetadata("ID1"), Is.EqualTo(metadata));
+ Assert.That(playlist.GetMetadata("ID1"), Is.EqualTo(metadata), "Should be same value");
}
}
}
[Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
public void ContentType_READ_ONLY()
{
- Assert.IsInstanceOf<MediaControlContentType>(_condition.ContentType);
- Assert.That(_condition.ContentType, Is.EqualTo(MediaControlContentType.Image));
+ Assert.IsInstanceOf<MediaControlContentType>(_condition.ContentType,
+ "Should return MediaControlContentType instance");
+ Assert.That(_condition.ContentType, Is.EqualTo(MediaControlContentType.Image), "Should be same value");
}
[Test]
[Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
public void Category_READ_ONLY()
{
- Assert.IsInstanceOf<MediaControlSearchCategory>(_condition.Category);
- Assert.That(_condition.Category, Is.EqualTo(MediaControlSearchCategory.Artist));
+ Assert.IsInstanceOf<MediaControlSearchCategory>(_condition.Category, "Should return MediaControlSearchCategory instance");
+ Assert.That(_condition.Category, Is.EqualTo(MediaControlSearchCategory.Artist), "Should be same value");
}
[Test]
[Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
public void Keyword_READ_ONLY()
{
- Assert.IsInstanceOf<string>(_condition.Keyword);
- Assert.That(_condition.Keyword, Is.EqualTo("GD"));
+ Assert.IsInstanceOf<string>(_condition.Keyword, "Should return string instance");
+ Assert.That(_condition.Keyword, Is.EqualTo("GD"), "Should be same value");
}
[Test]
[Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
public void Bundle_READ_ONLY()
{
- Assert.IsInstanceOf<Bundle>(_condition.Bundle);
- Assert.That(_condition.Bundle, Is.EqualTo(_bundle));
+ Assert.IsInstanceOf<Bundle>(_condition.Bundle, "Should return Bundle instance");
+ Assert.That(_condition.Bundle, Is.EqualTo(_bundle), "Should be same value");
}
}
}
var index = "ID1";
Assert.That(() => MediaControlServer.SetIndexOfCurrentPlayingMedia(index), Throws.Nothing);
- Assert.That(controller.GetIndexOfCurrentPlayingMedia(), Is.EqualTo(index));
+ Assert.That(controller.GetIndexOfCurrentPlayingMedia(), Is.EqualTo(index), "Should be same value.");
}
}
var ageRating = 12;
Assert.That(() => MediaControlServer.SetAgeRating(ageRating), Throws.Nothing);
- Assert.That(controller.GetAgeRatingOfCurrentPlayingMedia(), Is.EqualTo(ageRating));
+ Assert.That(controller.GetAgeRatingOfCurrentPlayingMedia(), Is.EqualTo(ageRating), "Should be same value.");
}
}
var iconPath = "test.jpg";
Assert.That(() => MediaControlServer.SetIconPath(iconPath), Throws.Nothing);
- Assert.That(controller.GetIconPath(), Is.EqualTo(iconPath));
+ Assert.That(controller.GetIconPath(), Is.EqualTo(iconPath), "Should be same value.");
}
}
var index = "Song2";
MediaControlServer.SetInfoOfCurrentPlayingMedia(playlistName, index);
- Assert.That(controller.GetPlaylistOfCurrentPlayingMedia().Name, Is.EqualTo(playlistName));
+ Assert.That(controller.GetPlaylistOfCurrentPlayingMedia().Name, Is.EqualTo(playlistName),
+ "Should be same value.");
}
}
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "MEX")]
[Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
- public void SetInfoOfCurrentPlayingMedia_THROW_EXCEPTION()
+ public void SetInfoOfCurrentPlayingMedia_THROWS_EXCEPTION()
{
Assert.Throws<ArgumentNullException>(() => MediaControlServer.SetInfoOfCurrentPlayingMedia("MyFavor", null));
[Test]
[Category("P1")]
+ [Description("Sets subtile mode and get and compare with value")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetSubtitleMode M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SetSubtitleMode_RETURN_VALUE()
+ {
+ using (var manager = new MediaControllerManager())
+ {
+ var controller = manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+
+ Assert.That(() => MediaControlServer.SetSubtitleMode(true), Throws.Nothing);
+ Assert.That(controller.IsSubtitleModeEnabled(), Is.EqualTo(true), "Should be same value.");
+
+ Assert.That(() => MediaControlServer.SetSubtitleMode(false), Throws.Nothing);
+ Assert.That(controller.IsSubtitleModeEnabled(), Is.EqualTo(false), "Should be same value.");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether SetSubtitleMode throws exception if server is not running")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetSubtitleMode M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SetSubtitleMode_THROWS_SERVER_IS_NOT_RUNNING()
+ {
+ if (MediaControlServer.IsRunning)
+ {
+ MediaControlServer.Stop();
+ }
+
+ Assert.That(() => MediaControlServer.SetSubtitleMode(true), Throws.InvalidOperationException);
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Sets 360 mode and get and compare with value")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetMode360 M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SetMode360_RETURN_VALUE()
+ {
+ using (var manager = new MediaControllerManager())
+ {
+ var controller = manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+
+ Assert.That(() => MediaControlServer.SetMode360(true), Throws.Nothing);
+ Assert.That(controller.IsMode360Enabled(), Is.EqualTo(true), "Should be same value.");
+
+ Assert.That(() => MediaControlServer.SetMode360(false), Throws.Nothing);
+ Assert.That(controller.IsMode360Enabled(), Is.EqualTo(false), "Should be same value.");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether SetMode360 throws exception if server is not running")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetMode360 M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SetMode360_THROWS_SERVER_IS_NOT_RUNNING()
+ {
+ if (MediaControlServer.IsRunning)
+ {
+ MediaControlServer.Stop();
+ }
+
+ Assert.That(() => MediaControlServer.SetMode360(true), Throws.InvalidOperationException);
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Sets display mode and get and compare with value")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetDisplayMode M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SetDisplayMode_RETURN_VALUE()
+ {
+ using (var manager = new MediaControllerManager())
+ {
+ var controller = manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+
+ foreach (MediaControlDisplayMode mode in Enum.GetValues(typeof(MediaControlDisplayMode)))
+ {
+ Assert.That(() => MediaControlServer.SetDisplayMode(mode), Throws.Nothing);
+ Assert.That(controller.GetDisplayMode(), Is.EqualTo(mode), "Should be same value.");
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether SetDisplayMode throws exception if server is not running")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetDisplayMode M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SetDisplayMode_THROWS_SERVER_IS_NOT_RUNNING()
+ {
+ if (MediaControlServer.IsRunning)
+ {
+ MediaControlServer.Stop();
+ }
+
+ Assert.That(() => MediaControlServer.SetDisplayMode(MediaControlDisplayMode.LetterBox), Throws.InvalidOperationException);
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Sets display rotation and get and compare with value")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetDisplayRotation M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SetDisplayRotation_RETURN_VALUE()
+ {
+ using (var manager = new MediaControllerManager())
+ {
+ var controller = manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+
+ foreach (Rotation rotation in Enum.GetValues(typeof(Rotation)))
+ {
+ Assert.That(() => MediaControlServer.SetDisplayRotation(rotation), Throws.Nothing);
+ Assert.That(controller.GetDisplayRotation(), Is.EqualTo(rotation), "Should be same value.");
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether SetDisplayRotation throws exception if server is not running")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetDisplayRotation M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SetDisplayRotation_THROWS_SERVER_IS_NOT_RUNNING()
+ {
+ if (MediaControlServer.IsRunning)
+ {
+ MediaControlServer.Stop();
+ }
+
+ Assert.That(() => MediaControlServer.SetDisplayRotation(Rotation.Rotate180), Throws.InvalidOperationException);
+ }
+
+ [Test]
+ [Category("P1")]
[Description("Sets playback capability and get it and compare with the value")]
[Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetPlaybackCapability M")]
[Property("SPEC_URL", "-")]
MediaControlCapabilitySupport.NotSupported);
Assert.That(controller.GetPlaybackCapability(MediaControlPlaybackCommand.FastForward),
- Is.EqualTo(MediaControlCapabilitySupport.NotSupported));
+ Is.EqualTo(MediaControlCapabilitySupport.NotSupported), "Should be same value.");
}
}
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "MEX")]
[Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
- public void SetPlaybackCapability_THROWS_NOTHING()
+ public void SetPlaybackCapability_THROWS_IF_PARAM_IS_INVALID()
{
Assert.Throws<ArgumentException>(() => MediaControlServer.SetPlaybackCapability(
MediaControlPlaybackCommand.Play - 1, MediaControlCapabilitySupport.NotSupported));
Assert.That(() => MediaControlServer.SetPlaybackCapabilities(capabilities), Throws.Nothing);
- Assert.That(controller.GetPlaybackCapabilities(), Is.EqualTo(capabilities));
+ Assert.That(controller.GetPlaybackCapabilities(), Is.EqualTo(capabilities), "Should be same value.");
}
}
var contentType = MediaControlContentType.Music;
MediaControlServer.SetPlaybackContentType(contentType);
- Assert.That(controller.GetContentTypeOfCurrentPlayingMedia(), Is.EqualTo(contentType));
+ Assert.That(controller.GetContentTypeOfCurrentPlayingMedia(), Is.EqualTo(contentType),
+ "Should be same value.");
}
}
c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
MediaControlServer.SetRepeatModeCapability(MediaControlCapabilitySupport.NotSupported);
- Assert.That(controller.GetRepeatModeCapability(), Is.EqualTo(MediaControlCapabilitySupport.NotSupported));
+ Assert.That(controller.GetRepeatModeCapability(), Is.EqualTo(MediaControlCapabilitySupport.NotSupported),
+ "Should be same value.");
MediaControlServer.SetRepeatModeCapability(MediaControlCapabilitySupport.Supported);
- Assert.That(controller.GetRepeatModeCapability(), Is.EqualTo(MediaControlCapabilitySupport.Supported));
+ Assert.That(controller.GetRepeatModeCapability(), Is.EqualTo(MediaControlCapabilitySupport.Supported),
+ "Should be same value.");
}
}
c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
MediaControlServer.SetShuffleModeCapability(MediaControlCapabilitySupport.NotSupported);
- Assert.That(controller.GetShuffleModeCapability(), Is.EqualTo(MediaControlCapabilitySupport.NotSupported));
+ Assert.That(controller.GetShuffleModeCapability(), Is.EqualTo(MediaControlCapabilitySupport.NotSupported),
+ "Should be same value.");
MediaControlServer.SetShuffleModeCapability(MediaControlCapabilitySupport.Supported);
- Assert.That(controller.GetShuffleModeCapability(), Is.EqualTo(MediaControlCapabilitySupport.Supported));
+ Assert.That(controller.GetShuffleModeCapability(), Is.EqualTo(MediaControlCapabilitySupport.Supported),
+ "Should be same value.");
}
}
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "MEX")]
[Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
- public void SetShuffleModeCapability_THROW_EXCEPTION()
+ public void SetShuffleModeCapability_THROWS_EXCEPTION()
{
Assert.Throws<ArgumentException>(() =>
MediaControlServer.SetShuffleModeCapability(MediaControlCapabilitySupport.Supported - 1));
[Test]
[Category("P1")]
+ [Description("Sets display mode capability")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetDisplayModeCapability M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SetDisplayModeCapability_RETURN_VALUE()
+ {
+ using (var manager = new MediaControllerManager())
+ {
+ var controller = manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+
+ foreach (MediaControlDisplayMode mode in Enum.GetValues(typeof(MediaControlDisplayMode)))
+ {
+ MediaControlServer.SetDisplayModeCapability(mode, MediaControlCapabilitySupport.Supported);
+ Assert.That(controller.GetDisplayModeCapability().Contains(mode), "Should be same value.");
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether SetDisplayModeCapability throws exception if parameter is invalid")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetDisplayModeCapability M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SetDisplayModeCapability_THROWS_IF_PARAM_IS_INVALID()
+ {
+ Assert.Throws<ArgumentException>(() => MediaControlServer.SetDisplayModeCapability(
+ MediaControlDisplayMode.LetterBox, MediaControlCapabilitySupport.Supported - 1));
+
+ Assert.Throws<ArgumentException>(() => MediaControlServer.SetDisplayModeCapability(
+ MediaControlDisplayMode.LetterBox, MediaControlCapabilitySupport.NotDecided));
+
+ Assert.Throws<ArgumentException>(() => MediaControlServer.SetDisplayModeCapability(
+ MediaControlDisplayMode.LetterBox - 1, MediaControlCapabilitySupport.Supported));
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether SetDisplayModeCapability throws exception if server is not running")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetDisplayModeCapability M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SetDisplayModeCapability_THROWS_SERVER_IS_NOT_RUNNING()
+ {
+ if (MediaControlServer.IsRunning)
+ {
+ MediaControlServer.Stop();
+ }
+
+ Assert.Throws<InvalidOperationException>(() => MediaControlServer.SetDisplayModeCapability(
+ MediaControlDisplayMode.LetterBox, MediaControlCapabilitySupport.Supported));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Sets display mode capabilities")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetDisplayModeCapabilities M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SetDisplayModeCapabilities_RETURN_VALUE()
+ {
+ using (var manager = new MediaControllerManager())
+ {
+ var controller = manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+
+ var setModes = new List<MediaControlDisplayMode>()
+ {
+ MediaControlDisplayMode.LetterBox, MediaControlDisplayMode.CroppedFull
+ };
+
+ var setModesDict = new Dictionary<MediaControlDisplayMode, MediaControlCapabilitySupport>();
+ foreach (var mode in setModes)
+ {
+ setModesDict.Add(mode, MediaControlCapabilitySupport.Supported);
+ }
+
+ Assert.That(() => MediaControlServer.SetDisplayModeCapabilities(setModesDict), Throws.Nothing);
+
+ var supportedModes = controller.GetDisplayModeCapability();
+ Assert.That(supportedModes.Count(), Is.EqualTo(setModes.Count), "Should be same value.");
+
+ foreach (var mode in supportedModes)
+ {
+ Assert.That(setModes.Contains(mode), "Should be same value");
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether SetDisplayModeCapabilities throws exception if parameter is invalid")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetDisplayModeCapabilities M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SetDisplayModeCapabilities_THROWS_IF_PARAM_IS_INVALID()
+ {
+ Assert.Throws<ArgumentException>(() => MediaControlServer.SetDisplayModeCapabilities(
+ new Dictionary<MediaControlDisplayMode, MediaControlCapabilitySupport>()
+ {
+ { MediaControlDisplayMode.LetterBox, MediaControlCapabilitySupport.Supported - 1 }
+ })
+ );
+
+ Assert.Throws<ArgumentException>(() => MediaControlServer.SetDisplayModeCapabilities(
+ new Dictionary<MediaControlDisplayMode, MediaControlCapabilitySupport>()
+ {
+ { MediaControlDisplayMode.LetterBox, MediaControlCapabilitySupport.NotDecided }
+ })
+ );
+
+ Assert.Throws<ArgumentException>(() => MediaControlServer.SetDisplayModeCapabilities(
+ new Dictionary<MediaControlDisplayMode, MediaControlCapabilitySupport>()
+ {
+ { MediaControlDisplayMode.LetterBox - 1, MediaControlCapabilitySupport.Supported }
+ })
+ );
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether SetDisplayModeCapabilities throws exception if server is not running")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetDisplayModeCapabilities M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SetDisplayModeCapabilities_THROWS_SERVER_IS_NOT_RUNNING()
+ {
+ if (MediaControlServer.IsRunning)
+ {
+ MediaControlServer.Stop();
+ }
+
+ Assert.Throws<InvalidOperationException>(() => MediaControlServer.SetDisplayModeCapabilities(
+ new Dictionary<MediaControlDisplayMode, MediaControlCapabilitySupport>()
+ {
+ { MediaControlDisplayMode.LetterBox, MediaControlCapabilitySupport.Supported },
+ { MediaControlDisplayMode.OriginSize, MediaControlCapabilitySupport.Supported },
+ { MediaControlDisplayMode.FullScreen, MediaControlCapabilitySupport.Supported },
+ { MediaControlDisplayMode.CroppedFull, MediaControlCapabilitySupport.Supported },
+ })
+ );
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Sets display rotation capability")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetDisplayRotationCapability M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SetDisplayRotationCapability_RETURN_VALUE()
+ {
+ using (var manager = new MediaControllerManager())
+ {
+ var controller = manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+
+ foreach (Rotation rotation in Enum.GetValues(typeof(Rotation)))
+ {
+ MediaControlServer.SetDisplayRotationCapability(rotation, MediaControlCapabilitySupport.Supported);
+ Assert.That(controller.GetDisplayRotationapability().Contains(rotation), "Should be same value.");
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether SetDisplayRotationCapability throws exception if parameter is invalid")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetDisplayRotationCapability M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SetDisplayRotationCapability_THROWS_IF_PARAM_IS_INVALID()
+ {
+ Assert.Throws<ArgumentException>(() => MediaControlServer.SetDisplayRotationCapability(
+ Rotation.Rotate0, MediaControlCapabilitySupport.Supported - 1));
+
+ Assert.Throws<ArgumentException>(() => MediaControlServer.SetDisplayRotationCapability(
+ Rotation.Rotate0, MediaControlCapabilitySupport.NotDecided));
+
+ Assert.Throws<ArgumentException>(() => MediaControlServer.SetDisplayRotationCapability(
+ Rotation.Rotate0 - 1, MediaControlCapabilitySupport.Supported));
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether SetDisplayRotationCapability throws exception if server is not running")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetDisplayRotationCapability M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SetDisplayRotationCapability_THROWS_SERVER_IS_NOT_RUNNING()
+ {
+ if (MediaControlServer.IsRunning)
+ {
+ MediaControlServer.Stop();
+ }
+
+ Assert.Throws<InvalidOperationException>(() => MediaControlServer.SetDisplayRotationCapability(
+ Rotation.Rotate180, MediaControlCapabilitySupport.Supported));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Sets display rotation capabilities")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetDisplayRotationCapabilities M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SetDisplayRotationCapabilities_RETURN_VALUE()
+ {
+ using (var manager = new MediaControllerManager())
+ {
+ var controller = manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+
+ var setRotations = new List<Rotation>()
+ {
+ Rotation.Rotate0, Rotation.Rotate180
+ };
+
+ var setRotationsDict = new Dictionary<Rotation, MediaControlCapabilitySupport>();
+ foreach (var rotation in setRotations)
+ {
+ setRotationsDict.Add(rotation, MediaControlCapabilitySupport.Supported);
+ }
+
+ Assert.That(() => MediaControlServer.SetDisplayRotationCapabilities(setRotationsDict), Throws.Nothing);
+
+ var supportedRotations = controller.GetDisplayRotationapability();
+ Assert.That(supportedRotations.Count(), Is.EqualTo(setRotations.Count), "Should be same value.");
+
+ foreach (var rotation in supportedRotations)
+ {
+ Assert.That(setRotations.Contains(rotation), "Should be same value");
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether SetDisplayRotationCapabilities throws exception if parameter is invalid")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetDisplayRotationCapabilities M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SetDisplayRotationCapabilities_THROWS_IF_PARAM_IS_INVALID()
+ {
+ Assert.Throws<ArgumentException>(() => MediaControlServer.SetDisplayRotationCapabilities(
+ new Dictionary<Rotation, MediaControlCapabilitySupport>()
+ {
+ { Rotation.Rotate0, MediaControlCapabilitySupport.Supported - 1 }
+ })
+ );
+
+ Assert.Throws<ArgumentException>(() => MediaControlServer.SetDisplayRotationCapabilities(
+ new Dictionary<Rotation, MediaControlCapabilitySupport>()
+ {
+ { Rotation.Rotate0, MediaControlCapabilitySupport.NotDecided }
+ })
+ );
+
+ Assert.Throws<ArgumentException>(() => MediaControlServer.SetDisplayRotationCapabilities(
+ new Dictionary<Rotation, MediaControlCapabilitySupport>()
+ {
+ { Rotation.Rotate0 - 1, MediaControlCapabilitySupport.Supported }
+ })
+ );
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether SetDisplayRotationCapabilities throws exception if server is not running")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetDisplayRotationCapabilities M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SetDisplayRotationCapabilities_THROWS_SERVER_IS_NOT_RUNNING()
+ {
+ if (MediaControlServer.IsRunning)
+ {
+ MediaControlServer.Stop();
+ }
+
+ Assert.Throws<InvalidOperationException>(() => MediaControlServer.SetDisplayRotationCapabilities(
+ new Dictionary<Rotation, MediaControlCapabilitySupport>()
+ {
+ { Rotation.Rotate0, MediaControlCapabilitySupport.Supported },
+ { Rotation.Rotate90, MediaControlCapabilitySupport.Supported },
+ { Rotation.Rotate180, MediaControlCapabilitySupport.Supported },
+ { Rotation.Rotate270, MediaControlCapabilitySupport.Supported },
+ })
+ );
+ }
+
+ [Test]
+ [Category("P1")]
[Description("Invoked when server sends custom command")]
[Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.CustomCommandReceived E")]
[Property("SPEC_URL", "-")]
Assert.That(await eventWaiter.IsRaisedAsync());
}
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Invoked when server sends subtile mode command")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SubtitleModeCommandReceived E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task SubtitleModeCommandReceived_CHECK_EVENT()
+ {
+ using (var eventWaiter = EventAwaiter<SubtitleModeCommandReceivedEventArgs>.Create())
+ using (var manager = new MediaControllerManager())
+ {
+ var controller = manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+
+ MediaControlServer.SubtitleModeCommandReceived += eventWaiter;
+
+ MediaControlServer.SetSubtitleModeCapability(MediaControlCapabilitySupport.Supported);
+
+ await Task.Run(() =>
+ {
+ controller.RequestAsync(new SubtitleModeCommand(true));
+ });
+
+ var result = await eventWaiter.GetResultAsync();
+
+ Assert.That(result.Command.IsEnabled, Is.EqualTo(true), "Should be same value.");
+
+ MediaControlServer.SubtitleModeCommandReceived -= eventWaiter;
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Invoked when server sends 360 mode command")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.Mode360CommandReceived E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task Mode360CommandReceived_CHECK_EVENT()
+ {
+ using (var eventWaiter = EventAwaiter<Mode360CommandReceivedEventArgs>.Create())
+ using (var manager = new MediaControllerManager())
+ {
+ var controller = manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+
+ MediaControlServer.Mode360CommandReceived += eventWaiter;
+
+ MediaControlServer.SetMode360Capability(MediaControlCapabilitySupport.Supported);
+
+ await Task.Run(() =>
+ {
+ controller.RequestAsync(new Mode360Command(true));
+ });
+
+ var result = await eventWaiter.GetResultAsync();
+
+ Assert.That(result.Command.IsEnabled, Is.EqualTo(true), "Should be same value.");
+
+ MediaControlServer.Mode360CommandReceived -= eventWaiter;
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Invoked when server sends display mode command")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.DisplayModeCommandReceived E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task DisplayModeCommandReceived_CHECK_EVENT()
+ {
+ using (var eventWaiter = EventAwaiter<DisplayModeCommandReceivedEventArgs>.Create())
+ using (var manager = new MediaControllerManager())
+ {
+ var controller = manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+
+ MediaControlServer.DisplayModeCommandReceived += eventWaiter;
+
+ MediaControlServer.SetDisplayModeCapability(MediaControlDisplayMode.LetterBox,
+ MediaControlCapabilitySupport.Supported);
+
+ await Task.Run(() =>
+ {
+ controller.RequestAsync(new DisplayModeCommand(MediaControlDisplayMode.LetterBox));
+ });
+
+ var result = await eventWaiter.GetResultAsync();
+
+ Assert.That(result.Command.Mode, Is.EqualTo(MediaControlDisplayMode.LetterBox),
+ "Should be same value.");
+
+ MediaControlServer.DisplayModeCommandReceived -= eventWaiter;
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Invoked when server sends display rotation command")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.DisplayRotationCommandReceived E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task DisplayRotationCommandReceived_CHECK_EVENT()
+ {
+ using (var eventWaiter = EventAwaiter<DisplayRotationCommandReceivedEventArgs>.Create())
+ using (var manager = new MediaControllerManager())
+ {
+ var controller = manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+
+ MediaControlServer.DisplayRotationCommandReceived += eventWaiter;
+
+ MediaControlServer.SetDisplayRotationCapability(Rotation.Rotate180,
+ MediaControlCapabilitySupport.Supported);
+
+ await Task.Run(() =>
+ {
+ controller.RequestAsync(new DisplayRotationCommand(Rotation.Rotate180));
+ });
+
+ var result = await eventWaiter.GetResultAsync();
+
+ Assert.That(result.Command.Rotation, Is.EqualTo(Rotation.Rotate180),
+ "Should be same value.");
+
+ MediaControlServer.DisplayRotationCommandReceived -= eventWaiter;
+ }
+ }
}
}
[Property("SPEC_URL", "-")]
[Property("CRITERIA", "PRO")]
[Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")]
- public void IsRunning_READ_ONLY()
+ public void IsRunning_READ_ONLY_WHEN_SERVER_IS_NOT_RUNNING()
{
Assert.That(MediaControlServer.IsRunning, Is.False);
}
{
var appId = "serverAppId";
- Assert.That(() => new MediaControlServerStoppedEventArgs(appId).ServerAppId, Is.EqualTo(appId));
+ Assert.That(() => new MediaControlServerStoppedEventArgs(appId).ServerAppId, Is.EqualTo(appId),
+ "Should be same value");
}
}
}
MediaControlServer.SetShuffleModeEnabled(value);
- Assert.That((await eventAwaiter.GetResultAsync()).Enabled, Is.EqualTo(value));
+ Assert.That((await eventAwaiter.GetResultAsync()).Enabled, Is.EqualTo(value), "Should be same value");
}
}
MediaControlServer.SetRepeatMode(value);
- Assert.That((await eventAwaiter.GetResultAsync()).RepeatMode, Is.EqualTo(value));
+ Assert.That((await eventAwaiter.GetResultAsync()).RepeatMode, Is.EqualTo(value), "Should be same value");
}
}
MediaControlServer.SetPlaybackState(state, 0);
- Assert.That(_controller.GetPlaybackState(), Is.EqualTo(state));
+ Assert.That(_controller.GetPlaybackState(), Is.EqualTo(state), "Should be same value");
}
[Test]
MediaControlServer.SetPlaybackState(MediaControlPlaybackState.Paused, position);
- Assert.That(_controller.GetPlaybackPosition(), Is.EqualTo(position));
+ Assert.That(_controller.GetPlaybackPosition(), Is.EqualTo(position), "Should be same value");
}
[Test]
MediaControlServer.SetShuffleModeEnabled(value);
- Assert.That(_controller.IsShuffleModeEnabled(), Is.EqualTo(value));
+ Assert.That(_controller.IsShuffleModeEnabled(), Is.EqualTo(value), "Should be same value");
}
[Test]
MediaControlServer.SetRepeatMode(value);
- Assert.That(_controller.GetRepeatMode(), Is.EqualTo(value));
+ Assert.That(_controller.GetRepeatMode(), Is.EqualTo(value), "Should be same value");
}
[Test]
var ageRating = 12;
MediaControlServer.SetAgeRating(ageRating);
- Assert.That(_controller.GetAgeRatingOfCurrentPlayingMedia(), Is.EqualTo(ageRating));
+ Assert.That(_controller.GetAgeRatingOfCurrentPlayingMedia(), Is.EqualTo(ageRating), "Should be same value");
}
[Test]
var contentType = MediaControlContentType.Music;
MediaControlServer.SetPlaybackContentType(contentType);
- Assert.That(_controller.GetContentTypeOfCurrentPlayingMedia(), Is.EqualTo(contentType));
+ Assert.That(_controller.GetContentTypeOfCurrentPlayingMedia(), Is.EqualTo(contentType), "Should be same value");
}
[Test]
var iconPath = "test.jpg";
MediaControlServer.SetIconPath(iconPath);
- Assert.That(_controller.GetIconPath(), Is.EqualTo(iconPath));
+ Assert.That(_controller.GetIconPath(), Is.EqualTo(iconPath), "Should be same value");
}
[Test]
var index = "ID1";
MediaControlServer.SetIndexOfCurrentPlayingMedia(index);
- Assert.That(_controller.GetIndexOfCurrentPlayingMedia(), Is.EqualTo(index));
+ Assert.That(_controller.GetIndexOfCurrentPlayingMedia(), Is.EqualTo(index), "Should be same value");
+ }
+
+ [Test]
+ [Description("Sets subtile mode and get and compare with value")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.IsSubtitleModeEnabled M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void IsSubtitleModeEnabled_RETURN_VALUE()
+ {
+ Assert.That(() => MediaControlServer.SetSubtitleMode(true), Throws.Nothing);
+ Assert.That(_controller.IsSubtitleModeEnabled(), Is.EqualTo(true), "Should be same value.");
+
+ Assert.That(() => MediaControlServer.SetSubtitleMode(false), Throws.Nothing);
+ Assert.That(_controller.IsSubtitleModeEnabled(), Is.EqualTo(false), "Should be same value.");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether IsSubtitleModeEnabled throws exception if manager has already benn disposed")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.IsSubtitleModeEnabled M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void IsSubtitleModeEnabled_THROWS_OBJECT_IS_DISPOSED()
+ {
+ _manager.Dispose();
+
+ Assert.Throws<ObjectDisposedException>(() => _controller.IsSubtitleModeEnabled());
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether IsSubtitleModeEnabled throws exception if server has already benn stopped")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.IsSubtitleModeEnabled M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task IsSubtitleModeEnabled_THROWS_SERVER_IS_ALREADY_STOPPED()
+ {
+ using (var eventWaiter = EventAwaiter<MediaControlServerStoppedEventArgs>.Create())
+ {
+ _manager.ServerStopped += eventWaiter;
+
+ MediaControlServer.Stop();
+
+ await eventWaiter.IsRaisedAsync();
+
+ Assert.Throws<InvalidOperationException>(() => _controller.IsSubtitleModeEnabled());
+
+ _manager.ServerStopped -= eventWaiter;
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Sets 360 mode and get and compare with value")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.IsMode360Enabled M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void IsMode360Enabled_RETURN_VALUE()
+ {
+ Assert.That(() => MediaControlServer.SetMode360(true), Throws.Nothing);
+ Assert.That(_controller.IsMode360Enabled(), Is.EqualTo(true), "Should be same value.");
+
+ Assert.That(() => MediaControlServer.SetMode360(false), Throws.Nothing);
+ Assert.That(_controller.IsMode360Enabled(), Is.EqualTo(false), "Should be same value.");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether IsMode360Enabled throws exception if manager has already benn disposed")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.IsMode360Enabled M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void IsMode360Enabled_THROWS_OBJECT_IS_DISPOSED()
+ {
+ _manager.Dispose();
+
+ Assert.Throws<ObjectDisposedException>(() => _controller.IsMode360Enabled());
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether IsMode360Enabled throws exception if server has already benn stopped")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.IsMode360Enabled M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task IsMode360Enabled_THROWS_SERVER_IS_ALREADY_STOPPED()
+ {
+ using (var eventWaiter = EventAwaiter<MediaControlServerStoppedEventArgs>.Create())
+ {
+ _manager.ServerStopped += eventWaiter;
+
+ MediaControlServer.Stop();
+
+ await eventWaiter.IsRaisedAsync();
+
+ Assert.Throws<InvalidOperationException>(() => _controller.IsMode360Enabled());
+
+ _manager.ServerStopped -= eventWaiter;
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Sets display mode and get and compare with value")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.GetDisplayMode M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void GetDisplayMode_RETURN_VALUE()
+ {
+ foreach (MediaControlDisplayMode mode in Enum.GetValues(typeof(MediaControlDisplayMode)))
+ {
+ Assert.That(() => MediaControlServer.SetDisplayMode(mode), Throws.Nothing);
+ Assert.That(_controller.GetDisplayMode(), Is.EqualTo(mode), "Should be same value.");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether GetDisplayMode throws exception if manager has already benn disposed")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.GetDisplayMode M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void GetDisplayMode_THROWS_OBJECT_IS_DISPOSED()
+ {
+ _manager.Dispose();
+
+ Assert.Throws<ObjectDisposedException>(() => _controller.GetDisplayMode());
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether GetDisplayMode throws exception if server has already benn stopped")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.GetDisplayMode M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task GetDisplayMode_THROWS_SERVER_IS_ALREADY_STOPPED()
+ {
+ using (var eventWaiter = EventAwaiter<MediaControlServerStoppedEventArgs>.Create())
+ {
+ _manager.ServerStopped += eventWaiter;
+
+ MediaControlServer.Stop();
+
+ await eventWaiter.IsRaisedAsync();
+
+ Assert.Throws<InvalidOperationException>(() => _controller.GetDisplayMode());
+
+ _manager.ServerStopped -= eventWaiter;
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Sets display rotation and get and compare with value")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.GetDisplayRotation M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void GetDisplayRotation_RETURN_VALUE()
+ {
+ foreach (Rotation rotation in Enum.GetValues(typeof(Rotation)))
+ {
+ Assert.That(() => MediaControlServer.SetDisplayRotation(rotation), Throws.Nothing);
+ Assert.That(_controller.GetDisplayRotation(), Is.EqualTo(rotation), "Should be same value.");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether GetDisplayRotation throws exception if manager has already benn disposed")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.GetDisplayRotation M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void GetDisplayRotation_THROWS_OBJECT_IS_DISPOSED()
+ {
+ _manager.Dispose();
+
+ Assert.Throws<ObjectDisposedException>(() => _controller.GetDisplayRotation());
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether GetDisplayRotation throws exception if server has already benn stopped")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.GetDisplayRotation M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task GetDisplayRotation_THROWS_SERVER_IS_ALREADY_STOPPED()
+ {
+ using (var eventWaiter = EventAwaiter<MediaControlServerStoppedEventArgs>.Create())
+ {
+ _manager.ServerStopped += eventWaiter;
+
+ MediaControlServer.Stop();
+
+ await eventWaiter.IsRaisedAsync();
+
+ Assert.Throws<InvalidOperationException>(() => _controller.GetDisplayRotation());
+
+ _manager.ServerStopped -= eventWaiter;
+ }
}
[Test]
var isSupported = MediaControlCapabilitySupport.NotSupported;
MediaControlServer.SetPlaybackCapability(capability, isSupported);
- Assert.That(_controller.GetPlaybackCapability(capability), Is.EqualTo(isSupported));
+ Assert.That(_controller.GetPlaybackCapability(capability), Is.EqualTo(isSupported), "Should be same value");
isSupported = MediaControlCapabilitySupport.Supported;
MediaControlServer.SetPlaybackCapability(capability, isSupported);
- Assert.That(_controller.GetPlaybackCapability(capability), Is.EqualTo(isSupported));
+ Assert.That(_controller.GetPlaybackCapability(capability), Is.EqualTo(isSupported), "Should be same value");
}
}
var isSupported = MediaControlCapabilitySupport.NotSupported;
MediaControlServer.SetPlaybackCapability(capability, isSupported);
- Assert.That(_controller.GetPlaybackCapability(capability), Is.EqualTo(isSupported));
+ Assert.That(_controller.GetPlaybackCapability(capability), Is.EqualTo(isSupported), "Should be same value");
isSupported = MediaControlCapabilitySupport.Supported;
MediaControlServer.SetPlaybackCapability(capability, isSupported);
- Assert.That(_controller.GetPlaybackCapability(capability), Is.EqualTo(isSupported));
+ Assert.That(_controller.GetPlaybackCapability(capability), Is.EqualTo(isSupported), "Should be same value");
Assert.Throws<ArgumentException>(() => _controller.GetPlaybackCapability(MediaControlPlaybackCommand.Play - 1));
Assert.Throws<ArgumentException>(() => _controller.GetPlaybackCapability(MediaControlPlaybackCommand.Toggle + 1));
MediaControlServer.SetPlaybackCapabilities(capabilities);
- Assert.That(_controller.GetPlaybackCapabilities(), Is.EqualTo(capabilities));
+ Assert.That(_controller.GetPlaybackCapabilities(), Is.EqualTo(capabilities), "Should be same value");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Gets display mode capabilities")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.GetDisplayModeCapability M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void GetDisplayModeCapability_RETURN_VALUE()
+ {
+ var setModes = new List<MediaControlDisplayMode>()
+ {
+ MediaControlDisplayMode.LetterBox, MediaControlDisplayMode.CroppedFull
+ };
+
+ var setModesDict = new Dictionary<MediaControlDisplayMode, MediaControlCapabilitySupport>();
+ foreach (var mode in setModes)
+ {
+ setModesDict.Add(mode, MediaControlCapabilitySupport.Supported);
+ }
+
+ Assert.That(() => MediaControlServer.SetDisplayModeCapabilities(setModesDict), Throws.Nothing);
+
+ var supportedModes = _controller.GetDisplayModeCapability();
+ Assert.That(supportedModes.Count(), Is.EqualTo(setModes.Count), "Should be same value.");
+
+ foreach (var mode in supportedModes)
+ {
+ Assert.That(setModes.Contains(mode), "Should be same value.");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether GetDisplayModeCapability throws exception if parameter is invalid")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.GetDisplayModeCapability M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void GetDisplayModeCapability_OBJECT_IS_DISPOSED()
+ {
+ _manager.Dispose();
+
+ Assert.Throws<ObjectDisposedException>(() => _controller.GetDisplayModeCapability());
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether GetDisplayModeCapability throws exception if server has already benn stopped")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.GetDisplayModeCapability M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task GetDisplayModeCapability_THROWS_SERVER_IS_ALREADY_STOPPED()
+ {
+ using (var eventWaiter = EventAwaiter<MediaControlServerStoppedEventArgs>.Create())
+ {
+ _manager.ServerStopped += eventWaiter;
+
+ MediaControlServer.Stop();
+
+ await eventWaiter.IsRaisedAsync();
+
+ Assert.Throws<InvalidOperationException>(() => _controller.GetDisplayModeCapability());
+
+ _manager.ServerStopped -= eventWaiter;
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Gets display rotation capabilities")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.GetDisplayRotationapability M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void GetDisplayRotationapability_RETURN_VALUE()
+ {
+ var setRotations = new List<Rotation>()
+ {
+ Rotation.Rotate0, Rotation.Rotate180
+ };
+
+ var setRotationsDict = new Dictionary<Rotation, MediaControlCapabilitySupport>();
+ foreach (var rotation in setRotations)
+ {
+ setRotationsDict.Add(rotation, MediaControlCapabilitySupport.Supported);
+ }
+
+ Assert.That(() => MediaControlServer.SetDisplayRotationCapabilities(setRotationsDict), Throws.Nothing);
+
+ var supportedRotations = _controller.GetDisplayRotationapability();
+ Assert.That(supportedRotations.Count(), Is.EqualTo(setRotations.Count), "Should be same value.");
+
+ foreach (var rotation in supportedRotations)
+ {
+ Assert.That(setRotations.Contains(rotation), "Should be same value.");
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether GetDisplayRotationapability throws exception if parameter is invalid")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.GetDisplayRotationapability M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void GetDisplayRotationapability_OBJECT_IS_DISPOSED()
+ {
+ _manager.Dispose();
+
+ Assert.Throws<ObjectDisposedException>(() => _controller.GetDisplayRotationapability());
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether GetDisplayRotationapability throws exception if server has already benn stopped")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.GetDisplayRotationapability M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task GetDisplayRotationapability_THROWS_SERVER_IS_ALREADY_STOPPED()
+ {
+ using (var eventWaiter = EventAwaiter<MediaControlServerStoppedEventArgs>.Create())
+ {
+ _manager.ServerStopped += eventWaiter;
+
+ MediaControlServer.Stop();
+
+ await eventWaiter.IsRaisedAsync();
+
+ Assert.Throws<InvalidOperationException>(() => _controller.GetDisplayRotationapability());
+
+ _manager.ServerStopped -= eventWaiter;
+ }
}
[Test]
var index = "Song2";
MediaControlServer.SetInfoOfCurrentPlayingMedia(playlistName, index);
- Assert.That(_controller.GetPlaylistOfCurrentPlayingMedia().Name, Is.EqualTo(playlistName));
+ Assert.That(_controller.GetPlaylistOfCurrentPlayingMedia().Name, Is.EqualTo(playlistName), "Should be same value");
};
}
{
foreach (var playlist in _controller.GetPlaylists())
{
- Assert.IsTrue(playlist.Name.Equals(playlist1.Name) || playlist.Name.Equals(playlist2.Name));
+ Assert.IsTrue(playlist.Name.Equals(playlist1.Name) || playlist.Name.Equals(playlist2.Name),
+ "Should be same value");
}
};
}
public void GetRepeatModeCapability_RETURN_VALUE()
{
MediaControlServer.SetRepeatModeCapability(MediaControlCapabilitySupport.NotSupported);
- Assert.That(_controller.GetRepeatModeCapability(), Is.EqualTo(MediaControlCapabilitySupport.NotSupported));
+ Assert.That(_controller.GetRepeatModeCapability(), Is.EqualTo(MediaControlCapabilitySupport.NotSupported),
+ "Should be same value");
MediaControlServer.SetRepeatModeCapability(MediaControlCapabilitySupport.Supported);
- Assert.That(_controller.GetRepeatModeCapability(), Is.EqualTo(MediaControlCapabilitySupport.Supported));
+ Assert.That(_controller.GetRepeatModeCapability(), Is.EqualTo(MediaControlCapabilitySupport.Supported),
+ "Should be same value");
}
[Test]
public void GetShuffleModeCapability_RETURN_VALUE()
{
MediaControlServer.SetShuffleModeCapability(MediaControlCapabilitySupport.NotSupported);
- Assert.That(_controller.GetShuffleModeCapability(), Is.EqualTo(MediaControlCapabilitySupport.NotSupported));
+ Assert.That(_controller.GetShuffleModeCapability(), Is.EqualTo(MediaControlCapabilitySupport.NotSupported),
+ "Should be same value");
MediaControlServer.SetShuffleModeCapability(MediaControlCapabilitySupport.Supported);
- Assert.That(_controller.GetShuffleModeCapability(), Is.EqualTo(MediaControlCapabilitySupport.Supported));
+ Assert.That(_controller.GetShuffleModeCapability(), Is.EqualTo(MediaControlCapabilitySupport.Supported),
+ "Should be same value");
}
[Test]
[Test]
[Category("P1")]
+ [Description("Invoked when the server set subtitle mode")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.SubtitleModeUpdated E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task SubtitleModeUpdated_CHECK_EVENT()
+ {
+ bool[] modes = new bool[] { true, false };
+
+ foreach (var mode in modes)
+ {
+ using (var eventWaiter = EventAwaiter<SubtitleModeUpdatedEventArgs>.Create())
+ {
+ _controller.SubtitleModeUpdated += eventWaiter;
+
+ MediaControlServer.SetSubtitleMode(mode);
+
+ var args = await eventWaiter.GetResultAsync();
+ Assert.IsTrue(args.IsEnabled.Equals(mode), "Should be same value");
+
+ _controller.SubtitleModeUpdated -= eventWaiter;
+ }
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Invoked when the server set 360 mode")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.Mode360Updated E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task Mode360Updated_CHECK_EVENT()
+ {
+ bool[] modes = new bool[] { true, false };
+
+ foreach (var mode in modes)
+ {
+ using (var eventWaiter = EventAwaiter<Mode360UpdatedEventArgs>.Create())
+ {
+ _controller.Mode360Updated += eventWaiter;
+
+ MediaControlServer.SetMode360(mode);
+
+ var args = await eventWaiter.GetResultAsync();
+ Assert.IsTrue(args.IsEnabled.Equals(mode), "Should be same value");
+
+ _controller.Mode360Updated -= eventWaiter;
+ }
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Invoked when the server set display mode")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.DisplayModeUpdated E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task DisplayModeUpdated_CHECK_EVENT()
+ {
+ using (var eventWaiter = EventAwaiter<DisplayModeUpdatedEventArgs>.Create())
+ {
+ _controller.DisplayModeUpdated += eventWaiter;
+
+ MediaControlServer.SetDisplayMode(MediaControlDisplayMode.LetterBox);
+
+ var args = await eventWaiter.GetResultAsync();
+ Assert.IsTrue(args.DisplayMode.Equals(MediaControlDisplayMode.LetterBox),
+ "Should be same value");
+
+ _controller.DisplayModeUpdated -= eventWaiter;
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Invoked when the server set display rotation")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.DisplayRotationUpdated E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task DisplayRotationUpdated_CHECK_EVENT()
+ {
+ using (var eventWaiter = EventAwaiter<DisplayRotationUpdatedEventArgs>.Create())
+ {
+ _controller.DisplayRotationUpdated += eventWaiter;
+
+ MediaControlServer.SetDisplayRotation(Rotation.Rotate180);
+
+ var args = await eventWaiter.GetResultAsync();
+ Assert.IsTrue(args.Rotation.Equals(Rotation.Rotate180),
+ "Should be same value");
+
+ _controller.DisplayRotationUpdated -= eventWaiter;
+ }
+ }
+
+
+ [Test]
+ [Category("P1")]
[Description("Invoked when the server set repeat mode capability")]
[Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.RepeatModeCapabilityUpdated E")]
[Property("SPEC_URL", "-")]
MediaControlServer.SetRepeatModeCapability(MediaControlCapabilitySupport.NotSupported);
var args = await eventWaiter.GetResultAsync();
- Assert.IsTrue(args.Support.Equals(MediaControlCapabilitySupport.NotSupported));
+ Assert.IsTrue(args.Support.Equals(MediaControlCapabilitySupport.NotSupported),
+ "Should be same value");
}
}
MediaControlServer.SetShuffleModeCapability(MediaControlCapabilitySupport.NotSupported);
var args = await eventWaiter.GetResultAsync();
- Assert.IsTrue(args.Support.Equals(MediaControlCapabilitySupport.NotSupported));
+ Assert.IsTrue(args.Support.Equals(MediaControlCapabilitySupport.NotSupported),
+ "Should be same value");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Invoked when the server set display mode capability")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.DisplayModeCapabilityUpdated E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task DisplayModeCapabilityUpdated_CHECK_EVENT()
+ {
+ using (var eventWaiter = EventAwaiter<DisplayModeCapabilityUpdatedEventArgs>.Create())
+ {
+ _controller.DisplayModeCapabilityUpdated += eventWaiter;
+
+ MediaControlServer.SetDisplayModeCapability(MediaControlDisplayMode.LetterBox,
+ MediaControlCapabilitySupport.Supported);
+
+ var args = await eventWaiter.GetResultAsync();
+ Assert.That(args.DisplayMode.Count, Is.EqualTo(1), "Should be same value");
+ Assert.IsTrue(args.DisplayMode.Contains(MediaControlDisplayMode.LetterBox),
+ "Should be same value");
+
+ _controller.DisplayModeCapabilityUpdated -= eventWaiter;
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Invoked when the server set display rotation capability")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.MediaController.DisplayRotationCapabilityUpdated E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task DisplayRotationCapabilityUpdated_CHECK_EVENT()
+ {
+ using (var eventWaiter = EventAwaiter<DisplayRotationCapabilityUpdatedEventArgs>.Create())
+ {
+ _controller.DisplayRotationCapabilityUpdated += eventWaiter;
+
+ MediaControlServer.SetDisplayRotationCapability(Rotation.Rotate180,
+ MediaControlCapabilitySupport.Supported);
+
+ var args = await eventWaiter.GetResultAsync();
+ Assert.That(args.DisplayRotation.Count, Is.EqualTo(1), "Should be same value");
+ Assert.IsTrue(args.DisplayRotation.Contains(Rotation.Rotate180),
+ "Should be same value");
+
+ _controller.DisplayRotationCapabilityUpdated -= eventWaiter;
}
}
}
try
{
Assert.That((await eventAwaiter.GetResultAsync()).Controller.ServerAppId,
- Is.EqualTo(Application.Current.ApplicationInfo.ApplicationId));
+ Is.EqualTo(Application.Current.ApplicationInfo.ApplicationId), "Should be same value");
}
finally
{
MediaControlServer.Stop();
Assert.That((await eventAwaiter.GetResultAsync()).ServerAppId,
- Is.EqualTo(Application.Current.ApplicationInfo.ApplicationId));
+ Is.EqualTo(Application.Current.ApplicationInfo.ApplicationId), "Should be same value");
}
}
}
--- /dev/null
+using NUnit.Framework;
+using System;
+using System.Linq;
+using Tizen.Applications;
+
+namespace Tizen.Multimedia.Remoting.Tests
+{
+ [TestFixture]
+ [Description("Testing Tizen.Multimedia.Remoting.Mode360Command class")]
+ public class Mode360CommandTests
+ {
+ [Test]
+ [Category("P1")]
+ [Description("Create SubtitleModeCommand instance")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.Mode360Command.Mode360Command C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void Mode360Command_CHECK_CREATE_CONSTRUCTOR()
+ {
+ var command = new Mode360Command(false);
+ Assert.IsNotNull(command, "Object should not be null after initializing");
+ Assert.IsInstanceOf<Mode360Command>(command, "Should return Mode360Command instance");
+
+ var command2 = new Mode360Command(true);
+ Assert.IsNotNull(command2, "Object should not be null after initializing");
+ Assert.IsInstanceOf<Mode360Command>(command2, "Should return Mode360Command instance");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether IsEnabled property is type of bool or not.")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.Mode360Command.IsEnabled A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void IsEnabled_READ_ONLY()
+ {
+ var command = new Mode360Command(false);
+ Assert.IsInstanceOf<bool>(command.IsEnabled, "Should return Mode360Command instance");
+ Assert.That(command.IsEnabled, Is.EqualTo(false), "Should be same value.");
+
+ var command2 = new Mode360Command(true);
+ Assert.IsInstanceOf<bool>(command2.IsEnabled, "Should return Mode360Command instance");
+ Assert.That(command2.IsEnabled, Is.EqualTo(true), "Should be same value.");
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+using NUnit.Framework;
+using System.Linq;
+using System.Threading.Tasks;
+using Tizen.Applications;
+
+namespace Tizen.Multimedia.Remoting.Tests
+{
+ [TestFixture]
+ [Description("Testing Tizen.Multimedia.Remoting.Mode360CommandReceivedEventArgs class")]
+ public class Mode360CommandReceivedEventArgsTests
+ {
+ private MediaController _controller;
+ private MediaControllerManager _manager;
+
+ [SetUp]
+ public void SetUp()
+ {
+ MediaControlServer.Start();
+
+ _manager = new MediaControllerManager();
+ _controller = _manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ if (MediaControlServer.IsRunning)
+ {
+ MediaControlServer.Stop();
+ }
+
+ _manager.Dispose();
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether the 360 mode command is transfered to server using EventArgs class")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.Mode360CommandReceivedEventArgs.Command A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task Command_CHECK_READ_ONLY()
+ {
+ MediaControlServer.SetMode360Capability(MediaControlCapabilitySupport.Supported);
+
+ bool[] boolCapabilities = new bool[] { true, false };
+
+ foreach (var mode in boolCapabilities)
+ {
+ using (var eventWaiter = EventAwaiter<Mode360CommandReceivedEventArgs>.Create())
+ {
+ MediaControlServer.Mode360CommandReceived += eventWaiter;
+
+ Task.Run(async () => await _controller.RequestAsync(new Mode360Command(mode)));
+
+ var result = await eventWaiter.GetResultAsync();
+
+ Assert.IsNotNull(result.Command, "Object should not be null after initializing");
+ Assert.IsInstanceOf<Mode360Command>(result.Command, "Should return Mode360Command instance");
+ Assert.That(result.Command.IsEnabled, Is.EqualTo(mode), "Should be same value");
+
+ MediaControlServer.Mode360CommandReceived -= eventWaiter;
+ }
+ }
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using System.Linq;
+using System.Threading.Tasks;
+using Tizen.Applications;
+
+namespace Tizen.Multimedia.Remoting.Tests
+{
+ [TestFixture]
+ [Description("Testing Tizen.Multimedia.Remoting.Mode360UpdatedEventArgs class")]
+ public class Mode360UpdatedEventArgsTests
+ {
+ private MediaController _controller;
+ private MediaControllerManager _manager;
+
+ [SetUp]
+ public void SetUp()
+ {
+ MediaControlServer.Start();
+
+ _manager = new MediaControllerManager();
+ _controller = _manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ if (MediaControlServer.IsRunning)
+ {
+ MediaControlServer.Stop();
+ }
+
+ _manager.Dispose();
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether the 360 mode is transfered to controller using EventArgs class")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.Mode360UpdatedEventArgs.IsEnabled A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task IsEnabled_CHECK_READ_ONLY()
+ {
+ using (var eventWaiter = EventAwaiter<Mode360UpdatedEventArgs>.Create())
+ {
+ _controller.Mode360Updated += eventWaiter;
+
+ MediaControlServer.SetMode360(true);
+
+ var args = await eventWaiter.GetResultAsync();
+ Assert.IsTrue(args.IsEnabled.Equals(true), "Should be same value");
+
+ _controller.Mode360Updated -= eventWaiter;
+ }
+
+ using (var eventWaiter = EventAwaiter<Mode360UpdatedEventArgs>.Create())
+ {
+ _controller.Mode360Updated += eventWaiter;
+
+ MediaControlServer.SetMode360(false);
+
+ var args = await eventWaiter.GetResultAsync();
+ Assert.IsTrue(args.IsEnabled.Equals(false), "Should be same value");
+
+ _controller.Mode360Updated -= eventWaiter;
+ }
+ }
+ }
+}
+
{
var args = new PlaybackActionCommandReceivedEventArgs(new PlaybackCommand(MediaControlPlaybackCommand.Play));
- Assert.IsInstanceOf<PlaybackCommand>(args.Command);
- Assert.That(() => args.Command.Action, Is.EqualTo(MediaControlPlaybackCommand.Play));
+ Assert.IsInstanceOf<PlaybackCommand>(args.Command, "Should return PlaybackCommand instance");
+ Assert.That(() => args.Command.Action, Is.EqualTo(MediaControlPlaybackCommand.Play), "Should be same value");
}
}
}
{MediaControlPlaybackCommand.Play, MediaControlCapabilitySupport.Supported}
});
- Assert.IsInstanceOf<Dictionary<MediaControlPlaybackCommand, MediaControlCapabilitySupport>>(args.Support);
+ Assert.IsInstanceOf<Dictionary<MediaControlPlaybackCommand, MediaControlCapabilitySupport>>(args.Support,
+ "Should return Dictionary<MediaControlPlaybackCommand, MediaControlCapabilitySupport> instance");
args.Support.TryGetValue(MediaControlPlaybackCommand.Play, out MediaControlCapabilitySupport isSupported);
- Assert.That(() => isSupported, Is.EqualTo(MediaControlCapabilitySupport.Supported));
+ Assert.That(() => isSupported, Is.EqualTo(MediaControlCapabilitySupport.Supported), "Should be same value");
}
}
}
var appId = "cilentAppId";
var eventArgs = new PlaybackCommandReceivedEventArgs(appId, MediaControlPlaybackCommand.Stop);
- Assert.That(eventArgs.ClientAppId, Is.EqualTo(appId));
+ Assert.That(eventArgs.ClientAppId, Is.EqualTo(appId), "Should be same value");
}
[Test]
var command = MediaControlPlaybackCommand.Rewind;
var eventArgs = new PlaybackCommandReceivedEventArgs("appId", command);
- Assert.That(eventArgs.Command, Is.EqualTo(command));
+ Assert.That(eventArgs.Command, Is.EqualTo(command), "Should be same value");
}
}
}
\ No newline at end of file
[Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
public void Position_READ_ONLY()
{
- Assert.IsInstanceOf<ulong>(_command.Position);
- Assert.That(() => _command.Position, Is.EqualTo(_position));
+ Assert.IsInstanceOf<ulong>(_command.Position, "Should return ulong instance");
+ Assert.That(() => _command.Position, Is.EqualTo(_position), "Should be same value");
}
}
}
\ No newline at end of file
var position = 10U;
var args = new PlaybackPositionCommandReceivedEventArgs(new PlaybackPositionCommand(position));
- Assert.IsInstanceOf<ulong>(args.Command.Position);
- Assert.That(() => args.Command.Position, Is.EqualTo(position));
+ Assert.IsInstanceOf<ulong>(args.Command.Position, "Should return ulong instance");
+ Assert.That(() => args.Command.Position, Is.EqualTo(position), "Should be same value");
}
}
}
{
var state = MediaControlPlaybackState.Paused;
- Assert.That(new PlaybackStateUpdatedEventArgs(state, 0).State, Is.EqualTo(state));
+ Assert.That(new PlaybackStateUpdatedEventArgs(state, 0).State, Is.EqualTo(state), "Should be same value");
}
[Test]
var position = 987;
Assert.That(new PlaybackStateUpdatedEventArgs(MediaControlPlaybackState.None, position).Position,
- Is.EqualTo(position));
+ Is.EqualTo(position), "Should be same value");
}
}
}
[Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
public void Action_READ_ONLY()
{
- Assert.IsInstanceOf<MediaControlPlaybackCommand>(_command.Action);
- Assert.That(_command.Action, Is.EqualTo(_action));
+ Assert.IsInstanceOf<MediaControlPlaybackCommand>(_command.Action,
+ "Should return MediaControlPlaybackCommand instance");
+ Assert.That(_command.Action, Is.EqualTo(_action), "Should be same value");
}
[Test]
[Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
public void Position_READ_ONLY()
{
- Assert.IsInstanceOf<ulong>(_command.Position);
- Assert.That(_command.Position, Is.EqualTo(_position));
+ Assert.IsInstanceOf<ulong>(_command.Position, "Should return ulong instance");
+ Assert.That(_command.Position, Is.EqualTo(_position), "Should be same value");
}
[Test]
[Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
public void Index_READ_ONLY()
{
- Assert.IsInstanceOf<string>(_command.Index);
- Assert.That(_command.Index, Is.EqualTo(_index));
+ Assert.IsInstanceOf<string>(_command.Index, "Should return string instance");
+ Assert.That(_command.Index, Is.EqualTo(_index), "Should be same value");
}
[Test]
[Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
public void Name_READ_ONLY()
{
- Assert.IsInstanceOf<string>(_command.Name);
- Assert.That(_command.Name, Is.EqualTo(_playlistName));
+ Assert.IsInstanceOf<string>(_command.Name, "Should return string instance");
+ Assert.That(_command.Name, Is.EqualTo(_playlistName), "Should be same value");
}
}
}
\ No newline at end of file
var args = new PlaylistCommandReceivedEventArgs(
new PlaylistCommand(MediaControlPlaybackCommand.Play, "MyFavor", "ID1", 10U));
- Assert.IsInstanceOf<PlaylistCommand>(args.Command);
- Assert.That(args.Command.Action, Is.EqualTo(MediaControlPlaybackCommand.Play));
- Assert.That(args.Command.Position, Is.EqualTo(10U));
- Assert.That(args.Command.Index, Is.EqualTo("ID1"));
- Assert.That(args.Command.Name, Is.EqualTo("MyFavor"));
+ Assert.IsInstanceOf<PlaylistCommand>(args.Command, "Should return PlaylistCommand instance");
+ Assert.That(args.Command.Action, Is.EqualTo(MediaControlPlaybackCommand.Play), "Should be same value");
+ Assert.That(args.Command.Position, Is.EqualTo(10U), "Should be same value");
+ Assert.That(args.Command.Index, Is.EqualTo("ID1"), "Should be same value");
+ Assert.That(args.Command.Name, Is.EqualTo("MyFavor"), "Should be same value");
}
}
}
var args = new PlaylistUpdatedEventArgs(MediaControlPlaylistMode.Updated, "test",
new MediaControlPlaylist("Song1"));
- Assert.IsInstanceOf<MediaControlPlaylistMode>(args.Mode);
- Assert.That(args.Mode, Is.EqualTo(MediaControlPlaylistMode.Updated));
+ Assert.IsInstanceOf<MediaControlPlaylistMode>(args.Mode, "Should return MediaControlPlaylistMode instance");
+ Assert.That(args.Mode, Is.EqualTo(MediaControlPlaylistMode.Updated), "Should be same value");
}
[Test]
var args = new PlaylistUpdatedEventArgs(MediaControlPlaylistMode.Updated, "MyFavor",
new MediaControlPlaylist("Song1"));
- Assert.IsInstanceOf<string>(args.Name);
- Assert.That(args.Name, Is.EqualTo("MyFavor"));
+ Assert.IsInstanceOf<string>(args.Name, "Should return string instance");
+ Assert.That(args.Name, Is.EqualTo("MyFavor"), "Should be same value");
}
[Test]
var args = new PlaylistUpdatedEventArgs(MediaControlPlaylistMode.Updated, "test",
new MediaControlPlaylist("Song1"));
- Assert.IsInstanceOf<MediaControlPlaylist>(args.Playlist);
- Assert.That(args.Playlist.Name, Is.EqualTo("Song1"));
+ Assert.IsInstanceOf<MediaControlPlaylist>(args.Playlist, "Should return MediaControlPlaylist instance");
+ Assert.That(args.Playlist.Name, Is.EqualTo("Song1"), "Should be same value");
}
}
}
{
var args = new RepeatModeCapabilityUpdatedEventArgs(MediaControlCapabilitySupport.Supported);
- Assert.IsInstanceOf<MediaControlCapabilitySupport>(args.Support);
- Assert.That(args.Support, Is.EqualTo(MediaControlCapabilitySupport.Supported));
+ Assert.IsInstanceOf<MediaControlCapabilitySupport>(args.Support, "Should return MediaControlCapabilitySupport instance");
+ Assert.That(args.Support, Is.EqualTo(MediaControlCapabilitySupport.Supported), "Should be same value");
}
}
}
[Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
public void Mode_READ_ONLY()
{
- Assert.IsInstanceOf<MediaControlRepeatMode>(_command.Mode);
- Assert.That(_command.Mode, Is.EqualTo(MediaControlRepeatMode.Off));
+ Assert.IsInstanceOf<MediaControlRepeatMode>(_command.Mode, "Should return MediaControlRepeatMode instance");
+ Assert.That(_command.Mode, Is.EqualTo(MediaControlRepeatMode.Off), "Should be same value");
}
}
}
\ No newline at end of file
var args = new RepeatModeCommandReceivedEventArgs(
new RepeatModeCommand(MediaControlRepeatMode.Off));
- Assert.IsInstanceOf<RepeatModeCommand>(args.Command);
- Assert.That(args.Command.Mode, Is.EqualTo(MediaControlRepeatMode.Off));
+ Assert.IsInstanceOf<RepeatModeCommand>(args.Command, "Should return RepeatModeCommand instance");
+ Assert.That(args.Command.Mode, Is.EqualTo(MediaControlRepeatMode.Off), "Should be same value");
}
}
}
{
const MediaControlRepeatMode value = MediaControlRepeatMode.Off;
- Assert.That(new RepeatModeUpdatedEventArgs(value).RepeatMode, Is.EqualTo(value));
+ Assert.That(new RepeatModeUpdatedEventArgs(value).RepeatMode, Is.EqualTo(value), "Should be same value");
}
}
}
});
var args = await eventWaiter.GetResultAsync();
- Assert.IsInstanceOf<IEnumerable<MediaControlSearchCondition>>(args.Command.Conditions);
+ Assert.IsInstanceOf<IEnumerable<MediaControlSearchCondition>>(args.Command.Conditions,
+ "Should return IEnumerable<MediaControlSearchCondition> instance");
foreach (var iter in args.Command.Conditions)
{
- Assert.That(iter.ContentType, Is.EqualTo(MediaControlContentType.Music));
- Assert.That(iter.Category, Is.EqualTo(MediaControlSearchCategory.Artist));
- Assert.That(iter.Keyword, Is.EqualTo("GD"));
+ Assert.That(iter.ContentType, Is.EqualTo(MediaControlContentType.Music), "Should be same value");
+ Assert.That(iter.Category, Is.EqualTo(MediaControlSearchCategory.Artist), "Should be same value");
+ Assert.That(iter.Keyword, Is.EqualTo("GD"), "Should be same value");
}
}
}
{
foreach (var iter in e.Command.Conditions)
{
- Assert.That(iter.ContentType, Is.EqualTo(MediaControlContentType.Music));
- Assert.That(iter.Category, Is.EqualTo(MediaControlSearchCategory.Artist));
- Assert.That(iter.Keyword, Is.EqualTo("GD"));
+ Assert.That(iter.ContentType, Is.EqualTo(MediaControlContentType.Music), "Should be same value");
+ Assert.That(iter.Category, Is.EqualTo(MediaControlSearchCategory.Artist), "Should be same value");
+ Assert.That(iter.Keyword, Is.EqualTo("GD"), "Should be same value");
countdownEvent.Signal();
}
metadata.Season = season;
AssertHelper.PropertyReadWrite<MediaControlMetadata>(nameof(MediaControlMetadata.Season));
- Assert.That(metadata.Season.Number, Is.EqualTo(season.Number));
+ Assert.That(metadata.Season.Number, Is.EqualTo(season.Number), "Should be same value");
}
[Test]
metadata.Season = season;
AssertHelper.PropertyReadWrite<MediaControlMetadata>(nameof(MediaControlMetadata.Season));
- Assert.That(metadata.Season.Title, Is.EqualTo(season.Title));
+ Assert.That(metadata.Season.Title, Is.EqualTo(season.Title), "Should be same value");
}
}
}
\ No newline at end of file
var args = new ShuffleModeCapabilityUpdatedEventArgs(MediaControlCapabilitySupport.Supported);
Assert.IsInstanceOf<MediaControlCapabilitySupport>(args.Support);
- Assert.That(args.Support, Is.EqualTo(MediaControlCapabilitySupport.Supported));
+ Assert.That(args.Support, Is.EqualTo(MediaControlCapabilitySupport.Supported), "Should be same value");
}
}
}
[Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
public void Enabled_READ_ONLY()
{
- Assert.IsInstanceOf<bool>(_command.Enabled);
- Assert.That(_command.Enabled, Is.EqualTo(true));
+ Assert.IsInstanceOf<bool>(_command.Enabled, "Should return bool instance");
+ Assert.That(_command.Enabled, Is.EqualTo(true), "Should be same value");
var command = new ShuffleModeCommand(false);
- Assert.IsInstanceOf<bool>(command.Enabled);
- Assert.That(command.Enabled, Is.EqualTo(false));
+ Assert.IsInstanceOf<bool>(command.Enabled, "Should return bool instance");
+ Assert.That(command.Enabled, Is.EqualTo(false), "Should be same value");
}
}
}
\ No newline at end of file
var args = new ShuffleModeCommandReceivedEventArgs(new ShuffleModeCommand(false));
Assert.IsInstanceOf<ShuffleModeCommand>(args.Command);
- Assert.That(args.Command.Enabled, Is.EqualTo(false));
+ Assert.That(args.Command.Enabled, Is.EqualTo(false), "Should be same value");
}
}
}
{
const bool enabled = false;
- Assert.That(new ShuffleModeUpdatedEventArgs(enabled).Enabled, Is.EqualTo(enabled));
+ Assert.That(new ShuffleModeUpdatedEventArgs(enabled).Enabled, Is.EqualTo(enabled),
+ "Should be same value");
}
}
}
--- /dev/null
+using NUnit.Framework;
+using System;
+using System.Linq;
+using Tizen.Applications;
+
+namespace Tizen.Multimedia.Remoting.Tests
+{
+ [TestFixture]
+ [Description("Testing Tizen.Multimedia.Remoting.SubtitleModeCommand class")]
+ public class SubtitleModeCommandTests
+ {
+ [Test]
+ [Category("P1")]
+ [Description("Create SubtitleModeCommand instance")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.SubtitleModeCommand.SubtitleModeCommand C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void SubtitleModeCommand_CHECK_CREATE_CONSTRUCTOR()
+ {
+ var command = new SubtitleModeCommand(false);
+ Assert.IsNotNull(command, "Object should not be null after initializing");
+ Assert.IsInstanceOf<SubtitleModeCommand>(command, "Should return SubtitleModeCommand instance");
+
+ command = new SubtitleModeCommand(true);
+ Assert.IsNotNull(command, "Object should not be null after initializing");
+ Assert.IsInstanceOf<SubtitleModeCommand>(command, "Should return SubtitleModeCommand instance");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether IsEnabled property is type of bool or not.")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.SubtitleModeCommand.IsEnabled A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void IsEnabled_READ_ONLY()
+ {
+ var command = new SubtitleModeCommand(false);
+ Assert.IsInstanceOf<bool>(command.IsEnabled, "Should return SubtitleModeCommand instance");
+ Assert.That(command.IsEnabled, Is.EqualTo(false), "Should be same value.");
+
+ command = new SubtitleModeCommand(true);
+ Assert.IsInstanceOf<bool>(command.IsEnabled, "Should return SubtitleModeCommand instance");
+ Assert.That(command.IsEnabled, Is.EqualTo(true), "Should be same value.");
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+using NUnit.Framework;
+using System.Linq;
+using System.Threading.Tasks;
+using Tizen.Applications;
+
+namespace Tizen.Multimedia.Remoting.Tests
+{
+ [TestFixture]
+ [Description("Testing Tizen.Multimedia.Remoting.SubtitleModeCommandReceivedEventArgs class")]
+ public class SubtitleModeCommandReceivedEventArgsTests
+ {
+ private MediaController _controller;
+ private MediaControllerManager _manager;
+
+ [SetUp]
+ public void SetUp()
+ {
+ MediaControlServer.Start();
+
+ _manager = new MediaControllerManager();
+ _controller = _manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ if (MediaControlServer.IsRunning)
+ {
+ MediaControlServer.Stop();
+ }
+
+ _manager.Dispose();
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether the subtitle mode command is transfered to server using EventArgs class")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.SubtitleModeCommandReceivedEventArgs.Command A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task Command_CHECK_READ_ONLY()
+ {
+ MediaControlServer.SetSubtitleModeCapability(MediaControlCapabilitySupport.Supported);
+
+ bool[] boolCapabilities = new bool[] { true, false };
+
+ foreach (var mode in boolCapabilities)
+ {
+ using (var eventWaiter = EventAwaiter<SubtitleModeCommandReceivedEventArgs>.Create())
+ {
+ MediaControlServer.SubtitleModeCommandReceived += eventWaiter;
+
+ Task.Run(async () => await _controller.RequestAsync(new SubtitleModeCommand(mode)));
+
+ var result = await eventWaiter.GetResultAsync();
+
+ Assert.IsNotNull(result.Command, "Object should not be null after initializing");
+ Assert.IsInstanceOf<SubtitleModeCommand>(result.Command,
+ "Should return SubtitleModeCommand instance");
+ Assert.That(result.Command.IsEnabled, Is.EqualTo(mode), "Should be same value");
+
+ MediaControlServer.SubtitleModeCommandReceived -= eventWaiter;
+ }
+ }
+ }
+ }
+}
+
--- /dev/null
+using NUnit.Framework;
+using System.Linq;
+using System.Threading.Tasks;
+using Tizen.Applications;
+
+namespace Tizen.Multimedia.Remoting.Tests
+{
+ [TestFixture]
+ [Description("Testing Tizen.Multimedia.Remoting.SubtitleModeUpdatedEventArgs class")]
+ public class SubtitleModeUpdatedEventArgsTests
+ {
+ private MediaController _controller;
+ private MediaControllerManager _manager;
+
+ [SetUp]
+ public void SetUp()
+ {
+ MediaControlServer.Start();
+
+ _manager = new MediaControllerManager();
+ _controller = _manager.GetActiveControllers().Single(
+ c => c.ServerAppId == Application.Current.ApplicationInfo.ApplicationId);
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ if (MediaControlServer.IsRunning)
+ {
+ MediaControlServer.Stop();
+ }
+
+ _manager.Dispose();
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether the 360 mode is transfered to controller using EventArgs class")]
+ [Property("SPEC", "Tizen.Multimedia.Remoting.SubtitleModeUpdatedEventArgs.IsEnabled A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public async Task IsEnabled_CHECK_READ_ONLY()
+ {
+ MediaControlServer.SetSubtitleModeCapability(MediaControlCapabilitySupport.Supported);
+
+ using (var eventWaiter = EventAwaiter<SubtitleModeUpdatedEventArgs>.Create())
+ {
+ _controller.SubtitleModeUpdated += eventWaiter;
+
+ MediaControlServer.SetSubtitleMode(true);
+
+ var args = await eventWaiter.GetResultAsync();
+ Assert.IsTrue(args.IsEnabled.Equals(true), "Should be same value.");
+
+ _controller.SubtitleModeUpdated -= eventWaiter;
+ }
+
+ using (var eventWaiter = EventAwaiter<SubtitleModeUpdatedEventArgs>.Create())
+ {
+ _controller.SubtitleModeUpdated += eventWaiter;
+
+ MediaControlServer.SetSubtitleMode(false);
+
+ var args = await eventWaiter.GetResultAsync();
+ Assert.IsTrue(args.IsEnabled.Equals(false), "Should be same value.");
+
+ _controller.SubtitleModeUpdated -= eventWaiter;
+ }
+ }
+ }
+}