Пример #1
0
        public void GetAll()
        {
            var refactorMeProvider = new RefactorMeProvider();

            var controller = new ProductsController(refactorMeProvider);


            var addedproduct = controller.GetProduct(_Product.Id).Result;

            Assert.AreEqual(addedproduct.Id, _Product.Id);
        }
Пример #2
0
        public void Delete()
        {
            var refactorMeProvider = new RefactorMeProvider();

            var controller = new ProductsController(refactorMeProvider);

            controller.Delete(_Product.Id);

            var deletedProduct = controller.GetProduct(_Product.Id).Result;

            Assert.AreEqual(deletedProduct, null);
        }
Пример #3
0
        public void Update()
        {
            var refactorMeProvider = new RefactorMeProvider();

            var controller = new ProductsController(refactorMeProvider);

            _Product.Name = "Samsung Galaxy S8";

            controller.Update(_Product);

            var updatedProduct = controller.GetProduct(_Product.Id).Result;

            Assert.AreEqual(updatedProduct.Name, "Samsung Galaxy S8 Test");
        }
Пример #4
0
        public void Product()
        {
            var refactorMeProvider = new RefactorMeProvider();

            var controller = new ProductsController(refactorMeProvider);

            //Adding A Product to DB
            var product = controller.Create(new ProductDTO
            {
                Name          = "Samsung Galaxy S7",
                Description   = "Newest mobile product from Samsung.",
                Price         = 1024.99m,
                DeliveryPrice = 16.99m,
            });



            // _Product = (ProductDTO)product;

            GetAll();
            Update();
            Delete();
        }
Пример #5
0
        public void Add()
        {
            IRefactorMeProvider repo = new RefactorMeProvider();

            var productToInsert = new Product
            {
                DeliveryPrice = 255,
                Description   = "S10",
                Name          = "Samsung",
                Price         = 234
            };

            repo.Products.Add(productToInsert);

            var productToEdit = repo.Products.GetEntityAsync(e => e.Id == productToInsert.Id).Result;

            productToEdit.Price = 258;

            repo.Products.Edit(productToEdit);

            repo.Products.Delete(productToEdit.Id);

            var response = repo.Products.Any(product => product.Id == productToEdit.Id);
        }
Пример #6
0
 public void GetAll()
 {
     IRefactorMeProvider repo = new RefactorMeProvider();
     var product = repo.Products.GetAllAsync();
 }
Пример #7
0
 public void GetEntities()
 {
     IRefactorMeProvider repo = new RefactorMeProvider();
 }