コード例 #1
0
		public void comparing_two_instances_of_different_classes_that_have_the_same_public_property_where_the_values_for_that_property_differ()
		{
			var obj1 = new TestClass1 { Value1 = 1 };
			var obj2 = new TestClass2 { Value1 = 2 };

			Assert.Throws< AssertionException >( () => obj1.should_be_equal_to( obj2 ) );
		}
コード例 #2
0
		public void comparing_two_identical_instances_of_the_same_class_should_pass()
		{
			var obj1 = new TestClass1 { Value1 = 1 };
			var obj2 = new TestClass1 { Value1 = 1 };

			obj1.should_be_equal_to( obj2 );
		}
コード例 #3
0
		public void comparing_two_instances_of_different_classes_that_have_the_same_public_property_where_both_instances_have_the_same_value_for_that_property()
		{
			var obj1 = new TestClass1 { Value1 = 1 };
			var obj2 = new TestClass2 { Value1 = 1 };

			obj1.should_be_equal_to( obj2 );
		}
コード例 #4
0
		public void comparing_two_instances_of_the_same_class_where_an_internal_property_differs_should_pass()
		{
			var obj1 = new TestClass1 { Value1 = 1, Value2 = 1 };
			var obj2 = new TestClass1 { Value1 = 1, Value2 = 3 };
			obj1.should_be_equal_to( obj2 );
		}
コード例 #5
0
		public void comparing_two_instances_of_the_same_class_with_different_values_should_fail()
		{
			var obj1 = new TestClass1 { Value1 = 1 };
			var obj2 = new TestClass1 { Value1 = 2 };

			Assert.Throws< AssertionException >( () => obj1.should_be_equal_to( obj2 ) );
		}