Exemplo n.º 1
0
        public void Equals_When_primitive_value_is_equal_Then_returns_true()
        {
            var isEqual = new FieldFoo <int>(1)
                          .Equals(new FieldFoo <int>(1));

            isEqual.Should().BeTrue();
        }
Exemplo n.º 2
0
        public void Equals_When_string_value_is_different_Then_returns_false(string value1, string value2)
        {
            var isEqual = new FieldFoo <string>(value1)
                          .Equals(new FieldFoo <string>(value2));

            isEqual.Should().BeFalse();
        }
Exemplo n.º 3
0
        public void Equals_When_other_is_same_reference_Then_returns_true()
        {
            object valueObject = new FieldFoo <string>("42");
            var    isEqual     = valueObject.Equals(valueObject);

            isEqual.Should().BeTrue();
        }
Exemplo n.º 4
0
        public void Equals_When_primitive_value_is_different_Then_returns_false()
        {
            var isEqual = new FieldFoo <int>(1)
                          .Equals(new FieldFoo <int>(2));

            isEqual.Should().BeFalse();
        }
Exemplo n.º 5
0
        public void Equals_When_nullable_values_are_not_equal_Then_returns_false(int?oneValue, int?otherValue)
        {
            var isEqual = new FieldFoo <int?>(oneValue)
                          .Equals(new FieldFoo <int?>(otherValue));

            isEqual.Should().BeFalse();
        }
Exemplo n.º 6
0
        public void Equals_When_list_contains_same_primitives_in_same_order_Then_returns_true()
        {
            var isEqual = new FieldFoo <ImmutableArray <int> >(ImmutableArray.Create(1, 2, 3))
                          .Equals(new FieldFoo <ImmutableArray <int> >(ImmutableArray.Create(1, 2, 3)));

            isEqual.Should().BeTrue();
        }
Exemplo n.º 7
0
        public void Equals_When_list_contains_different_primitives_Then_returns_false()
        {
            var isEqual = new FieldFoo <ImmutableArray <int> >(ImmutableArray.Create(1, 2, 3))
                          .Equals(new FieldFoo <ImmutableArray <int> >(ImmutableArray.Create(1, 2, 4)));

            isEqual.Should().BeFalse();
        }
Exemplo n.º 8
0
        public void Equals_When_array_contains_same_primitives_in_different_order_Then_returns_false()
        {
            var isEqual = new FieldFoo <ImmutableArray <int> >(ImmutableArray.Create(1, 2, 3))
                          .Equals(new FieldFoo <ImmutableArray <int> >(ImmutableArray.Create(1, 3, 2)));

            isEqual.Should().BeFalse();
        }
Exemplo n.º 9
0
        public void Equals_When_equatables_are_both_null_Then_returns_true()
        {
            var isEqual = new FieldFoo <SomeEquatable>(null)
                          .Equals(new FieldFoo <SomeEquatable>(null));

            isEqual.Should().BeTrue();
        }
Exemplo n.º 10
0
        public void Equals_When_equatables_are_not_equal_Then_returns_false()
        {
            var isEqual = new FieldFoo <SomeEquatable>(new SomeEquatable("42"))
                          .Equals(new FieldFoo <SomeEquatable>(new SomeEquatable("23")));

            isEqual.Should().BeFalse();
        }
Exemplo n.º 11
0
        public void Equals_When_string_value_is_equal_Then_returns_true(string value)
        {
            var isEqual = new FieldFoo <string>(value)
                          .Equals(new FieldFoo <string>(value));

            isEqual.Should().BeTrue();
        }
Exemplo n.º 12
0
        public void Equals_When_equatables_are_equal_Then_returns_true()
        {
            FieldFoo <SomeEquatable> fieldFoo = new FieldFoo <SomeEquatable>(new SomeEquatable("42"));
            var isEqual = fieldFoo
                          .Equals(new FieldFoo <SomeEquatable>(new SomeEquatable("42")));

            isEqual.Should().BeTrue();
        }
Exemplo n.º 13
0
        public void Equals_When_other_is_null_Then_returns_false()
        {
            var isEqual = new FieldFoo <string>("42").Equals(null);

            isEqual.Should().BeFalse();
        }