コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        public void Equals_When_class_has_no_properties_Then_always_returns_true()
        {
            var equals = DeepEquals.FromProperties <Empty>();

            equals(new Empty(), new Empty()).Should().BeTrue();
        }