public void Given_value_object_should_instantiate() { var birthdate = new Birthdate(DateTime.UtcNow); birthdate.Should().NotBeNull(); birthdate.Value.Should().Be(DateTime.UtcNow.Date); }
public void Given_value_objects_when_same_values_should_be_equal() { var birthdate1 = new Birthdate(DateTime.UtcNow); var birthdate2 = new Birthdate(DateTime.UtcNow); birthdate1.Should().Be(birthdate2); (birthdate1 == birthdate2).Should().BeTrue(); (birthdate1 != birthdate2).Should().BeFalse(); }
public void Given_value_object_when_set_primitive_value_should_implicit_convert() { DateTime birthdate = new Birthdate(DateTime.UtcNow); birthdate.Should().Be(DateTime.UtcNow.Date); }
public void ThenTheBirthdateShouldBeInXDays(DateTime expectedDate) { Birthdate.Should().Be(expectedDate); }