public void TypeListComparer_GetHashCode_ShouldThrowExceptionWhenArgumentIsNull()
        {
            // Arrange
            var obj = null as object[];

            // Act
            var actual = new TypeListComparer <object>().GetHashCode(obj);

            // Assert
        }
        public void TypeListComparer_Equals_ShouldThrowExceptionWhenSecondArgumentIsNull()
        {
            // Arrange
            var x = new object[0];
            var y = null as object[];

            // Act
            var actual = new TypeListComparer<object>().Equals(x, y);

            // Assert
        }
        public void TypeListComparer_Equals_ShouldThrowExceptionWhenSecondArgumentIsNull()
        {
            // Arrange
            var x = new object[0];
            var y = null as object[];

            // Act
            var actual = new TypeListComparer <object>().Equals(x, y);

            // Assert
        }
        public void TypeListComparer_Equals_ShouldReturnTrueForTwoEmptyLists()
        {
            // Arrange
            var x = new object[0];
            var y = new object[0];

            // Act
            var actual = new TypeListComparer <object>().Equals(x, y);

            // Assert
            Assert.IsTrue(actual);
        }
Esempio n. 5
0
        public void TypeListComparer_Equals_ShouldReturnTrueForTwoEmptyLists()
        {
            // Arrange
            var x = new object[0];
            var y = new object[0];

            // Act
            var actual = new TypeListComparer<object>().Equals(x, y);

            // Assert
            Assert.IsTrue(actual);
        }
Esempio n. 6
0
        public void TypeListComparer_GetHashCode_ShouldReturnValueOfItemInSingleItemList()
        {
            // Arrange
            var obj = new object[] { 5 };

            // Act
            var actual = new TypeListComparer<object>().GetHashCode(obj);

            // Assert
            var expected = 5;
            Assert.AreEqual(expected, actual);
        }
Esempio n. 7
0
        public void TypeListComparer_GetHashCode_ShouldReturnAggregateOrOfListItems()
        {
            // Arrange
            var obj = new object[] { 1, 2, 3 };

            // Act
            var actual = new TypeListComparer<object>().GetHashCode(obj);

            // Assert
            var expected = 1 | 2 | 3;
            Assert.AreEqual(expected, actual);
        }
        public void TypeListComparer_GetHashCode_ShouldReturnValueOfItemInSingleItemList()
        {
            // Arrange
            var obj = new object[] { 5 };

            // Act
            var actual = new TypeListComparer <object>().GetHashCode(obj);

            // Assert
            var expected = 5;

            Assert.AreEqual(expected, actual);
        }
        public void TypeListComparer_GetHashCode_ShouldReturnZeroForEmptyList()
        {
            // Arrange
            var obj = new object[] { };

            // Act
            var actual = new TypeListComparer <object>().GetHashCode(obj);

            // Assert
            var expected = 0;

            Assert.AreEqual(expected, actual);
        }
        public void TypeListComparer_GetHashCode_ShouldReturnAggregateOrOfListItems()
        {
            // Arrange
            var obj = new object[] { 1, 2, 3 };

            // Act
            var actual = new TypeListComparer <object>().GetHashCode(obj);

            // Assert
            var expected = 1 | 2 | 3;

            Assert.AreEqual(expected, actual);
        }
Esempio n. 11
0
        public void TypeListComparer_Equals_ShouldReturnTrueForTwoSortedLists()
        {
            // Arrange
            var a = new HttpCookie("a");
            var b = new HttpCookie("b");
            var c = new HttpCookie("c");
            var d = new HttpCookie("d");

            var x = new[] { a, b, c, d };
            var y = new[] { a, b, c, d };

            // Act
            var actual = new TypeListComparer<HttpCookie>().Equals(x, y);

            // Assert
            Assert.IsTrue(actual);
        }
Esempio n. 12
0
        public void TypeListComparer_Equals_ShouldReturnFalseForTwoListsOfDifferentValues()
        {
            // Arrange
            var a = new HttpCookie("a");
            var b = new HttpCookie("b");
            var c = new HttpCookie("c");
            var d = new HttpCookie("d");

            var x = new[] { a, b, c };
            var y = new[] { d, c, b };

            // Act
            var actual = new TypeListComparer<HttpCookie>().Equals(x, y);

            // Assert
            Assert.IsFalse(actual);
        }
Esempio n. 13
0
        public void TypeListComparer_Equals_ShouldReturnFalseForTwoListsOfDifferentLength()
        {
            // Arrange
            var a = new HttpCookie("a");
            var b = new HttpCookie("b");
            var c = new HttpCookie("c");
            var d = new HttpCookie("d");

            var x = new[] { a, b, c, d };
            var y = new[] { d, c, b };

            // Act
            var actual = new TypeListComparer <HttpCookie>().Equals(x, y);

            // Assert
            Assert.IsFalse(actual);
        }
Esempio n. 14
0
        public void TypeListComparer_Equals_ShouldReturnTrueForTwoUnsortedLists()
        {
            // Arrange
            var a = new HttpCookie("a");
            var b = new HttpCookie("b");
            var c = new HttpCookie("c");
            var d = new HttpCookie("d");

            var x = new[] { a, b, c, d };
            var y = new[] { d, c, b, a };

            // Act
            var actual = new TypeListComparer <HttpCookie>().Equals(x, y);

            // Assert
            Assert.IsTrue(actual);
        }
Esempio n. 15
0
        public void TypeListComparer_GetHashCode_ShouldThrowExceptionWhenArgumentIsNull()
        {
            // Arrange
            var obj = null as object[];

            // Act
            var actual = new TypeListComparer<object>().GetHashCode(obj);

            // Assert
        }
Esempio n. 16
0
        public void TypeListComparer_GetHashCode_ShouldReturnZeroForEmptyList()
        {
            // Arrange
            var obj = new object[] { };

            // Act
            var actual = new TypeListComparer<object>().GetHashCode(obj);

            // Assert
            var expected = 0;
            Assert.AreEqual(expected, actual);
        }