public void GivenProduct_WhenTheNameIsEmpty_IsFailed() { // Arrange var product = new Product(null, 10); var spec = new IsNameMaxLengthValidSpec(); // Act var result = spec.IsSatisfiedBy(product); // Assert Assert.False(result); }
public void GivenProduct_WhenTheNameIsMoreThanLimit_IsFailed() { // Arrange var product = new Product(new string('c', 300), 10); var spec = new IsNameMaxLengthValidSpec(); // Act var result = spec.IsSatisfiedBy(product); // Assert Assert.False(result); }
public void GivenProduct_WhenTheNameIsValid_IsSuccessful() { // Arrange var product = new Product("dammy name", 10); var spec = new IsNameMaxLengthValidSpec(); // Act var result = spec.IsSatisfiedBy(product); // Assert Assert.True(result); }