[Metadata][Non-ACR] Add negative TCs 68/241968/2
authorHaesu Gwon <haesu.gwon@samsung.com>
Fri, 21 Aug 2020 07:22:47 +0000 (16:22 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Mon, 24 Aug 2020 01:53:17 +0000 (01:53 +0000)
Change-Id: Ia4b9a7b06c43395423a6b2b36897a8511c37f229

tct-suite-vs/Tizen.Metadata.Tests/testcase/MetadataEditor/TSMetadataEditor.cs
tct-suite-vs/Tizen.Metadata.Tests/testcase/MetadataExtractor/TSMetadataExtractor.cs [changed mode: 0755->0644]

index 999c285fe1eb09fb17790f8937042c8048516b3a..0da2473d5fa3ca5de7f06dc1d12aea289497460e 100644 (file)
@@ -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<FileNotFoundException>(),
+                "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<ObjectDisposedException>(),
+                "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<ObjectDisposedException>(),
+                "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<ObjectDisposedException>(),
+                "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<ObjectDisposedException>(),
+                "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<ObjectDisposedException>(),
+                "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<ObjectDisposedException>(),
+                "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<ObjectDisposedException>(),
+                "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<ObjectDisposedException>(),
+                "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<ObjectDisposedException>(),
+                "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<ObjectDisposedException>(),
+                "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<ObjectDisposedException>(),
+                "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<ObjectDisposedException>(),
+                "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<ObjectDisposedException>(),
+                "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<ObjectDisposedException>(() => 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<ObjectDisposedException>(() => 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<ObjectDisposedException>(() => 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<ObjectDisposedException>(() => metadata.Commit(),
+                "Should throws proper exception");
+        }
     }
 }
old mode 100755 (executable)
new mode 100644 (file)
index c8785fb..4a9d3fe
@@ -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<ObjectDisposedException>(() => _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<ObjectDisposedException>(() => _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<ObjectDisposedException>(() => _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<ObjectDisposedException>(() => _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<ObjectDisposedException>(() => _metadataExtractor.GetSyncLyrics(1),
+                "Should throws proper exception");
+        }
     }
 }