public void ShouldNotHaveErrors_id_greaterThanZero() { var validator = new DeleteProductValidator(); var command = CommandFactory.DeleteProduct(1); validator.ShouldNotHaveValidationErrorFor(c => c.ProductId, command); }
public void ShouldHaveErrors_id_lessThanOne(int id) { var validator = new DeleteProductValidator(); var command = CommandFactory.DeleteProduct(id); validator.ShouldHaveValidationErrorFor(c => c.ProductId, command); }
public void Delete_Product_Validator() { var validator = new DeleteProductValidator(); var deleteProductRequest = new DeleteProductRequest() { Id = 1 }; var result = validator.Validate(deleteProductRequest); Assert.True(result.IsValid); }