Ejemplo n.º 1
0
        public void Comparison_DifferByGetType() {
            // fingerprints are FOO:int and BAR:int, so not equivalent

            // Arrange
            ExpressionFingerprint fingerprint1 = new FooExpressionFingerprint(Expression.Constant(0));
            ExpressionFingerprint fingerprint2 = new BarExpressionFingerprint(Expression.Constant(0));

            // Act
            HashSet<ExpressionFingerprint> set = new HashSet<ExpressionFingerprint>() {
                fingerprint1,
                fingerprint2
            };

            // Assert
            Assert.AreEqual(2, set.Count, "Fingerprints should not have been equivalent - differ by ExpressionFingerprint.GetType().");
        }
        public void Comparison_DifferByGetType()
        {
            // fingerprints are FOO:int and BAR:int, so not equivalent

            // Arrange
            ExpressionFingerprint fingerprint1 = new FooExpressionFingerprint(Expression.Constant(0));
            ExpressionFingerprint fingerprint2 = new BarExpressionFingerprint(Expression.Constant(0));

            // Act
            HashSet <ExpressionFingerprint> set = new HashSet <ExpressionFingerprint>()
            {
                fingerprint1,
                fingerprint2
            };

            // Assert
            Assert.AreEqual(2, set.Count, "Fingerprints should not have been equivalent - differ by ExpressionFingerprint.GetType().");
        }