Beispiel #1
0
 public void Should_flag_uninitialized_properties_on_actual_object_as_not_matching()
 {
     _actual = new Customer {
         Name = ExpectedName
     };
     _expected = new { Name = ExpectedName, PhoneNumber = "1234567890" }.ToExpectedObject();
     _expected.ShouldMatch(_actual);
 }
Beispiel #2
0
 public void Should_ignore_extra_properties_on_actual_object_when_matching()
 {
     _actual = new Customer {
         Name = ExpectedName, PhoneNumber = "1234567890"
     };
     _expected = new { Name = ExpectedName }.ToExpectedObject();
     _expected.ShouldMatch(_actual);
 }
 private static bool ShouldMatch(ExpectedObject expected, object o)
 {
     try
     {
         expected.ShouldMatch(o);
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Beispiel #4
0
 public void Should_have_the_correct_name_and_address_where_supplied()
 {
     _expected.ShouldMatch(_actual);
 }