From a6e4c3c404ea630c6fdb7a00ade1eeabbc845f37 Mon Sep 17 00:00:00 2001 From: Haesu Gwon Date: Wed, 9 Aug 2023 16:20:03 +0900 Subject: [PATCH] [TCSACR-547][Mediacontent] Deprecate unused APIs Change-Id: Ie3f8dc135a509e41afea2cdb66322124daaa5c0c --- .../testcase/TSFaceInfo.cs | 70 --- .../testcase/TSFaceInfoColumns.cs | 33 -- .../testcase/TSFaceInfoCommand.cs | 487 --------------------- .../testcase/TSImageInfo.cs | 48 -- .../testcase/TSMediaInfoCommand.cs | 34 -- .../testcase/TSMediaInfoCommand_DetectFace.cs | 334 -------------- .../testcase/TSMediaInfoCommand_FaceInfo.cs | 318 -------------- .../testcase/support/FaceInfoTestBase.cs | 29 -- .../testcase/support/TestSupport.cs | 10 - 9 files changed, 1363 deletions(-) delete mode 100755 tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSFaceInfo.cs delete mode 100755 tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSFaceInfoColumns.cs delete mode 100644 tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSFaceInfoCommand.cs delete mode 100644 tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSMediaInfoCommand_DetectFace.cs delete mode 100755 tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSMediaInfoCommand_FaceInfo.cs delete mode 100755 tct-suite-vs/Tizen.Mediacontent.Tests/testcase/support/FaceInfoTestBase.cs diff --git a/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSFaceInfo.cs b/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSFaceInfo.cs deleted file mode 100755 index e1edada..0000000 --- a/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSFaceInfo.cs +++ /dev/null @@ -1,70 +0,0 @@ -using NUnit.Framework; -using System.Threading.Tasks; - -namespace Tizen.Content.MediaContent.Tests -{ - [TestFixture] - [Description("Tizen.Content.MediaContent.FaceInfo Tests")] - public class FaceInfoTests : FaceInfoTestBase - { - [Test] - [Category("P1")] - [Description("Returns id")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfo.Id A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task Id_READ_ONLY() - { - Assert.That((await GetFaceInfo()).Id, Is.Not.Empty); - } - - [Test] - [Category("P1")] - [Description("Returns id of media info")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfo.MediaInfoId A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task MediaInfoId_READ_ONLY() - { - Assert.That((await GetFaceInfo()).MediaInfoId, Is.EqualTo(_mediaId)); - } - - [Test] - [Category("P1")] - [Description("Returns orientation")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfo.Orientation A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task Orientation_READ_ONLY() - { - Assert.That((await GetFaceInfo()).Orientation, Is.Not.Null); - } - - [Test] - [Category("P1")] - [Description("Returns rectangle of the face detected")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfo.Rect A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task Rect_READ_ONLY() - { - Assert.That((await GetFaceInfo()).Rect, Is.Not.Null); - } - - [Test] - [Category("P1")] - [Description("Returns null initially")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfo.Tag A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task Tag_READ_ONLY() - { - Assert.That((await GetFaceInfo()).Tag, Is.Empty); - } - } -} diff --git a/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSFaceInfoColumns.cs b/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSFaceInfoColumns.cs deleted file mode 100755 index 5db5bbe..0000000 --- a/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSFaceInfoColumns.cs +++ /dev/null @@ -1,33 +0,0 @@ -using NUnit.Framework; - -namespace Tizen.Content.MediaContent.Tests -{ - [TestFixture] - [Description("Tizen.Content.MediaContent.FaceInfoColumns Tests")] - public class FaceInfoColumnsTests : TestBase - { - [Test] - [Category("P1")] - [Description("Is read only")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoColumns.Id A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void Id_READ_ONLY() - { - Assert.That(FaceInfoColumns.Id, Is.Not.Empty); - } - - [Test] - [Category("P1")] - [Description("Is read only")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoColumns.Tag A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void Tag_READ_ONLY() - { - Assert.That(FaceInfoColumns.Tag, Is.Not.Empty); - } - } -} diff --git a/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSFaceInfoCommand.cs b/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSFaceInfoCommand.cs deleted file mode 100644 index 1d5fbc6..0000000 --- a/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSFaceInfoCommand.cs +++ /dev/null @@ -1,487 +0,0 @@ -using NUnit.Framework; -using System; -using System.Threading.Tasks; - -namespace Tizen.Content.MediaContent.Tests -{ - [TestFixture] - [Description("Tizen.Content.MediaContent.FaceInfoCommand Tests")] - public class FaceInfoCommandTests : FaceInfoTestBase - { - private FaceInfoCommand _cmd; - - [SetUp] - public void SetUp() - { - _cmd = new FaceInfoCommand(_database); - } - - [Test] - [Category("P1")] - [Description("Throws nothing")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.FaceInfoCommand C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTR")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void FaceInfoCommand_CONSTRUCTOR() - { - Assert.That(() => new FaceInfoCommand(_database), Throws.Nothing); - } - - [Test] - [Category("P2")] - [Description("Throws if the database is null")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.FaceInfoCommand C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTX")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void FaceInfoCommand_THROWS_IF_DB_NULL() - { - Assert.That(() => new FaceInfoCommand(null), Throws.ArgumentNullException); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disposed of")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.FaceInfoCommand C")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "CONSTX")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void FaceInfoCommand_THROWS_IF_DB_DISPOSED() - { - _database.Dispose(); - Assert.That(() => new FaceInfoCommand(_database), Throws.TypeOf()); - } - - [Test] - [Category("P1")] - [Description("Returns MediaDataReader containing result")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Select M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task Select_RETURNS() - { - await GetFaceInfo(); - - var reader = _cmd.Select(); - - bool isMatched = false; - while (reader.Read()) - { - if (reader.Current.MediaInfoId == _mediaId) - { - isMatched = true; - break; - } - } - - Assert.IsTrue(isMatched, "Select() should return correct result."); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disconnected")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Select M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void Select_THROWS_IF_DB_DISCONNECTED() - { - _database.Disconnect(); - Assert.That(() => _cmd.Select(), Throws.InvalidOperationException); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disposed of")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Select M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void Select_THROWS_IF_DB_DISPOSED() - { - _database.Dispose(); - Assert.That(() => _cmd.Select(), Throws.TypeOf()); - } - - [Test] - [Category("P1")] - [Description("Returns MediaDataReader containing result")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Select M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "SelectArguments")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task Select_WITH_ARGS() - { - await GetFaceInfo(); - - var arguments = new SelectArguments { TotalRowCount = 1 }; - - var reader = _cmd.Select(arguments); - Assert.That(reader.Read(), Is.True); - Assert.That(reader.Read(), Is.False); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disposed of")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Select M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "SelectArguments")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void Select_WITH_ARGS_THROWS_IF_DB_DISPOSED() - { - _database.Dispose(); - Assert.That(() => _cmd.Select(null), Throws.TypeOf()); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disconnected")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Select M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "SelectArguments")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void Select_WITH_ARGS_THROWS_IF_DB_DISCONNECTED() - { - _database.Disconnect(); - Assert.That(() => _cmd.Select(null), Throws.InvalidOperationException); - } - - [Test] - [Category("P1")] - [Description("Updates the database with the specified tag")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.UpdateTag M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task UpdateTag_CHECK() - { - const string tag = "tag"; - var faceInfo = await GetFaceInfo(); - - _cmd.UpdateTag(faceInfo.Id, tag); - - var reader = _cmd.Select( - new SelectArguments { FilterExpression = $"{FaceInfoColumns.Tag}='{tag}'" }); - reader.Read(); - - Assert.That(reader.Current.Tag, Is.EqualTo(tag)); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disconnected")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.UpdateTag M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void UpdateTag_THROWS_IF_DB_DISCONNECTED() - { - _database.Disconnect(); - Assert.That(() => _cmd.UpdateTag("id", "tag"), Throws.InvalidOperationException); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disposed of")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.UpdateTag M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void UpdateTag_THROWS_IF_DB_DISPOSED() - { - _database.Dispose(); - Assert.That(() => _cmd.UpdateTag("id", "tag"), Throws.TypeOf()); - } - [Test] - [Category("P2")] - [Description("Throws if id is null")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.UpdateTag M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void UpdateTag_IF_ID_NULL() - { - Assert.That(() => _cmd.UpdateTag(null, "tag"), Throws.ArgumentNullException); - } - - [Test] - [Category("P2")] - [Description("Throws if id is an empty string")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.UpdateTag M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void UpdateTag_IF_ID_EMPTY() - { - Assert.That(() => _cmd.UpdateTag(" ", "tag"), Throws.ArgumentException); - } - - [Test] - [Category("P2")] - [Description("Throws if the specified tag is null")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.UpdateTag M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void UpdateTag_IF_TAG_NULL() - { - Assert.That(() => _cmd.UpdateTag("id", null), Throws.ArgumentNullException); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disconnected")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Delete M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void Delete_THROWS_IF_DB_DISCONNECTED() - { - _database.Disconnect(); - Assert.That(() => _cmd.Delete("id"), Throws.InvalidOperationException); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disposed of")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Delete M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void Delete_THROWS_IF_DB_DISPOSED() - { - _database.Dispose(); - Assert.That(() => _cmd.Delete("id"), Throws.TypeOf()); - } - - [Test] - [Category("P2")] - [Description("Throws if id is null")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Delete M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void Delete_WITH_ID_NULL() - { - Assert.That(() => _cmd.Delete(null), Throws.ArgumentNullException); - } - - [Test] - [Category("P2")] - [Description("Throws if id is an empty string")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Delete M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void Delete_WITH_ID_EMPTY() - { - Assert.That(() => _cmd.Delete(" "), Throws.ArgumentException); - } - - [Test] - [Category("P1")] - [Description("Returns true if id is valid")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Delete M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task Delete_WITH_VALID_ID() - { - Assert.That(_cmd.Delete((await GetFaceInfo()).Id), Is.True); - } - - [Test] - [Category("P1")] - [Description("Returns false if id is invalid")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Delete M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void Delete_WITH_INVALID_ID() - { - Assert.That(_cmd.Delete("invalid_id"), Is.False); - } - - [Test] - [Category("P1")] - [Description("Insert face information to the database")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Insert M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string, Rectangle, Orientation")] - [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] - public void Insert_WITH_VALID_ID() - { - Assert.That(() => _cmd.Insert(_mediaId, new Rectangle(0, 0, 100, 100), - Orientation.Normal), Throws.Nothing); - } - - [Test] - [Category("P2")] - [Description("Throws ArgumentException if media id is invalid")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Insert M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, Rectangle, Orientation")] - [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] - public void Insert_WITH_INVALID_ID() - { - Assert.That(() => _cmd.Insert("invalid_id", new Rectangle(0, 0, 100, 100), - Orientation.Normal), Throws.ArgumentException); - } - - [Test] - [Category("P2")] - [Description("Throws ArgumentException if media id is an empty string")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Insert M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, Rectangle, Orientation")] - [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] - public void Insert_WITH_ID_EMPTY() - { - Assert.That(() => _cmd.Insert(" ", new Rectangle(0, 0, 100, 100), - Orientation.Normal), Throws.ArgumentException); - } - - [Test] - [Category("P2")] - [Description("Throws ArgumentNullException if media id is null")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Insert M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, Rectangle, Orientation")] - [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] - public void Insert_WITH_ID_NULL() - { - Assert.That(() => _cmd.Insert(null, new Rectangle(0, 0, 100, 100), - Orientation.Normal), Throws.ArgumentNullException); - } - - [Test] - [Category("P2")] - [Description("Throws ObjectDisposedException if the database has already been disposed")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Insert M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, Rectangle, Orientation")] - [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] - public void Insert_THROWS_IF_DB_DISPOSED() - { - _database.Dispose(); - - Assert.That(() => _cmd.Insert(_mediaId, new Rectangle(0, 0, 100, 100), - Orientation.Normal), Throws.TypeOf()); - } - - [Test] - [Category("P2")] - [Description("Throws InvalidOperationException if the database has already been disconnected")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Insert M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, Rectangle, Orientation")] - [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] - public void Insert_THROWS_IF_DB_DISCONNECTED() - { - _database.Disconnect(); - - Assert.That(() => _cmd.Insert(_mediaId, new Rectangle(0, 0, 100, 100), - Orientation.Normal), Throws.InvalidOperationException); - } - - [Test] - [Category("P1")] - [Description("Insert face information to the database with tag")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Insert M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string, Rectangle, Orientation, string")] - [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] - public void Insert_WITH_TAG_AND_VALID_ID() - { - Assert.That(() => _cmd.Insert(_mediaId, new Rectangle(0, 0, 100, 100), - Orientation.Normal, "MyFace"), Throws.Nothing); - } - - [Test] - [Category("P2")] - [Description("Throws ArgumentException if media id is invalid")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Insert M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, Rectangle, Orientation, string")] - [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] - public void Insert_WITH_TAG_AND_INVALID_ID() - { - Assert.That(() => _cmd.Insert("invalid_id", new Rectangle(0, 0, 100, 100), - Orientation.Normal, "MyFace"), Throws.ArgumentException); - } - - [Test] - [Category("P2")] - [Description("Throws ArgumentException if media id is an empty string")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Insert M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, Rectangle, Orientation, string")] - [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] - public void Insert_WITH_TAG_AND_ID_EMPTY() - { - Assert.That(() => _cmd.Insert(" ", new Rectangle(0, 0, 100, 100), - Orientation.Normal, "MyFace"), Throws.ArgumentException); - } - - [Test] - [Category("P2")] - [Description("Throws ArgumentNullException if media id is null")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Insert M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, Rectangle, Orientation, string")] - [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] - public void Insert_WITH_TAG_AND_ID_NULL() - { - Assert.That(() => _cmd.Insert(null, new Rectangle(0, 0, 100, 100), - Orientation.Normal, "MyFace"), Throws.ArgumentNullException); - } - - [Test] - [Category("P2")] - [Description("Throws ObjectDisposedException if the database has already been disposed")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Insert M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, Rectangle, Orientation, string")] - [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] - public void Insert_WITH_TAG_THROWS_IF_DB_DISPOSED() - { - _database.Dispose(); - - Assert.That(() => _cmd.Insert(_mediaId, new Rectangle(0, 0, 100, 100), - Orientation.Normal, "MyFace"), Throws.TypeOf()); - } - - [Test] - [Category("P2")] - [Description("Throws InvalidOperationException if the database has already been disconnected")] - [Property("SPEC", "Tizen.Content.MediaContent.FaceInfoCommand.Insert M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, Rectangle, Orientation, string")] - [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] - public void Insert_WITH_TAG_THROWS_IF_DB_DISCONNECTED() - { - _database.Disconnect(); - - Assert.That(() => _cmd.Insert(_mediaId, new Rectangle(0, 0, 100, 100), - Orientation.Normal, "MyFace"), Throws.InvalidOperationException); - } - } -} diff --git a/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSImageInfo.cs b/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSImageInfo.cs index 6420dbd..468a7f6 100755 --- a/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSImageInfo.cs +++ b/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSImageInfo.cs @@ -64,53 +64,5 @@ namespace Tizen.Content.MediaContent.Tests { Assert.That(_image.DateTaken, Is.Not.Empty); } - - [Test] - [Category("P1")] - [Description("Test for ImageInfo.ExposureTime Property")] - [Property("SPEC", "Tizen.Content.MediaContent.ImageInfo.ExposureTime A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void ExposureTime_READONLY() - { - Assert.That(_image.ExposureTime, Is.EqualTo("1/16")); - } - - [Test] - [Category("P1")] - [Description("Test for ImageInfo.FNumber Property")] - [Property("SPEC", "Tizen.Content.MediaContent.ImageInfo.FNumber A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void FNumber_READONLY() - { - Assert.That(_image.FNumber, Is.EqualTo(2.4)); - } - - [Test] - [Category("P1")] - [Description("Test for ImageInfo.Iso Property")] - [Property("SPEC", "Tizen.Content.MediaContent.ImageInfo.Iso A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void Iso_READONLY() - { - Assert.That(_image.Iso, Is.EqualTo(50)); - } - - [Test] - [Category("P1")] - [Description("Test for ImageInfo.Model Property")] - [Property("SPEC", "Tizen.Content.MediaContent.ImageInfo.Model A")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "PRO")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void Model_READONLY() - { - Assert.That(_image.Model, Is.Not.Empty); - } } } diff --git a/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSMediaInfoCommand.cs b/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSMediaInfoCommand.cs index fdc0609..2f45689 100644 --- a/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSMediaInfoCommand.cs +++ b/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSMediaInfoCommand.cs @@ -1,10 +1,7 @@ -using System.Runtime.CompilerServices; -using System.Xml.Linq; using NUnit.Framework; using System; using System.Collections.Generic; using System.IO; -using System.Threading; using System.Threading.Tasks; namespace Tizen.Content.MediaContent.Tests @@ -13,15 +10,6 @@ namespace Tizen.Content.MediaContent.Tests [Description("Tizen.Content.MediaContent.MediaInfoCommand Tests")] public class MediaInfoCommandTests : MediaInfoCommandTestBase { - private CancellationTokenSource cts; - - [TearDown] - public void Destroy() - { - if (cts != null) - cts.Dispose(); - } - [Test] [Category("P1")] [Description("Constructor test")] @@ -1397,27 +1385,5 @@ namespace Tizen.Content.MediaContent.Tests } #endregion - - [Test] - [Category("P1")] - [Description("Throws NotSupportedException if the feature is not supported")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.DetectFaceAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task DetectFaceAsync_FEATURE_CHECK() - { - try - { - await _cmd.DetectFaceAsync(_cmd.Add(TestConstants.FaceImageFile).Id); - - Assert.That(TestSupport.IsFaceDetectionSupported(), Is.True); - } - catch (NotSupportedException) - { - Assert.That(TestSupport.IsFaceDetectionSupported(), Is.False); - } - } } } diff --git a/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSMediaInfoCommand_DetectFace.cs b/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSMediaInfoCommand_DetectFace.cs deleted file mode 100644 index 2de0395..0000000 --- a/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSMediaInfoCommand_DetectFace.cs +++ /dev/null @@ -1,334 +0,0 @@ -using NUnit.Framework; -using System; -using System.IO; -using System.Threading; -using System.Threading.Tasks; - -namespace Tizen.Content.MediaContent.Tests -{ - [TestFixture] - [Description("Tizen.Content.MediaContent.MediaInfoCommand Tests regarding DetectFace")] - public class MediaInfoCommandDetectFaceTests : MediaInfoCommandTestBase - { - private CancellationTokenSource cts; - - [SetUp] - public void SetUp() - { - if (!TestSupport.IsFaceDetectionSupported()) - { - Assert.Pass("The feature(vision.face_recognition) is not supported."); - return; - } - } - - [TearDown] - public void Destroy() - { - if (cts != null) - cts.Dispose(); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disposed of")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.DetectFaceAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void DetectFaceAsync_THROWS_IF_DB_DISPOSED() - { - _database.Dispose(); - Assert.That(() => _cmd.DetectFaceAsync(_mediaInfo.Id), - Throws.TypeOf()); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disconnected")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.DetectFaceAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void DetectFaceAsync_THROWS_IF_DB_DISCONNECTED() - { - _database.Disconnect(); - Assert.That(() => _cmd.DetectFaceAsync(_mediaInfo.Id), Throws.InvalidOperationException); - } - - [Test] - [Category("P2")] - [Description("Throws if the id is null")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.DetectFaceAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void DetectFaceAsync_THROWS_IF_ID_NULL() - { - Assert.That(() => _cmd.DetectFaceAsync(null), Throws.ArgumentNullException); - } - - [Test] - [Category("P2")] - [Description("Throws if the id is an empty string")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.DetectFaceAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void DetectFaceAsync_THROWS_IF_ID_EMPTY() - { - Assert.That(() => _cmd.DetectFaceAsync(" "), Throws.ArgumentException); - } - - [Test] - [Category("P2")] - [Description("Throws if the media is not supported for face detection")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.DetectFaceAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task DetectFaceAsync_THROWS_IF_NOT_SUPPORTED_MEDIA() - { - await AssertHelper.ThrowsAsync( - () => _cmd.DetectFaceAsync(_cmd.Add(TestConstants.WavFile).Id)); - - await AssertHelper.ThrowsAsync( - () => _cmd.DetectFaceAsync(_cmd.Add(TestConstants.FaceImageFileUnSupported).Id)); - } - - [Test] - [Category("P2")] - [Description("Throws if the media file has been deleted")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.DetectFaceAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task DetectFaceAsync_THROWS_IF_FILE_ALREADY_DELETED() - { - var file = TestConstants.RootPath + "/temp.jpg"; - File.Copy(TestConstants.ImageFile, file, true); - var tempInfo = _cmd.Add(file); - File.Delete(file); - - await AssertHelper.ThrowsAsync( - () => _cmd.DetectFaceAsync(tempInfo.Id)); - } - - [Test] - [Category("P2")] - [Description("Throws if the media has deleted from the database")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.DetectFaceAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void DetectFaceAsync_THROWS_IF_MEDIA_DELETED() - { - var path = TestSupport.ClearDatabaseWithMediaId(_database, _mediaInfo.Id); - - try - { - _cmd.Delete(_mediaInfo.Id); - Assert.That(() => _cmd.DetectFaceAsync(_mediaInfo.Id), Throws.ArgumentException); - } - finally - { - TestSupport.RestoreFile(path); - } - } - - [Test] - [Category("P1")] - [Description("Returns the number of face info detected")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.DetectFaceAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task DetectFaceAsync_RETURN() - { - Assert.That(await _cmd.DetectFaceAsync(_cmd.Add(TestConstants.FaceImageFile).Id), - Is.GreaterThan(0)); - } - - [Test] - [Category("P1")] - [Description("Detects all again when it is called")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.DetectFaceAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task DetectFaceAsync_DETECT_ALL() - { - var imageInfo = _cmd.Add(TestConstants.FaceImageFile); - int count = await _cmd.DetectFaceAsync(imageInfo.Id); - - var reader = _cmd.SelectFaceInfo(imageInfo.Id); - reader.Read(); - - new FaceInfoCommand(_database).Delete(reader.Current.Id); - - Assert.That(await _cmd.DetectFaceAsync(imageInfo.Id), Is.EqualTo(count)); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disposed of")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.DetectFaceAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, CancellationToken")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void DetectFaceAsync_WITH_CANCELLATION_THROWS_IF_DB_DISPOSED() - { - _database.Dispose(); - Assert.That(() => _cmd.DetectFaceAsync(_mediaInfo.Id, CancellationToken.None), - Throws.TypeOf()); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disconnected")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.DetectFaceAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, CancellationToken")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void DetectFaceAsync_WITH_CANCELLATION_THROWS_IF_DB_DISCONNECTED() - { - _database.Disconnect(); - Assert.That(() => _cmd.DetectFaceAsync(_mediaInfo.Id, CancellationToken.None), - Throws.InvalidOperationException); - } - - [Test] - [Category("P2")] - [Description("Throws if the id is null")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.DetectFaceAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, CancellationToken")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void DetectFaceAsync_WITH_CANCELLATION_THROWS_IF_ID_NULL() - { - Assert.That(() => _cmd.DetectFaceAsync(null, CancellationToken.None), Throws.ArgumentNullException); - } - - [Test] - [Category("P2")] - [Description("Throws if the media is not supported for face detection")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.DetectFaceAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, CancellationToken")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task DetectFaceAsync_WITH_CANCELLATION_THROWS_IF_UNSUPPORTED_MEDIA() - { - await AssertHelper.ThrowsAsync( - () => _cmd.DetectFaceAsync(_cmd.Add(TestConstants.WavFile).Id, CancellationToken.None)); - } - - [Test] - [Category("P2")] - [Description("Throws if the media file has been deleted")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.DetectFaceAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, CancellationToken")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void DetectFaceAsync_WITH_CANCELLATION_THROWS_IF_FILE_NOT_EXIST() - { - var file = TestConstants.RootPath + "/temp"; - File.Copy(TestConstants.ImageFile, file, true); - - var tempInfo = _cmd.Add(file); - File.Delete(file); - - Assert.That(() => _cmd.DetectFaceAsync(tempInfo.Id, CancellationToken.None), - Throws.TypeOf()); - } - - [Test] - [Category("P2")] - [Description("Throws if the media has been deleted from the database")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.DetectFaceAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, CancellationToken")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void DetectFaceAsync_WITH_CANCELLATION_THROWS_IF_MEDIA_NOT_EXIST() - { - var path = TestSupport.ClearDatabaseWithMediaId(_database, _mediaInfo.Id); - - try - { - _cmd.Delete(_mediaInfo.Id); - Assert.That(() => _cmd.DetectFaceAsync(_mediaInfo.Id, CancellationToken.None), - Throws.ArgumentException); - } - finally - { - TestSupport.RestoreFile(path); - } - } - - [Test] - [Category("P1")] - [Description("Returns the number of face info detected")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.DetectFaceAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string, CancellationToken")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task DetectFaceAsync_WITH_CANCELLATION_RETURN() - { - var result = await _cmd.DetectFaceAsync(_cmd.Add(TestConstants.FaceImageFile).Id, - CancellationToken.None); - - Assert.That(result, Is.GreaterThan(0)); - } - - [Test] - [Category("P1")] - [Description("Returns canceled task if the source has already been canceled")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.DetectFaceAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string, CancellationToken")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void DetectFaceAsync_WITH_CANCELLATION_CANCELED() - { - cts = new CancellationTokenSource(); - cts.Cancel(); - - Assert.That( - _cmd.DetectFaceAsync(_cmd.Add(TestConstants.ImageFile).Id, cts.Token).IsCanceled, - Is.True); - } - - [Test] - [Category("P1")] - [Description("Task can be canceled")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.DetectFaceAsync M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string, CancellationToken")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void DetectFaceAsync_WITH_CANCELLATION_CANCEL() - { - cts = new CancellationTokenSource(); - var task = _cmd.DetectFaceAsync(_cmd.Add(TestConstants.ImageFile).Id, cts.Token); - - cts.Cancel(); - - Assert.That(task.IsCanceled, Is.True); - } - } -} diff --git a/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSMediaInfoCommand_FaceInfo.cs b/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSMediaInfoCommand_FaceInfo.cs deleted file mode 100755 index 5f766aa..0000000 --- a/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSMediaInfoCommand_FaceInfo.cs +++ /dev/null @@ -1,318 +0,0 @@ -using NUnit.Framework; -using System; -using System.Threading.Tasks; - -namespace Tizen.Content.MediaContent.Tests -{ - [TestFixture] - [Description("Tizen.Content.MediaContent.MediaInfoCommand Tests regarding FaceInfo")] - public class MediaInfoCommandFaceInfoTests : MediaInfoCommandTestBase - { - [SetUp] - public void SetUp() - { - if (!TestSupport.IsFaceDetectionSupported()) - { - Assert.Pass("The feature(vision.face_recognition) is not supported."); - return; - } - } - - private async Task DetectFace() - { - await _cmd.DetectFaceAsync(_mediaInfo.Id); - } - - [Test] - [Category("P1")] - [Description("Returns the number of face info")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.CountFaceInfo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task CountFaceInfo_RETURN() - { - await DetectFace(); - - Assert.That(_cmd.CountFaceInfo(_mediaInfo.Id), Is.GreaterThanOrEqualTo(1)); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disconnected")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.CountFaceInfo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void CountFaceInfo_THROWS_IF_DB_DISCONNECTED() - { - _database.Disconnect(); - Assert.That(() => _cmd.CountFaceInfo(_mediaInfo.Id), Throws.InvalidOperationException); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disposed of")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.CountFaceInfo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void CountFaceInfo_THROWS_IF_DB_DISPOSED() - { - _database.Dispose(); - Assert.That(() => _cmd.CountFaceInfo(_mediaInfo.Id), Throws.TypeOf()); - } - - [Test] - [Category("P2")] - [Description("Throws if the id is null")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.CountFaceInfo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void CountFaceInfo_THROWS_IF_ID_NULL() - { - Assert.That(() => _cmd.CountFaceInfo(null), Throws.ArgumentNullException); - } - - [Test] - [Category("P2")] - [Description("Throws if the id is an empty string")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.CountFaceInfo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void CountFaceInfo_THROWS_IF_ID_EMPTY() - { - Assert.That(() => _cmd.CountFaceInfo(" "), Throws.ArgumentException); - } - - [Test] - [Category("P1")] - [Description("Returns the number of face info")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.CountFaceInfo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string, CountArguments")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task CountFaceInfo_WITH_NULL_ARGS_RETURN() - { - await DetectFace(); - - Assert.That(_cmd.CountFaceInfo(_mediaInfo.Id, null), Is.GreaterThanOrEqualTo(1)); - } - - [Test] - [Category("P1")] - [Description("Returns the number of face info filtered")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.CountFaceInfo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string, CountArguments")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task CountFaceInfo_WITH_ARGS_RETURN() - { - await DetectFace(); - - CountArguments args = new CountArguments - { - FilterExpression = $"{MediaInfoColumns.Id}='{_mediaInfo.Id}'" - }; - - Assert.That(_cmd.CountFaceInfo(_mediaInfo.Id, args), Is.GreaterThanOrEqualTo(1)); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disconnected")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.CountFaceInfo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, CountArguments")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void CountFaceInfo_WITH_ARGS_THROWS_IF_DB_DISCONNECTED() - { - _database.Disconnect(); - Assert.That(() => _cmd.CountFaceInfo(_mediaInfo.Id, null), Throws.InvalidOperationException); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disposed of")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.CountFaceInfo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, CountArguments")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void CountFaceInfo_WITH_ARGS_THROWS_IF_DB_DISPOSED() - { - _database.Dispose(); - Assert.That(() => _cmd.CountFaceInfo(_mediaInfo.Id, null), Throws.TypeOf()); - } - - [Test] - [Category("P1")] - [Description("Returns MediaDataReader containing result")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.SelectFaceInfo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task SelectFaceInfo_RETURN() - { - await DetectFace(); - - var reader = _cmd.SelectFaceInfo(_mediaInfo.Id); - reader.Read(); - - Assert.That(reader.Current.MediaInfoId, Is.EqualTo(_mediaInfo.Id)); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disconnected")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.SelectFaceInfo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void SelectFaceInfo_THROWS_IF_DB_DISCONNECTED() - { - _database.Disconnect(); - Assert.That(() => _cmd.SelectFaceInfo(_mediaInfo.Id), Throws.InvalidOperationException); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disposed of")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.SelectFaceInfo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void SelectFaceInfo_THROWS_IF_DB_DISPOSED() - { - _database.Dispose(); - Assert.That(() => _cmd.SelectFaceInfo(_mediaInfo.Id), Throws.TypeOf()); - } - - [Test] - [Category("P2")] - [Description("Throws if the id is null")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.SelectFaceInfo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void SelectFaceInfo_THROWS_IF_ID_NULL() - { - Assert.That(() => _cmd.SelectFaceInfo(null), Throws.ArgumentNullException); - } - - [Test] - [Category("P2")] - [Description("Throws if the id is an empty string")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.SelectFaceInfo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void SelectFaceInfo_THROWS_IF_ID_EMPTY() - { - Assert.That(() => _cmd.SelectFaceInfo(" "), Throws.ArgumentException); - } - - [Test] - [Category("P1")] - [Description("Returns MediaDataReader containing result")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.SelectFaceInfo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string, SelectArguments")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task SelectFaceInfo_WITH_NULL_ARGS() - { - await DetectFace(); - - Assert.That(_cmd.SelectFaceInfo(_mediaInfo.Id, null).Read(), Is.True); - } - - [Test] - [Category("P1")] - [Description("Returns MediaDataReader containing filtered result")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.SelectFaceInfo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MR")] - [Property("COVPARAM", "string, SelectArguments")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public async Task SelectFaceInfo_WITH_ARGS() - { - await DetectFace(); - - var arguments = new SelectArguments { TotalRowCount = 1 }; - - var reader = _cmd.SelectFaceInfo(_mediaInfo.Id, arguments); - Assert.That(reader.Read(), Is.True); - Assert.That(reader.Read(), Is.False); - } - - [Test] - [Category("P2")] - [Description("Throws if id is null")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.SelectFaceInfo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, SelectArguments")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void SelectFaceInfo_WITH_ARGS_THROWS_IF_ID_NULL() - { - Assert.That(() => _cmd.SelectFaceInfo(null, null), Throws.ArgumentNullException); - } - - [Test] - [Category("P2")] - [Description("Throws if id is an empty string")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.SelectFaceInfo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, SelectArguments")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void SelectFaceInfo_WITH_ARGS_THROWS_IF_ID_EMPTY() - { - Assert.That(() => _cmd.SelectFaceInfo(" ", null), Throws.ArgumentException); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disposed")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.SelectFaceInfo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, SelectArguments")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void SelectFaceInfo_WITH_ARGS_THROWS_IF_DB_DISPOSED() - { - _database.Dispose(); - Assert.That(() => _cmd.SelectFaceInfo(_mediaInfo.Id, null), Throws.TypeOf()); - } - - [Test] - [Category("P2")] - [Description("Throws if the database has already been disconnected")] - [Property("SPEC", "Tizen.Content.MediaContent.MediaInfoCommand.SelectFaceInfo M")] - [Property("SPEC_URL", "-")] - [Property("CRITERIA", "MEX")] - [Property("COVPARAM", "string, SelectArguments")] - [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void SelectFaceInfo_WITH_ARGS_THROWS_IF_DB_DISCONNECTED() - { - _database.Disconnect(); - Assert.That(() => _cmd.SelectFaceInfo(_mediaInfo.Id, null), Throws.InvalidOperationException); - } - } -} diff --git a/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/support/FaceInfoTestBase.cs b/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/support/FaceInfoTestBase.cs deleted file mode 100755 index 3f911ca..0000000 --- a/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/support/FaceInfoTestBase.cs +++ /dev/null @@ -1,29 +0,0 @@ -using NUnit.Framework; -using System.Threading.Tasks; - -namespace Tizen.Content.MediaContent.Tests -{ - public class FaceInfoTestBase : TestBase - { - protected string _mediaId; - protected MediaInfoCommand _mediaInfoCmd; - - [SetUp] - public new void SetUpBase() - { - if (!TestSupport.IsFaceDetectionSupported()) - { - Assert.Pass("The feature(vision.face_recognition) is not supported."); - return; - } - - _mediaInfoCmd = new MediaInfoCommand(_database); - _mediaId = _mediaInfoCmd.Add(TestConstants.FaceImageFile).Id; - } - - protected async Task GetFaceInfo() - { - return await TestSupport.GetFaceInfo(_mediaInfoCmd, _mediaId); - } - } -} diff --git a/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/support/TestSupport.cs b/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/support/TestSupport.cs index 4b62f98..66ba983 100644 --- a/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/support/TestSupport.cs +++ b/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/support/TestSupport.cs @@ -25,16 +25,6 @@ namespace Tizen.Content.MediaContent.Tests } } - public static async Task GetFaceInfo(MediaInfoCommand cmd, string mediaId) - { - await cmd.DetectFaceAsync(mediaId); - - var reader = cmd.SelectFaceInfo(mediaId); - reader.Read(); - - return reader.Current; - } - public const string Feature = "http://tizen.org/feature/vision.face_recognition"; public static bool IsFaceDetectionSupported() -- 2.7.4