コード例 #1
0
        public void LegacyRazorDiagnostic_HashCodesNotEqual_DifferentMessage()
        {
            // Arrange
            var diagnostic1 = new LegacyRazorDiagnostic(new RazorError("This is an error", SourceLocation.Zero, 5));
            var diagnostic2 = new LegacyRazorDiagnostic(new RazorError("This is maybe an error", SourceLocation.Zero, 5));

            // Act
            var result = diagnostic1.GetHashCode() == diagnostic2.GetHashCode();

            // Assert
            Assert.False(result);
        }
コード例 #2
0
        public void LegacyRazorDiagnostic_HashCodesEqual()
        {
            // Arrange
            var diagnostic1 = new LegacyRazorDiagnostic(new RazorError("This is an error", SourceLocation.Zero, 5));
            var diagnostic2 = new LegacyRazorDiagnostic(new RazorError("This is an error", SourceLocation.Zero, 5));

            // Act
            var result = diagnostic1.GetHashCode() == diagnostic2.GetHashCode();

            // Assert
            Assert.True(result);
        }