コード例 #1
0
        public void ShouldNotHaveErrors_id_greaterThanZero()
        {
            var validator = new DeleteProductValidator();
            var command   = CommandFactory.DeleteProduct(1);

            validator.ShouldNotHaveValidationErrorFor(c => c.ProductId, command);
        }
コード例 #2
0
        public void ShouldHaveErrors_id_lessThanOne(int id)
        {
            var validator = new DeleteProductValidator();
            var command   = CommandFactory.DeleteProduct(id);

            validator.ShouldHaveValidationErrorFor(c => c.ProductId, command);
        }
コード例 #3
0
        public void Delete_Product_Validator()
        {
            var validator            = new DeleteProductValidator();
            var deleteProductRequest = new DeleteProductRequest()
            {
                Id = 1
            };
            var result = validator.Validate(deleteProductRequest);

            Assert.True(result.IsValid);
        }