Пример #1
0
                public void Should_Respect_File_System_Case_Sensitivity_When_Removing_Paths(bool caseSensitive, int expectedCount)
                {
                    // Given
                    var collection = new DirectoryPathCollection(new DirectoryPath[] { "A", "B" }, new PathComparer(caseSensitive));

                    // When
                    collection.Remove(new DirectoryPath[] { "a", "b", "c" });

                    // Then
                    Assert.Equal(expectedCount, collection.Count);
                }
                public void Should_Respect_File_System_Case_Sensitivity_When_Removing_Path(bool caseSensitive, int expectedCount)
                {
                    // Given
                    var collection = new DirectoryPathCollection(new DirectoryPath[] { "A" }, new PathComparer(caseSensitive));

                    // When
                    collection.Remove(new DirectoryPath("a"));

                    // Then
                    collection.Count.ShouldBe(expectedCount);
                }
Пример #3
0
                public void Should_Throw_If_Paths_Is_Null()
                {
                    // Given
                    var collection = new DirectoryPathCollection(new DirectoryPath[] { "A" }, new PathComparer(false));

                    // When
                    var result = Record.Exception(() => collection.Remove((IEnumerable <DirectoryPath>)null));

                    // Then
                    AssertEx.IsArgumentNullException(result, "paths");
                }
                public void Should_Throw_If_Paths_Is_Null()
                {
                    // Given
                    var collection = new DirectoryPathCollection(new DirectoryPath[] { "A" }, new PathComparer(false));

                    // When
                    var result = Record.Exception(() => collection.Remove((IEnumerable <DirectoryPath>)null));

                    // Then
                    result.ShouldBeOfType <ArgumentNullException>()
                    .And().ParamName.ShouldBe("paths");
                }
                public void Should_Respect_File_System_Case_Sensitivity_When_Removing_Path(bool caseSensitive, int expectedCount)
                {
                    // Given
                    var collection = new DirectoryPathCollection(new PathComparer(caseSensitive));

                    collection.Add(new DirectoryPath("A"));

                    // When
                    collection.Remove(new DirectoryPath("a"));

                    // Then
                    Assert.AreEqual(expectedCount, collection.Count);
                }
                public void Should_Respect_File_System_Case_Sensitivity_When_Removing_Paths(bool caseSensitive, int expectedCount)
                {
                    // Given
                    var collection = new DirectoryPathCollection(new DirectoryPath[] { "A", "B" }, new PathComparer(caseSensitive));

                    // When
                    collection.Remove(new DirectoryPath[] { "a", "b", "c" });

                    // Then
                    Assert.Equal(expectedCount, collection.Count);
                }