From: Haesu Gwon Date: Fri, 21 Aug 2020 07:22:47 +0000 (+0900) Subject: [Metadata][Non-ACR] Add negative TCs X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=90fa349308ee36991b99ce75ca977cb3e35210e0;p=test%2Ftct%2Fcsharp%2Fapi.git [Metadata][Non-ACR] Add negative TCs Change-Id: Ia4b9a7b06c43395423a6b2b36897a8511c37f229 --- diff --git a/tct-suite-vs/Tizen.Metadata.Tests/testcase/MetadataEditor/TSMetadataEditor.cs b/tct-suite-vs/Tizen.Metadata.Tests/testcase/MetadataEditor/TSMetadataEditor.cs index 999c285fe..0da2473d5 100644 --- a/tct-suite-vs/Tizen.Metadata.Tests/testcase/MetadataEditor/TSMetadataEditor.cs +++ b/tct-suite-vs/Tizen.Metadata.Tests/testcase/MetadataEditor/TSMetadataEditor.cs @@ -11,6 +11,7 @@ namespace Tizen.Multimedia.Tests private readonly string[] _fileFormat = { ".flac", ".mp3", ".ogg", ".wav" }; private readonly string _originPath = "/opt/usr/home/owner/share/res/test_editor"; private readonly string _filePath = "/opt/usr/home/owner/share/res/copied"; + private readonly string _filePathNotExist = "/opt/usr/home/owner/share/res/not_exist"; private readonly string _artworkPath = "/opt/usr/home/owner/share/res/test_artwork.jpg"; [SetUp] @@ -76,7 +77,8 @@ namespace Tizen.Multimedia.Tests [Property("AUTHOR", "Minje Ahn, minje.ahn@samsung.com")] public void MetadataEditor_CHECK_CREATE_CONSTRUCTOR_WITH_NULL_PATH() { - Assert.That(() => new MetadataEditor(null), Throws.ArgumentNullException); + Assert.That(() => new MetadataEditor(null), Throws.ArgumentNullException, + "Should throws proper exception"); } [Test] @@ -86,9 +88,36 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "CONSTX")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public void MetadataEditor_THROWS_IF_PATH_EMPTY() + public void MetadataEditor_THROWS_IF_PATH_WHITE_SPACE_STRING() { - Assert.That(() => new MetadataEditor(" "), Throws.ArgumentException); + Assert.That(() => new MetadataEditor(" "), Throws.ArgumentException, + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Throws if path is empty string")] + [Property("SPEC", "Tizen.Multimedia.MetadataEditor.MetadataEditor C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void MetadataEditor_THROWS_IF_PATH_EMPTY_STRING() + { + Assert.That(() => new MetadataEditor(""), Throws.ArgumentException, + "Should throws proper exception"); + } + + [Test] + [Category("P2")] + [Description("Throws if files does not exist")] + [Property("SPEC", "Tizen.Multimedia.MetadataEditor.MetadataEditor C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void MetadataEditor_THROWS_IF_FILE_NOT_EXIST() + { + Assert.That(() => new MetadataEditor(_filePathNotExist), Throws.TypeOf(), + "Should throws proper exception"); } [Test] @@ -111,6 +140,22 @@ namespace Tizen.Multimedia.Tests } } + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataEditor.Artist A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Artist_THROWS_IF_DISPOSED() + { + var metadata = new MetadataEditor(_filePath + _fileFormat[0]); + metadata.Dispose(); + + Assert.That(() => metadata.Artist, Throws.TypeOf(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test for MetadataEditor.Title Property")] @@ -131,6 +176,22 @@ namespace Tizen.Multimedia.Tests } } + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataEditor.Title A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Title_THROWS_IF_DISPOSED() + { + var metadata = new MetadataEditor(_filePath + _fileFormat[0]); + metadata.Dispose(); + + Assert.That(() => metadata.Title, Throws.TypeOf(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test for MetadataEditor.Album Property")] @@ -151,6 +212,22 @@ namespace Tizen.Multimedia.Tests } } + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataEditor.Album A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Album_THROWS_IF_DISPOSED() + { + var metadata = new MetadataEditor(_filePath + _fileFormat[0]); + metadata.Dispose(); + + Assert.That(() => metadata.Album, Throws.TypeOf(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test for MetadataEditor.Genre Property")] @@ -171,6 +248,22 @@ namespace Tizen.Multimedia.Tests } } + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataEditor.Genre A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Genre_THROWS_IF_DISPOSED() + { + var metadata = new MetadataEditor(_filePath + _fileFormat[0]); + metadata.Dispose(); + + Assert.That(() => metadata.Genre, Throws.TypeOf(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test for MetadataEditor.Author Property")] @@ -191,6 +284,22 @@ namespace Tizen.Multimedia.Tests } } + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataEditor.Author A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Author_THROWS_IF_DISPOSED() + { + var metadata = new MetadataEditor(_filePath + _fileFormat[0]); + metadata.Dispose(); + + Assert.That(() => metadata.Author, Throws.TypeOf(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test for MetadataEditor.Copyright Property")] @@ -211,6 +320,22 @@ namespace Tizen.Multimedia.Tests } } + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataEditor.Copyright A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Copyright_THROWS_IF_DISPOSED() + { + var metadata = new MetadataEditor(_filePath + _fileFormat[0]); + metadata.Dispose(); + + Assert.That(() => metadata.Copyright, Throws.TypeOf(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test for MetadataEditor.Date Property")] @@ -231,6 +356,22 @@ namespace Tizen.Multimedia.Tests } } + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataEditor.Date A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Date_THROWS_IF_DISPOSED() + { + var metadata = new MetadataEditor(_filePath + _fileFormat[0]); + metadata.Dispose(); + + Assert.That(() => metadata.Date, Throws.TypeOf(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test for MetadataEditor.Description Property")] @@ -251,6 +392,22 @@ namespace Tizen.Multimedia.Tests } } + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataEditor.Description A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Description_THROWS_IF_DISPOSED() + { + var metadata = new MetadataEditor(_filePath + _fileFormat[0]); + metadata.Dispose(); + + Assert.That(() => metadata.Description, Throws.TypeOf(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test for MetadataEditor.Comment Property")] @@ -271,6 +428,22 @@ namespace Tizen.Multimedia.Tests } } + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataEditor.Comment A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Comment_THROWS_IF_DISPOSED() + { + var metadata = new MetadataEditor(_filePath + _fileFormat[0]); + metadata.Dispose(); + + Assert.That(() => metadata.Comment, Throws.TypeOf(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test for MetadataEditor.TrackNumber Property")] @@ -291,6 +464,22 @@ namespace Tizen.Multimedia.Tests } } + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataEditor.TrackNumber A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void TrackNumber_THROWS_IF_DISPOSED() + { + var metadata = new MetadataEditor(_filePath + _fileFormat[0]); + metadata.Dispose(); + + Assert.That(() => metadata.TrackNumber, Throws.TypeOf(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test for MetadataEditor.PictureCount Property")] @@ -311,6 +500,22 @@ namespace Tizen.Multimedia.Tests } } + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataEditor.PictureCount A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void PictureCount_THROWS_IF_DISPOSED() + { + var metadata = new MetadataEditor(_filePath + _fileFormat[0]); + metadata.Dispose(); + + Assert.That(() => metadata.PictureCount, Throws.TypeOf(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test for MetadataEditor.Conductor Property")] @@ -331,6 +536,22 @@ namespace Tizen.Multimedia.Tests } } + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataEditor.Conductor A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Conductor_THROWS_IF_DISPOSED() + { + var metadata = new MetadataEditor(_filePath + _fileFormat[0]); + metadata.Dispose(); + + Assert.That(() => metadata.Conductor, Throws.TypeOf(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test for MetadataEditor.UnsyncLyrics Property")] @@ -351,6 +572,22 @@ namespace Tizen.Multimedia.Tests } } + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataEditor.UnsyncLyrics A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void UnsyncLyrics_THROWS_IF_DISPOSED() + { + var metadata = new MetadataEditor(_filePath + _fileFormat[0]); + metadata.Dispose(); + + Assert.That(() => metadata.UnsyncLyrics, Throws.TypeOf(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test when get the artwork from the test media using GetPicture method")] @@ -392,6 +629,22 @@ namespace Tizen.Multimedia.Tests } } + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataEditor.GetPicture M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void GetPicture_THROWS_IF_DISPOSED() + { + var metadata = new MetadataEditor(_filePath + _fileFormat[0]); + metadata.Dispose(); + + Assert.Throws(() => metadata.GetPicture(0), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test when append the artwork to the test media using AddPicture method")] @@ -437,6 +690,22 @@ namespace Tizen.Multimedia.Tests } } + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataEditor.AddPicture M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void AddPicture_THROWS_IF_DISPOSED() + { + var metadata = new MetadataEditor(_filePath + _fileFormat[0]); + metadata.Dispose(); + + Assert.Throws(() => metadata.AddPicture(_artworkPath), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test when remove the artwork from the test media using RemovePicture method")] @@ -480,6 +749,22 @@ namespace Tizen.Multimedia.Tests } } + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataEditor.RemovePicture M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void RemovePicture_THROWS_IF_DISPOSED() + { + var metadata = new MetadataEditor(_filePath + _fileFormat[0]); + metadata.Dispose(); + + Assert.Throws(() => metadata.RemovePicture(0), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Test when writing a file using Commit method")] @@ -501,5 +786,23 @@ namespace Tizen.Multimedia.Tests } } } + + [Test] + [Category("P2")] + [Description("Test when writing a file using Commit method")] + [Property("SPEC", "Tizen.Multimedia.MetadataEditor.Commit M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Commit_THROWS_IF_DISPOSED() + { + var metadata = new MetadataEditor(_filePath + _fileFormat[0]); + metadata.Artist = "Artist"; + + metadata.Dispose(); + + Assert.Throws(() => metadata.Commit(), + "Should throws proper exception"); + } } } diff --git a/tct-suite-vs/Tizen.Metadata.Tests/testcase/MetadataExtractor/TSMetadataExtractor.cs b/tct-suite-vs/Tizen.Metadata.Tests/testcase/MetadataExtractor/TSMetadataExtractor.cs old mode 100755 new mode 100644 index c8785fbee..4a9d3fe08 --- a/tct-suite-vs/Tizen.Metadata.Tests/testcase/MetadataExtractor/TSMetadataExtractor.cs +++ b/tct-suite-vs/Tizen.Metadata.Tests/testcase/MetadataExtractor/TSMetadataExtractor.cs @@ -105,6 +105,21 @@ namespace Tizen.Multimedia.Tests Assert.IsNotNull(_metadataExtractor.GetMetadata()); } + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataExtractor.GetMetadata M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void GetMetadata_THROWS_IF_DISPOSED() + { + _metadataExtractor.Dispose(); + + Assert.Throws(() => _metadataExtractor.GetMetadata(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Get Artwork information and check existence")] @@ -120,6 +135,21 @@ namespace Tizen.Multimedia.Tests Log.Info(LogTag, "MetadataExtractor Test GetArtwork finished"); } + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataExtractor.GetArtwork M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void GetArtwork_THROWS_IF_DISPOSED() + { + _metadataExtractor.Dispose(); + + Assert.Throws(() => _metadataExtractor.GetArtwork(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Get video thumbnail and check created thumbnail")] @@ -135,6 +165,21 @@ namespace Tizen.Multimedia.Tests Log.Info(LogTag, "MetadataExtractor Test GetVideoThumbnail finished"); } + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataExtractor.GetVideoThumbnail M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void GetVideoThumbnail_THROWS_IF_DISPOSED() + { + _metadataExtractor.Dispose(); + + Assert.Throws(() => _metadataExtractor.GetVideoThumbnail(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Get frame data of specified time and check created frame")] @@ -150,6 +195,21 @@ namespace Tizen.Multimedia.Tests Log.Info(LogTag, "MetadataExtractor Test GetFrameAt finished"); } + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataExtractor.GetFrameAt M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void GetFrameAt_THROWS_IF_DISPOSED() + { + _metadataExtractor.Dispose(); + + Assert.Throws(() => _metadataExtractor.GetFrameAt(1, true), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Get Synchronized lyrics information and check existence")] @@ -164,5 +224,20 @@ namespace Tizen.Multimedia.Tests Assert.IsNull(_metadataExtractor.GetSyncLyrics(1)); Log.Info(LogTag, "MetadataExtractor Test GetSyncLyrics finished"); } + + [Test] + [Category("P2")] + [Description("Throws if object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MetadataExtractor.GetSyncLyrics M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void GetSyncLyrics_THROWS_IF_DISPOSED() + { + _metadataExtractor.Dispose(); + + Assert.Throws(() => _metadataExtractor.GetSyncLyrics(1), + "Should throws proper exception"); + } } }