From: Haesu Gwon Date: Mon, 15 Jul 2019 05:50:20 +0000 (+0900) Subject: [Mediacontent][TCSACR-249] Add face insert method X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1604fa1d3b6ba0e197bc77622cca962775ed845a;p=test%2Ftct%2Fcsharp%2Fapi.git [Mediacontent][TCSACR-249] Add face insert method Change-Id: Ie57f8d498538603351b737f6cc14aac1e7e37d3b --- diff --git a/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSFaceInfoCommand.cs b/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSFaceInfoCommand.cs old mode 100755 new mode 100644 index 1a391b6dd..903c261ef --- a/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSFaceInfoCommand.cs +++ b/tct-suite-vs/Tizen.Mediacontent.Tests/testcase/TSFaceInfoCommand.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using System; using System.Threading.Tasks; @@ -299,5 +299,180 @@ namespace Tizen.Content.MediaContent.Tests 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); + } } }