public void Comparing_objects_calls_Equals_method() { var object1 = default(EqualsSpy); var object2 = default(EqualsSpy); "Given a DefaultComparison".x(() => SUT = new DefaultComparison() ); "And 2 objects to compare".x(() => { object1 = new EqualsSpy(); object2 = new EqualsSpy(); }); "And a Comparison context object".x(() => Context = new ComparisonContext() ); "When calling Compare".x(() => (Result, _) = SUT.Compare(Context, object1, object2) ); "Then it should call Equals".x(() => object1.Calls[0].ShouldBeSameAs(object2) ); }
public void Comparing_object_types_returns_Pass_or_Inconclusive(bool expected) { var value1 = default(EqualsSpy); var value2 = default(EqualsSpy); "Given a DefaultComparison" .Given(() => SUT = new DefaultComparison()); "And 2 objects to compare" .And(() => { value1 = new EqualsSpy(expected); value2 = new EqualsSpy(expected); }); "When calling Compare" .When(() => Result = SUT.Compare(null, value1, value2)); "The result should be Pass or Fail" .Then(() => Result.ShouldBe(expected ? ComparisonResult.Pass : ComparisonResult.Inconclusive)); }
public void Comparing_object_types_returns_Pass_or_Inconclusive(bool expected) { var value1 = default (EqualsSpy); var value2 = default (EqualsSpy); "Given a DefaultComparison" .Given(() => SUT = new DefaultComparison()); "And 2 objects to compare" .And(() => { value1 = new EqualsSpy(expected); value2 = new EqualsSpy(expected); }); "When calling Compare" .When(() => Result = SUT.Compare(null, value1, value2)); "The result should be Pass or Fail" .Then(() => Result.ShouldBe(expected ? ComparisonResult.Pass : ComparisonResult.Inconclusive)); }
public void Comparing_objects_calls_Equals_method() { var object1 = default (EqualsSpy); var object2 = default (EqualsSpy); "Given a DefaultComparison" .Given(() => SUT = new DefaultComparison()); "And 2 objects to compare" .And(() => { object1 = new EqualsSpy(); object2 = new EqualsSpy(); }); "And a Comparison context object" .And(() => Context = new ComparisonContext()); "When calling Compare" .When(() => Result = SUT.Compare(Context, object1, object2)); "Then it should call Equals" .Then(() => object1.Calls[0].ShouldBeSameAs(object2)); }