Пример #1
0
        public void UpdateProduct_TryToUpdateProductNotExistInDatabase_ReturnNull()
        {
            //Arrange
            var dummyProduct = DummyProduct.Product();
            //Act
            var updateNullProduct = ProductRepository.UpdateProduct(dummyProduct).Result;

            //Assert
            Assert.IsNull(updateNullProduct);
        }
Пример #2
0
        public void CreateNewProduct_CreatingNewProduct_ReturnCreatedNewProduct()
        {
            //Arrange
            var dummyProduct = DummyProduct.Product();

            //Act
            var newProduct = ProductRepository.CreateProductAsync(dummyProduct).Result;

            //Assert
            Assert.AreEqual(dummyProduct, newProduct);
            DeleteDummyProductFromDatabase(dummyProduct);
        }
Пример #3
0
        public void CreateProdut_CreatingExistingProductInDatabase_ReturnNull()
        {
            //Arrange
            var dummyProduct1 = DummyProduct.Product();
            var dummyProduct2 = dummyProduct1;

            //Act
            var reCreateProduct1 = ProductRepository.CreateProductAsync(dummyProduct1).Result;
            var reCreateProduct2 = ProductRepository.CreateProductAsync(dummyProduct2).Result;

            //Assert
            Assert.AreEqual(reCreateProduct2, null);
        }