示例#1
0
        public void Should_Be_Equal_To_Same_PropertyData_Object()
        {
            var propInfo = new { Property1 = 3 }.GetType().GetProperties()[0];
            var propData = new PropertyData(propInfo);

            Assert.IsTrue(propData.Equals(propData));
        }
示例#2
0
 public void Should_Return_False_For_PropertyInfo_Objects_With_Different_Names()
 {
     var type = new { Prop1 = 10, Prop2 = 20 }.GetType();
       var propData1 = new PropertyData(type.GetProperties()[0]);
       var propData2 = new PropertyData(type.GetProperties()[1]);
       Assert.IsFalse(propData1.Equals(propData2));
 }
示例#3
0
        public void Should_Return_False_For_PropertyInfo_Objects_With_Different_Types()
        {
            var prop1 = new PropertyData(new { Property1 = 3 }.GetType().GetProperties()[0]);
            var prop2 = new PropertyData(new { Property1 = "foo" }.GetType().GetProperties()[0]);

            Assert.IsFalse(prop1.Equals(prop2));
        }
示例#4
0
        public void Should_Return_True_For_PropertyInfo_Objects_With_Same_Name_And_Type()
        {
            var propData1 = new PropertyData(new { Property1 = 1 }.GetType().GetProperties()[0]);
            var propData2 = new PropertyData(new { Property1 = 3, Property2 = 10 }.GetType().GetProperties()[0]);

            Assert.IsTrue(propData1.Equals(propData2));
        }
示例#5
0
        public void Should_Return_False_For_PropertyInfo_Objects_With_Different_Names()
        {
            var type = new { Prop1 = 10, Prop2 = 20 }.GetType();
            var propData1 = new PropertyData(type.GetProperties()[0]);
            var propData2 = new PropertyData(type.GetProperties()[1]);

            Assert.IsFalse(propData1.Equals(propData2));
        }
示例#6
0
 public void Should_Return_True_For_PropertyInfo_Objects_With_Same_Name_And_Type()
 {
     var propData1 = new PropertyData(new {Property1 = 1}.GetType().GetProperties()[0]);
       var propData2 = new PropertyData(new {Property1 = 3, Property2 = 10}.GetType().GetProperties()[0]);
       Assert.IsTrue(propData1.Equals(propData2));
 }
示例#7
0
 public void Should_Return_False_When_Comparing_A_NonNull_With_A_Null_Object()
 {
     var propInfo = new PropertyData(new {Property1 = 3}.GetType().GetProperties()[0]);
       Assert.IsFalse(propInfo.Equals(null));
 }
示例#8
0
 public void Should_Return_False_For_PropertyInfo_Objects_With_Different_Types()
 {
     var prop1 = new PropertyData(new {Property1 = 3}.GetType().GetProperties()[0]);
       var prop2 = new PropertyData(new {Property1 = "foo"}.GetType().GetProperties()[0]);
       Assert.IsFalse(prop1.Equals(prop2));
 }
示例#9
0
 public void Should_Be_Equal_To_Same_PropertyData_Object()
 {
     var propInfo = new { Property1 = 3 }.GetType().GetProperties()[0];
       var propData = new PropertyData(propInfo);
       Assert.IsTrue(propData.Equals(propData));
 }
示例#10
0
        public void Should_Return_False_When_Comparing_A_NonNull_With_A_Null_Object()
        {
            var propInfo = new PropertyData(new { Property1 = 3 }.GetType().GetProperties()[0]);

            Assert.IsFalse(propInfo.Equals(null));
        }