コード例 #1
0
        public void Comparison_Equality() {
            // Arrange
            ExpressionType nodeType = ExpressionType.TypeIs;
            Type type = typeof(bool);
            Type typeOperand = typeof(object);

            // Act
            TypeBinaryExpressionFingerprint fingerprint1 = new TypeBinaryExpressionFingerprint(nodeType, type, typeOperand);
            TypeBinaryExpressionFingerprint fingerprint2 = new TypeBinaryExpressionFingerprint(nodeType, type, typeOperand);

            // Assert
            Assert.AreEqual(fingerprint1, fingerprint2, "Fingerprints should have been equal.");
            Assert.AreEqual(fingerprint1.GetHashCode(), fingerprint2.GetHashCode(), "Fingerprints should have been different.");
        }
        public void Comparison_Equality()
        {
            // Arrange
            ExpressionType nodeType    = ExpressionType.TypeIs;
            Type           type        = typeof(bool);
            Type           typeOperand = typeof(object);

            // Act
            TypeBinaryExpressionFingerprint fingerprint1 = new TypeBinaryExpressionFingerprint(nodeType, type, typeOperand);
            TypeBinaryExpressionFingerprint fingerprint2 = new TypeBinaryExpressionFingerprint(nodeType, type, typeOperand);

            // Assert
            Assert.Equal(fingerprint1, fingerprint2);
            Assert.Equal(fingerprint1.GetHashCode(), fingerprint2.GetHashCode());
        }
コード例 #3
0
        public void Comparison_Equality()
        {
            // Arrange
            ExpressionType nodeType = ExpressionType.TypeIs;
            Type type = typeof(bool);
            Type typeOperand = typeof(object);

            // Act
            TypeBinaryExpressionFingerprint fingerprint1 = new TypeBinaryExpressionFingerprint(nodeType, type, typeOperand);
            TypeBinaryExpressionFingerprint fingerprint2 = new TypeBinaryExpressionFingerprint(nodeType, type, typeOperand);

            // Assert
            Assert.Equal(fingerprint1, fingerprint2);
            Assert.Equal(fingerprint1.GetHashCode(), fingerprint2.GetHashCode());
        }
コード例 #4
0
        public void Comparison_Equality()
        {
            // Arrange
            ExpressionType nodeType    = ExpressionType.TypeIs;
            Type           type        = typeof(bool);
            Type           typeOperand = typeof(object);

            // Act
            TypeBinaryExpressionFingerprint fingerprint1 = new TypeBinaryExpressionFingerprint(nodeType, type, typeOperand);
            TypeBinaryExpressionFingerprint fingerprint2 = new TypeBinaryExpressionFingerprint(nodeType, type, typeOperand);

            // Assert
            Assert.AreEqual(fingerprint1, fingerprint2, "Fingerprints should have been equal.");
            Assert.AreEqual(fingerprint1.GetHashCode(), fingerprint2.GetHashCode(), "Fingerprints should have been different.");
        }