public void NotEqualDummies()
        {
            var d1 = new SerializableDummy { Value = 1 };
            var d2 = new SerializableDummy { Value = 2 };

            Assert.AreEqual(false, BinaryComparer<SerializableDummy>.Default.Equals(d1, d2));
            Assert.AreEqual(false, BinaryComparer<SerializableDummy>.Default.Equals(d2, d1));
        }
        public void EqualDummies()
        {
            var d1 = new SerializableDummy { Value = 1 };
            var d2 = new SerializableDummy { Value = 1 };

            BinaryAssert.Equal(d1, d1);
            BinaryAssert.Equal(d2, d1);
            BinaryAssert.Equal(d1, d2);
        }
        public void NotEqualDummies()
        {
            var d1 = new SerializableDummy { Value = 1 };
            var d2 = new SerializableDummy { Value = 2 };

            var ex1 = Assert.Throws<AssertException>(() => BinaryAssert.Equal(d1, d2));
            var ex2 = Assert.Throws<AssertException>(() => BinaryAssert.Equal(d2, d1));
            var expected = "  Expected bytes to be equal.\r\n" +
                           "  Bytes differ at index 198.";
            foreach (var ex in new[] { ex1, ex2 })
            {
                Assert.AreEqual(expected, ex.Message);
            }
        }
 public void RoundtripHappyPath()
 {
     var dummy = new SerializableDummy();
     var roundtrip = BinaryFormatterAssert.Roundtrip(dummy);
     FieldAssert.Equal(dummy, roundtrip);
 }