コード例 #1
0
        public void Can_Compare_Same_Propeties()
        {
            var a = new HelperClass("val", "obj", "string", true, 21, 37);
            var b = new HelperClass("val", "obj", "string", true, 21, 37);

            Assert.True(a.ArePropertiesSame(b, null));
        }
コード例 #2
0
        public void Will_Throw_Exception_When_One_Object_Is_Null()
        {
            var    a = new HelperClass("val", "obj", "string", true, 21, 37);
            object b = null;

            Assert.Throws <Exception>(() => a.ArePropertiesSame(b, null));
        }
コード例 #3
0
        public void Derived_Types_Should_Return_False()
        {
            var a = new HelperClass("val", "obj", "string", true, 21, 37);
            var b = new HelperClass2("a");

            Assert.False(a.ArePropertiesSame(b, null));
        }
コード例 #4
0
        public void Can_Compare_Object_With_Different_Value()
        {
            var a = new HelperClass("val", "obj", "string", true, 21, 37);
            var b = new HelperClass("notval", "notobj", "notstring", false, 31, 27);

            Assert.False(a.ArePropertiesSame(b, null));
        }
コード例 #5
0
        public void Can_Skip_Property()
        {
            var a = new HelperClass("difference", "obj", "string", true, 21, 37);
            var b = new HelperClass("different", "obj", "string", true, 21, 37);

            var @boolean = a.ArePropertiesSame(b, new[] { "Dynamic" });

            Assert.True(@boolean);
        }