Exemple #1
0
        public void InsertProductStatusTest()
        {
            var        result       = controller.InsertOneProduct(JsonDocument.Parse("{\"product_name\" : \"Xunit-Create-Test\"}").RootElement);
            ProductDAO productDAO   = new ProductDAO();
            var        objectResult = result as OkObjectResult;
            string     product_id   = objectResult.Value.ToBsonDocument().GetValue("productId").ToString();

            productDAO.DeleteById(product_id);
            Assert.IsType <OkObjectResult>(result);
        }