public void Should_Respect_File_System_Case_Sensitivity_When_Adding_Path(bool caseSensitive, int expectedCount)
                {
                    // Given
                    var collection = new DirectoryPathCollection(new PathComparer(caseSensitive));
                    collection.Add(new DirectoryPath("A"));

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

                    // Then
                    Assert.Equal(expectedCount, collection.Count);
                }
                public void Should_Add_Path_If_Not_Already_Present()
                {
                    // Given
                    var collection = new DirectoryPathCollection(new PathComparer(false));
                    collection.Add(new DirectoryPath("B"));

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

                    // Then
                    Assert.Equal(2, collection.Count);
                }
Пример #3
0
                public void Should_Respect_File_System_Case_Sensitivity_When_Adding_Path(bool caseSensitive, int expectedCount)
                {
                    // Given
                    var collection = new DirectoryPathCollection(new PathComparer(caseSensitive));

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

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

                    // Then
                    Assert.Equal(expectedCount, collection.Count);
                }
Пример #4
0
                public void Should_Add_Path_If_Not_Already_Present()
                {
                    // Given
                    var collection = new DirectoryPathCollection(new PathComparer(false));

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

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

                    // Then
                    Assert.Equal(2, collection.Count);
                }
Пример #5
0
                public void Should_Return_New_Collection()
                {
                    // Given
                    var collection = new DirectoryPathCollection(new PathComparer(false));

                    collection.Add("A");
                    collection.Add("B");

                    // When
                    var result = collection - new DirectoryPath("A");

                    // Then
                    Assert.False(ReferenceEquals(result, collection));
                }
Пример #6
0
                public void Should_Respect_File_System_Case_Sensitivity_When_Removing_Paths(bool caseSensitive, int expectedCount)
                {
                    // Given
                    var collection = new DirectoryPathCollection(new PathComparer(caseSensitive));

                    collection.Add("A");
                    collection.Add("B");
                    collection.Add("C");

                    // When
                    var result = collection - new[] { new DirectoryPath("b"), new DirectoryPath("c") };

                    // Then
                    Assert.Equal(expectedCount, result.Count);
                }
Пример #7
0
                public void Should_Add_Paths_That_Are_Not_Present()
                {
                    // Given
                    var collection = new DirectoryPathCollection(new DirectoryPath[] { "A", "B" }, new PathComparer(false));

                    // When
                    collection.Add(new DirectoryPath[] { "A", "B", "C" });

                    // Then
                    Assert.Equal(3, collection.Count);
                }
                public void Should_Add_Path_If_Not_Already_Present()
                {
                    // Given
                    var collection = new DirectoryPathCollection(new DirectoryPath[] { "A" }, new PathComparer(false));

                    // When
                    collection.Add(new DirectoryPath("B"));

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

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

                    // Then
                    collection.Count.ShouldBe(expectedCount);
                }
                public void Should_Add_Paths_That_Are_Not_Present()
                {
                    // Given
                    var collection = new DirectoryPathCollection(new DirectoryPath[] { "A", "B" }, new PathComparer(false));

                    // When
                    collection.Add(new DirectoryPath[] { "A", "B", "C" });

                    // Then
                    Assert.Equal(3, collection.Count);
                }
Пример #11
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.Add((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.Add((IEnumerable <DirectoryPath>)null));

                    // Then
                    result.ShouldBeOfType <ArgumentNullException>()
                    .And().ParamName.ShouldBe("paths");
                }
Пример #13
0
                public void Should_Respect_File_System_Case_Sensitivity_When_Adding_Path()
                {
                    // Given
                    var collection = new DirectoryPathCollection(new PathComparer(false));

                    collection.Add("B");

                    // When
                    var result = collection + new DirectoryPath("A");

                    // Then
                    Assert.Equal(2, result.Count);
                }
                public void Should_Return_New_Collection()
                {
                    // Given
                    var collection = new DirectoryPathCollection(new PathComparer(false));
                    collection.Add("A");
                    collection.Add("B");
                    collection.Add("C");

                    // When
                    var result = collection - new[] { new DirectoryPath("B"), new DirectoryPath("C") };

                    // Then
                    Assert.False(ReferenceEquals(result, collection));
                }
                public void Should_Respect_File_System_Case_Sensitivity_When_Removing_Paths(bool caseSensitive, int expectedCount)
                {
                    // Given
                    var collection = new DirectoryPathCollection(new PathComparer(caseSensitive));
                    collection.Add("A");
                    collection.Add("B");
                    collection.Add("C");

                    // When
                    var result = collection - new[] { new DirectoryPath("b"), new DirectoryPath("c") };

                    // Then
                    Assert.Equal(expectedCount, result.Count);
                }
                public void Should_Respect_File_System_Case_Sensitivity_When_Adding_Path()
                {
                    // Given
                    var collection = new DirectoryPathCollection(new PathComparer(false));
                    collection.Add("B");

                    // When
                    var result = collection + new DirectoryPath("A");

                    // Then
                    Assert.Equal(2, result.Count);
                }