Пример #1
0
            public void ShouldReturnTrue_WhenGivenNulls()
            {
                // Arrange
                var sut = new MultiSetComparer <int>();

                // Act
                bool result = sut.Equals(null, null);

                // Assert
                Assert.True(result);
            }
Пример #2
0
            public void ShouldReturnFalse_WhenGivenCollectionAndNull()
            {
                // Arrange
                var set0 = new int[0];
                var sut  = new MultiSetComparer <int>();

                // Act
                bool result = sut.Equals(set0, null);

                // Assert
                Assert.False(result);
            }
Пример #3
0
            public void ShouldReturnTrue_WhenGivenEmptyCollections()
            {
                // Arrange
                var set0 = new int[0];
                var set1 = new List <int>();
                var sut  = new MultiSetComparer <int>();

                // Act
                bool result = sut.Equals(set0, set1);

                // Assert
                Assert.True(result);
            }
Пример #4
0
            public void ShouldUseGivenComparerForComparisons()
            {
                // Arrange
                var set0 = new[] { "B", "D", "g", "g", "A", "C", "E", "e", "E" };
                var set1 = new[] { "b", "d", "G", "G", "A", "C", "e", "e", "e" };
                var sut  = new MultiSetComparer <string>(StringComparer.OrdinalIgnoreCase);

                // Act
                bool result = sut.Equals(set0, set1);

                // Assert
                Assert.True(result);
            }