public void Equals_When_class_has_one_primitive_property_Then_returns_operator_equality_of_the_property(int first, int second, bool expectedIsEqual) { var equals = DeepEquals.FromProperties <SingleProperty <int> >(); equals(new SingleProperty <int> { Value = first }, new SingleProperty <int> { Value = second }).Should().Be(expectedIsEqual); }
public void Equals_When_class_has_one_builtin_object_property_Then_returns_object_equality_of_the_property(string first, string second, bool expectedIsEqual) { var equals = DeepEquals.FromProperties <SingleProperty <string> >(); equals(new SingleProperty <string> { Value = first }, new SingleProperty <string> { Value = second }).Should().Be(expectedIsEqual); }
public void Equals_When_class_has_one_generic_builtin_IEnumerable_property_Then_returns_sequence_equality(IEnumerable <string> one, IEnumerable <string> other, bool expectedIsEqual) { var equals = DeepEquals.FromProperties <SingleProperty <IEnumerable <string> > >(); equals(new SingleProperty <IEnumerable <string> > { Value = one }, new SingleProperty <IEnumerable <string> > { Value = other }).Should().Be(expectedIsEqual); }
public void Equals_When_equatables_are_equal_Then_returns_true(SomeEquatable one, SomeEquatable other, bool expectedIsEqual) { var equals = DeepEquals.FromProperties <SingleProperty <SomeEquatable> >(); equals(new SingleProperty <SomeEquatable> { Value = one }, new SingleProperty <SomeEquatable> { Value = other }).Should().Be(expectedIsEqual); }
public void Equals_When_class_has_no_properties_Then_always_returns_true() { var equals = DeepEquals.FromProperties <Empty>(); equals(new Empty(), new Empty()).Should().BeTrue(); }