示例#1
0
        public void Post()
        {
            Product product = new Product()
            {
                Name = "Test", Details = "Test", Price = 0
            };

            var response = ProductEndpoints.CreateProduct(product.Name, product.Details, product.Price).Result;

            Assert.IsTrue(response.StatusCode == System.Net.HttpStatusCode.Created);
        }
示例#2
0
        public async Task <IActionResult> Create(string name, string details, double price)
        {
            var result = await ProductEndpoints.CreateProduct(name, details, price);

            return(RedirectToAction("Index", "Product"));
        }