public void ProductOption_DeleteProductOption_ReturnsTrue()
        {
            var ProductOption = new ProductOption();
            var result        = ProductOption.Delete();

            Assert.IsTrue(result);
        }
        public void DeleteOption(Guid id)
        {
            if (!ModelState.IsValid)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }

            var opt = new ProductOption(id);

            opt.Delete();
        }
        public void ProductOption_AddNewProductOption_ReturnsTrue()
        {
            var ProductOption = new ProductOption
            {
                ProductId   = product.Id,
                Name        = "Blue Phone",
                Description = "This is a blue Samsung phone"
            };

            var result = ProductOption.Save();

            Assert.IsTrue(result);

            ProductOption.Delete();
        }
        public void ProductOption_UpdateProductOption_ReturnsTrue()
        {
            var ProductOption = new ProductOption
            {
                ProductId   = product.Id,
                Name        = "Red Phone",
                Description = "This is a Red Samsung phone"
            };
            var result = ProductOption.Save();

            Assert.IsTrue(result);

            ProductOption.Name        = "Green Phone";
            ProductOption.Description = "Testing the Samsung Green Phone";
            result = ProductOption.Save();
            Assert.IsTrue(result);

            ProductOption.Delete();
        }
示例#5
0
        public void DeleteOption(Guid id)
        {
            var opt = new ProductOption(id);

            opt.Delete();
        }
示例#6
0
 public StatusCode DeleteOption(Guid id)
 {
     return(Helpers.ResponseMaker(ProductOption.Delete(id)));
 }