コード例 #1
0
        public void GetHashCode_returns_different_values_with_different_value()
        {
            // arrange
            TagByteArray target;
            int          actual;
            int          notExpected;

            target = new TagByteArray(string.Empty, new byte[] { 2, 4, 8, 16, 32, 64, 128 });

            notExpected = new TagByteArray(string.Empty, new byte[] { 2, 4, 8, 16, 32, 48, 128 }).GetHashCode();

            // act
            actual = target.GetHashCode();

            // assert
            Assert.NotEqual(notExpected, actual);
        }
コード例 #2
0
        public void GetHashCode_returns_same_value_for_matching_tags()
        {
            // arrange
            TagByteArray target;
            int          actual;
            int          expected;

            target = new TagByteArray("beta", new byte[] { 2, 4, 8, 16, 32, 64, 128 });

            expected = new TagByteArray("beta", new byte[] { 2, 4, 8, 16, 32, 64, 128 }).GetHashCode();

            // act
            actual = target.GetHashCode();

            // assert
            Assert.Equal(expected, actual);
        }