예제 #1
0
        public void WhenDehydrateMultiPropertyValue_ThenReturnsProperties()
        {
            var valueObject = new TestMultiValueObject("astringvalue", 25, true);
            var result      = valueObject.Dehydrate();

            result.Should().Be("{\"Val1\":\"astringvalue\",\"Val2\":25,\"Val3\":true}");
        }
예제 #2
0
        public void WhenEqualsWithSameValueInMultiValueObject_ThenReturnsTrue()
        {
            var result =
                new TestMultiValueObject("avalue1", 25, true).Equals(new TestMultiValueObject("avalue1", 25, true));

            result.Should().BeTrue();
        }
예제 #3
0
        public void WhenOperatorEqualsWithSameValue_ThenReturnsTrue()
        {
            // ReSharper disable once EqualExpressionComparison
            var result = new TestMultiValueObject("avalue1", 25, true) == new TestMultiValueObject("avalue1", 25, true);

            result.Should().BeTrue();
        }
예제 #4
0
        public void WhenDehydrateMultiPropertyValueWithNulls_ThenReturnsProperties()
        {
            var valueObject = new TestMultiValueObject(null, 25, true);
            var result      = valueObject.Dehydrate();

            result.Should().Be("{\"Val1\":\"NULL\",\"Val2\":25,\"Val3\":true}");
        }
예제 #5
0
        public void WhenEqualsWithDifferentStringValue_ThenReturnsFalse()
        {
            // ReSharper disable once SuspiciousTypeConversion.Global
            var result = new TestMultiValueObject("avalue", 25, true).Equals("adifferentvalue");

            result.Should().BeFalse();
        }
예제 #6
0
        public void WhenEqualsWithDifferentValueInMultiValueObject_ThenReturnsFalse()
        {
            var result =
                new TestMultiValueObject("avalue1", 25, true).Equals(new TestMultiValueObject("avalue2", 50, false));

            Assert.IsFalse(result);
        }
예제 #7
0
        public void WhenEqualsWithDifferentValueInMultiValueObject_ThenReturnsFalse()
        {
            var result =
                new TestMultiValueObject("avalue1", 25, true).Equals(new TestMultiValueObject("avalue2", 50, false));

            result.Should().BeFalse();
        }
예제 #8
0
        public void WhenOperatorEqualsWithSameString_ThenReturnsTrue()
        {
            var valueObject = new TestMultiValueObject("astringvalue", 25, true);

            var result = valueObject == "{\"Val1\":\"astringvalue\",\"Val2\":25,\"Val3\":true}";

            result.Should().BeTrue();
        }
예제 #9
0
        public void WhenOperatorEqualsWithDifferentString_ThenReturnsFalse()
        {
            var valueObject = new TestMultiValueObject("avalue", 25, true);

            var result = valueObject == "adifferentvalue";

            result.Should().BeFalse();
        }
예제 #10
0
        public void WhenEqualsWithSameStringValue_ThenReturnsTrue()
        {
            // ReSharper disable once SuspiciousTypeConversion.Global
            var result = new TestMultiValueObject("astringvalue", 25, true)
                         .Equals("{\"Val1\":\"astringvalue\",\"Val2\":25,\"Val3\":true}");

            result.Should().BeTrue();
        }
예제 #11
0
        public void WhenRehydrateMultiValueWithNullValue_ThenReturnsInstance()
        {
            var valueObject = TestMultiValueObject.Rehydrate()("{\"Val1\":\"NULL\",\"Val2\":25,\"Val3\":True}", null);

            valueObject.AStringValue.Should().BeNull();
            valueObject.AnIntegerValue.Should().Be(25);
            valueObject.ABooleanValue.Should().BeTrue();
        }
예제 #12
0
        public void WhenNotOperatorEqualsWithNullValue_ThenReturnsTrue()
        {
            var valueObject = new TestMultiValueObject("avalue", 25, true);

            // ReSharper disable once ConditionIsAlwaysTrueOrFalse
            var result = valueObject != (TestMultiValueObject)null;

            // ReSharper disable once ConditionIsAlwaysTrueOrFalse
            result.Should().BeTrue();
        }
예제 #13
0
        public void WhenOperatorEqualsWithNullString_ThenReturnsFalse()
        {
            var valueObject = new TestMultiValueObject("avalue", 25, true);

            // ReSharper disable once ConditionIsAlwaysTrueOrFalse
            var result = valueObject == (string)null;

            // ReSharper disable once ConditionIsAlwaysTrueOrFalse
            result.Should().BeFalse();
        }
예제 #14
0
        public void WhenRehydrateMultiValue_ThenReturnsInstance()
        {
            var valueObject = new TestMultiValueObject("astringvalue", 25, true);

            valueObject.Rehydrate("{\"Val1\":\"astringvalue\",\"Val2\":25,\"Val3\":True}");

            valueObject.AStringValue.Should().Be("astringvalue");
            valueObject.AnIntegerValue.Should().Be(25);
            valueObject.ABooleanValue.Should().BeTrue();
        }
예제 #15
0
        public void WhenOperatorEqualsWithDifferentValue_ThenReturnsFalse()
        {
            var result = new TestMultiValueObject("avalue1", 25, true) == new TestMultiValueObject("avalue2", 25, true);

            result.Should().BeFalse();
        }
예제 #16
0
        public void WhenEqualsWithNullStringValue_ThenReturnsFalse()
        {
            var result = new TestMultiValueObject("avalue", 25, true).Equals((string)null);

            result.Should().BeFalse();
        }