Beispiel #1
0
        public void Two_token_instances_are_equal_if_all_properties_are_equal(
            HeaderTokenKind kind,
            [CombinatorialValues(null, "", "\t", "some value")] string?value,
            [CombinatorialValues(1, 5)] int lineNumber,
            [CombinatorialValues(1, 5)] int columnNumber)
        {
            var token1 = new HeaderToken(kind, value, lineNumber, columnNumber);
            var token2 = new HeaderToken(kind, value, lineNumber, columnNumber);

            Assert.Equal(token1.GetHashCode(), token2.GetHashCode());
            Assert.Equal(token1, token2);
            Assert.Equal(token2, token1);
            Assert.True(token1.Equals(token2));
            Assert.True(token1.Equals((object)token2));
            Assert.True(token2.Equals(token1));
            Assert.True(token2.Equals((object)token1));
        }
Beispiel #2
0
        public void Equals_returns_false_if_the_argument_if_not_a_HeaderToken()
        {
            var sut = new HeaderToken(HeaderTokenKind.String, "Some Value", 1, 2);

            Assert.False(sut.Equals(new object()));
        }