public void WhenDehydrateMultiPropertyValue_ThenReturnsProperties() { var valueObject = new TestMultiValueObject("astringvalue", 25, true); var result = valueObject.Dehydrate(); result.Should().Be("{\"Val1\":\"astringvalue\",\"Val2\":25,\"Val3\":true}"); }
public void WhenEqualsWithSameValueInMultiValueObject_ThenReturnsTrue() { var result = new TestMultiValueObject("avalue1", 25, true).Equals(new TestMultiValueObject("avalue1", 25, true)); result.Should().BeTrue(); }
public void WhenOperatorEqualsWithSameValue_ThenReturnsTrue() { // ReSharper disable once EqualExpressionComparison var result = new TestMultiValueObject("avalue1", 25, true) == new TestMultiValueObject("avalue1", 25, true); result.Should().BeTrue(); }
public void WhenDehydrateMultiPropertyValueWithNulls_ThenReturnsProperties() { var valueObject = new TestMultiValueObject(null, 25, true); var result = valueObject.Dehydrate(); result.Should().Be("{\"Val1\":\"NULL\",\"Val2\":25,\"Val3\":true}"); }
public void WhenEqualsWithDifferentStringValue_ThenReturnsFalse() { // ReSharper disable once SuspiciousTypeConversion.Global var result = new TestMultiValueObject("avalue", 25, true).Equals("adifferentvalue"); result.Should().BeFalse(); }
public void WhenEqualsWithDifferentValueInMultiValueObject_ThenReturnsFalse() { var result = new TestMultiValueObject("avalue1", 25, true).Equals(new TestMultiValueObject("avalue2", 50, false)); Assert.IsFalse(result); }
public void WhenEqualsWithDifferentValueInMultiValueObject_ThenReturnsFalse() { var result = new TestMultiValueObject("avalue1", 25, true).Equals(new TestMultiValueObject("avalue2", 50, false)); result.Should().BeFalse(); }
public void WhenOperatorEqualsWithSameString_ThenReturnsTrue() { var valueObject = new TestMultiValueObject("astringvalue", 25, true); var result = valueObject == "{\"Val1\":\"astringvalue\",\"Val2\":25,\"Val3\":true}"; result.Should().BeTrue(); }
public void WhenOperatorEqualsWithDifferentString_ThenReturnsFalse() { var valueObject = new TestMultiValueObject("avalue", 25, true); var result = valueObject == "adifferentvalue"; result.Should().BeFalse(); }
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(); }
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(); }
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(); }
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(); }
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(); }
public void WhenOperatorEqualsWithDifferentValue_ThenReturnsFalse() { var result = new TestMultiValueObject("avalue1", 25, true) == new TestMultiValueObject("avalue2", 25, true); result.Should().BeFalse(); }
public void WhenEqualsWithNullStringValue_ThenReturnsFalse() { var result = new TestMultiValueObject("avalue", 25, true).Equals((string)null); result.Should().BeFalse(); }