Exemplo n.º 1
0
        [TestMethod] public void ClassesInterfacesOnly()
        {
            // Arrange
            var lhs = new ClassInterfaces()
            {
                ID = 1
            };
            var rhs = new ClassInterfaces()
            {
                ID = 2
            };
            ClassInterfaces?nll = null;

            // Act
            ClassInterfaces.Tracker.Reset();
            var isLess        = FullCheck.ExpectLessThan(lhs, rhs);
            var isEquiv       = FullCheck.ExpectEquivalent(lhs, lhs);
            var isGreater     = FullCheck.ExpectGreaterThan(rhs, lhs);
            var nullIsLess    = FullCheck.ExpectLessThan(nll, lhs);
            var nullIsEquiv   = FullCheck.ExpectEquivalent(nll, nll);
            var nullIsGreater = FullCheck.ExpectGreaterThan(lhs, nll);

            // Assert
            isLess.Should().NotHaveValue();
            isEquiv.Should().NotHaveValue();
            isGreater.Should().NotHaveValue();
            nullIsLess.Should().NotHaveValue();
            nullIsEquiv.Should().NotHaveValue();
            nullIsGreater.Should().NotHaveValue();
            ClassInterfaces.Tracker[CallKey.OpEQ].Should().Be(0);
            ClassInterfaces.Tracker[CallKey.OpNEQ].Should().Be(0);
            ClassInterfaces.Tracker[CallKey.OpLT].Should().Be(0);
            ClassInterfaces.Tracker[CallKey.OpGT].Should().Be(0);
            ClassInterfaces.Tracker[CallKey.OpLTE].Should().Be(0);
            ClassInterfaces.Tracker[CallKey.OpGTE].Should().Be(0);
            ClassInterfaces.Tracker[CallKey.StrongEQ].Should().Be(0);
            ClassInterfaces.Tracker[CallKey.WeakEQ].Should().Be(0);
            ClassInterfaces.Tracker[CallKey.Comparison].Should().Be(8);
            ClassInterfaces.Tracker[CallKey.HashCode].Should().Be(0);
        }
Exemplo n.º 2
0
        [TestMethod] public void ClassesInterfacesOnly()
        {
            // Arrange
            var lhs = new ClassInterfaces()
            {
                ID = 1
            };
            var rhs = new ClassInterfaces()
            {
                ID = 2
            };
            ClassInterfaces?nll = null;

            // Act
            ClassInterfaces.Tracker.Reset();
            var areEqual         = FullCheck.ExpectEqual(lhs, lhs);
            var areNotEqual      = FullCheck.ExpectNotEqual(lhs, rhs);
            var nullAreEqual     = FullCheck.ExpectEqual(nll, nll);
            var nullAreNotEqualL = FullCheck.ExpectNotEqual(nll, lhs);
            var nullAreNotEqualR = FullCheck.ExpectNotEqual(lhs, nll);

            // Assert
            areEqual.Should().NotHaveValue();
            areNotEqual.Should().NotHaveValue();
            nullAreEqual.Should().NotHaveValue();
            nullAreNotEqualL.Should().NotHaveValue();
            nullAreNotEqualR.Should().NotHaveValue();
            ClassInterfaces.Tracker[CallKey.OpEQ].Should().Be(0);
            ClassInterfaces.Tracker[CallKey.OpNEQ].Should().Be(0);
            ClassInterfaces.Tracker[CallKey.OpLT].Should().Be(0);
            ClassInterfaces.Tracker[CallKey.OpGT].Should().Be(0);
            ClassInterfaces.Tracker[CallKey.OpLTE].Should().Be(0);
            ClassInterfaces.Tracker[CallKey.OpGTE].Should().Be(0);
            ClassInterfaces.Tracker[CallKey.StrongEQ].Should().Be(6);
            ClassInterfaces.Tracker[CallKey.WeakEQ].Should().Be(6);
            ClassInterfaces.Tracker[CallKey.Comparison].Should().Be(0);
            ClassInterfaces.Tracker[CallKey.HashCode].Should().Be(2);
        }