public void ShouldRevoteProductFromFavoritesAfterDeletingIt()
        {
            var productMockup = TestInitialiser.CreateProduct();
            var product       = crudOnProducts.AddOrUpdate(productMockup).Result;

            crudOnFavorites.AddProductToFavorites(username, product.Id).Wait();
            crudOnProducts.DeleteProduct(productId).Wait();
            var favorites = crudOnFavorites.GetUsersFavoriteProducts(username).Result;

            Assert.AreEqual(favorites.Count(), 0);
        }
Example #2
0
        public void ShouldSentProductAlert()
        {
            ProductEmailNotifications productEmailNotifications = new ProductEmailNotifications(crudOnAlerts, mailSender);
            var product = TestInitialiser.CreateProduct();

            product.Title = "ceva bun tare";
            var addedProduct = crudOnProducts.AddOrUpdate(product).Result;

            productEmailNotifications.SendEmailForProduct("ceva", addedProduct.Id);
            Assert.True(true);

            crudOnProducts.DeleteProduct(addedProduct.Id).Wait();
        }
 public void Initialize()
 {
     TestInitialiser.Initialise();
     crudOnProducts = TestInitialiser.ninjectKernel.kernel.Get <ICrudOnProducts>();
     product        = TestInitialiser.CreateProduct();
 }