コード例 #1
0
        public void ImageAsset_InitializeWithFile_ButDoNotLoad_VerifyEmptyFields()
        {
            var sut = new ImageAsset(testFileSystem, testFileSystem.Path.Combine(mockFolderParth, TestJpegFile1FileName));

            sut.Should().NotBeNull();
            sut.Title.Should().Be(string.Empty);
            sut.Description.Should().Be(string.Empty);
            sut.Keywords.Should().BeEquivalentTo(new List <string>());
        }
コード例 #2
0
        public void ImageAsset_InitializeWithExistingFile_RemoveFileAndTryRead_ExpectException()
        {
            var testFile = testFileSystem.Path.Combine(mockFolderParth, TestJpegFile1FileName);
            var sut      = new ImageAsset(testFileSystem, testFile);

            sut.Should().NotBeNull();
            sut.Title.Should().Be(string.Empty);
            this.testFileSystem.RemoveFile(testFile);
            Assert.Throws <FileNotFoundException>(() => sut.ReadMetaData());
        }
コード例 #3
0
        public void ImageAsset_LoadTestFileWithKnownMetadata_VerifyReadCorrectly()
        {
            var sut = new ImageAsset(testFileSystem, testFileSystem.Path.Combine(mockFolderParth, TestJpegFile1FileName));

            sut.Should().NotBeNull();

            // just double check setup
            sut.Title.Should().Be(string.Empty);
            sut.Description.Should().Be(string.Empty);
            sut.Keywords.Should().BeEquivalentTo(new List <string>());

            sut.ReadMetaData();

            sut.Title.Should().Be(testJpegFile1Title);
            sut.Description.Should().Be(testJpegFile1Description);
            sut.Keywords.Should().BeEquivalentTo(testJpegFile1Keywords);
        }