示例#1
0
        public static void AreEqualWhenAllPropertiesAreEqual()
        {
            var left = new Target
            {
                _field    = "test",
                Property1 = new Tuple <int, string>(5, "test"),
            };

            var right = new Target
            {
                _field    = "test",
                Property1 = new Tuple <int, string>(5, "test"),
            };

            Assert.AreEqual(left, right);
            Assert.AreEqual(left.GetHashCode(), right.GetHashCode());
        }
示例#2
0
        public static void AreDifferentWhenSecondTupleItemIsDifferent()
        {
            var left = new Target
            {
                _field    = "test",
                Property1 = new Tuple <int, string>(5, "test"),
            };

            var right = new Target
            {
                _field    = "test",
                Property1 = new Tuple <int, string>(5, "Test"),
            };

            Assert.AreNotEqual(left, right);
            Assert.AreNotEqual(left.GetHashCode(), right.GetHashCode());
        }
示例#3
0
        public static void ImplementsIEquatable()
        {
            var target = new Target();

            Assert.IsTrue(target is IEquatable <Target>);
        }