public void AddSubdirectory_Throws_WhenSubDirectoryIsNull()
        {
            //arrange
            CompositiveDirectory <string> subDirectory = null;

            //act
            var sut = MockedItemsFactory.ProvideDefaultDirectory((x, y, z) => new CompositiveDirectory <string>(x, y, z));

            sut.AddSubdirectory(subDirectory);
        }
        public void AddSubdirectories_Throws_WhenListOfSubdirectoriesIsNull()
        {
            //arrange
            List <CompositiveDirectory <string> > subDirectories = null;

            //act
            var sut = MockedItemsFactory.ProvideDefaultDirectory((x, y, z) => new CompositiveDirectory <string>(x, y, z));

            sut.AddRangeOfSubdirectories(subDirectories);
        }
        public void AddSubdirectories_AllIsOk_WhenListOfSubdirectoriesWasAdded()
        {
            //arrange
            var subDirectories = new List <CompositiveDirectory <string> >();

            //act
            var sut = MockedItemsFactory.ProvideDefaultDirectory((x, y, z) => new CompositiveDirectory <string>(x, y, z));

            sut.AddRangeOfSubdirectories(subDirectories);
        }
        public void AddSubdirectory_AllIsOk_WhenSubdirectoryWasAdded()
        {
            //arrange
            var subDirectory = MockedItemsFactory.ProvideDefaultDirectory((x, y, z) => new CompositiveDirectory <string>(x, y, z));

            //act
            var sut = MockedItemsFactory.ProvideDefaultDirectory((x, y, z) => new CompositiveDirectory <string>(x, y, z));

            sut.AddSubdirectory(subDirectory);
        }
        public void IsCompositive_ReturnsFalse_WhenNoSubDirectoriesWereAdded()
        {
            //arrange

            //act
            var sut    = MockedItemsFactory.ProvideDefaultDirectory((x, y, z) => new CompositiveDirectory <string>(x, y, z));
            var result = sut.IsCompositive();

            //asserts
            result.Should().BeFalse();
        }
Beispiel #6
0
        public void IsCompositive_ReturnsFalse_Always()
        {
            //arrange

            //act
            var sut    = MockedItemsFactory.ProvideDefaultDirectory((x, y, z) => new SimpleDirectory <string>(x, y, z));
            var result = sut.IsCompositive();

            //asserts
            result.Should().BeFalse();
        }
        public void GetImages_ReturnsEmptyList_WhenThereWereNoImages()
        {
            //arrange
            var imageFormats = MockedItemsFactory.ProvideImageFormats();

            //act
            var sut    = MockedItemsFactory.ProvideDefaultDirectory((x, y, z) => new CompositiveDirectory <string>(x, y, z));
            var result = sut.GetImages(imageFormats);

            //assert
            result.Any().Should().BeFalse();
        }
        public void IsCompositive_ReturnsTrue_WhenOneSubDirectoryWasAdded()
        {
            //arrange
            var subDirectory = MockedItemsFactory.ProvideDefaultDirectory((x, y, z) => new CompositiveDirectory <string>(x, y, z));

            //act
            var sut = MockedItemsFactory.ProvideDefaultDirectory((x, y, z) => new CompositiveDirectory <string>(x, y, z));

            sut.AddSubdirectory(subDirectory);
            var result = sut.IsCompositive();

            //asserts
            result.Should().BeTrue();
        }
        public void GetImges_ReturnsListWithOneElement_WhenThereWasOneImageInSubdirectory()
        {
            //arrange
            var imageFormats    = MockedItemsFactory.ProvideImageFormats();
            var subDirectory    = MockedItemsFactory.ProvideDirectoryWithImages((x, y, z) => new CompositiveDirectory <string>(x, y, z));
            var expectedImages  = 1;
            var expectedContent = "TEST_CONTENT";

            //act
            var sut = MockedItemsFactory.ProvideDefaultDirectory((x, y, z) => new CompositiveDirectory <string>(x, y, z));

            sut.AddSubdirectory(subDirectory);
            var result = sut.GetImages(imageFormats);

            //assert
            result.Count().Should().Be(expectedImages);
            result.First().Should().BeOfType(typeof(Image <string>));
            result.First().Content.Should().Be(expectedContent);
        }