Beispiel #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));
        }
Beispiel #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));
 }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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));
 }
Beispiel #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));
 }
Beispiel #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));
 }
Beispiel #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));
 }
Beispiel #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));
        }