public void NotBeEqualIfSomePropertiesDiffer(int intProperty1, int intProperty2, string stringProperty1, string stringProperty2, bool boolProperty1, bool boolProperty2) { var valueObject1 = new ValueObjectImpl(intProperty1, stringProperty1, boolProperty1); var valueObject2 = new ValueObjectImpl(intProperty2, stringProperty2, boolProperty2); valueObject1.Should().NotBe(valueObject2); }
public void BeEqualIfAllPropertiesAreEqual(int intProperty, string stringProperty, bool boolProperty) { var valueObject1 = new ValueObjectImpl(intProperty, stringProperty, boolProperty); var valueObject2 = new ValueObjectImpl(intProperty, stringProperty, boolProperty); valueObject1.Should().Be(valueObject2); }
public void NotBeEqualIfLeftNotNullAndRightNull() { ValueObjectImpl valueObject1 = new ValueObjectImpl(2, "string", true); ValueObjectImpl valueObject2 = null; var test = valueObject1 == valueObject2; test.Should().BeFalse(); }
public void BeEqualIfBothNull() { ValueObjectImpl valueObject1 = null; ValueObjectImpl valueObject2 = null; var test = valueObject1 == valueObject2; test.Should().BeTrue(); }
public void NotBeEqualIfComplexTypePropertiesDiffer() { var valueObject1 = new ValueObjectImpl(2, "string", true); var valueObject2 = new ValueObjectImpl(2, "different", true); var complexValueObject1 = new ValueObjectWithComplexType(valueObject1, 17, "test", false); var complexValueObject2 = new ValueObjectWithComplexType(valueObject2, 17, "test", false); complexValueObject1.Should().NotBe(complexValueObject2); }
public void BeEqualIfAllPropertiesAreEqualIncludingComplexTypes() { var valueObject1 = new ValueObjectImpl(2, "string", true); var valueObject2 = new ValueObjectImpl(2, "string", true); var complexValueObject1 = new ValueObjectWithComplexType(valueObject1, 17, "test", false); var complexValueObject2 = new ValueObjectWithComplexType(valueObject2, 17, "test", false); complexValueObject1.Should().Be(complexValueObject2); }