public void Initialize()
 {
     TestInitialiser.Initialise();
     crudOnMessages = TestInitialiser.ninjectKernel.kernel.Get <ICrudOnMessages>();
     message        = TestInitialiser.CreateMessage();
     productId      = TestInitialiser.context.Products.ToList()[0].Id;
 }
Exemple #2
0
 public void Initialize()
 {
     TestInitialiser.Initialise();
     crudOnFriends = TestInitialiser.ninjectKernel.kernel.Get <ICrudOnFriends>();
     crudOnUsers   = TestInitialiser.ninjectKernel.kernel.Get <ICrudOnUsers>();
     AddTwoUsers();
 }
Exemple #3
0
 public void Initialize()
 {
     TestInitialiser.Initialise();
     this.getCitiesAndCategories = TestInitialiser.ninjectKernel.kernel.Get <IGetCitiesAndCategories>();
     this.crudOnProducts         = TestInitialiser.ninjectKernel.kernel.Get <ICrudOnProducts>();
     this.crudOnAlerts           = TestInitialiser.ninjectKernel.kernel.Get <ICrudOnAlerts>();
     this.mailSender             = TestInitialiser.ninjectKernel.kernel.Get <IMailSender>();
 }
        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);
        }
        public void Initialize()
        {
            TestInitialiser.Initialise();
            crudOnFavorites = TestInitialiser.ninjectKernel.kernel.Get <ICrudOnFavorites>();
            crudOnProducts  = TestInitialiser.ninjectKernel.kernel.Get <ICrudOnProducts>();
            crudOnUsers     = TestInitialiser.ninjectKernel.kernel.Get <ICrudOnUsers>();

            productId = TestInitialiser.context.Products.ToList()[0].Id;
            var viewUser = TestInitialiser.CreateUser();

            username = crudOnUsers.CreateOrUpdateUser(viewUser).Result.UserName;
        }
Exemple #6
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();
        }
Exemple #7
0
        private void AddTwoUsers()
        {
            var user1 = TestInitialiser.CreateUser();

            user1.UserName = firstUsername;
            user1.Email    = "*****@*****.**";
            var user2 = TestInitialiser.CreateUser();

            user2.UserName = secondUsername;
            user2.Email    = "*****@*****.**";
            crudOnUsers.CreateOrUpdateUser(user1).Wait();
            crudOnUsers.CreateOrUpdateUser(user2).Wait();
        }
Exemple #8
0
        public void Initialize()
        {
            TestInitialiser.Initialise();
            crudOnAlerts = TestInitialiser.ninjectKernel.kernel.Get <ICrudOnAlerts>();
            crudOnUsers  = TestInitialiser.ninjectKernel.kernel.Get <ICrudOnUsers>();
            var viewUser = TestInitialiser.CreateUser();

            user = crudOnUsers.CreateOrUpdateUser(viewUser).Result;
            var viewAlert = new ViewAlert()
            {
                ProductName = productName, UserId = user.UserId
            };

            alert = Mapper.Map <Alert>(viewAlert);
        }
Exemple #9
0
 public void Initialize()
 {
     TestInitialiser.Initialise();
     crudOnUsers = TestInitialiser.ninjectKernel.kernel.Get <ICrudOnUsers>();
     user        = TestInitialiser.CreateUser();
 }
 public void Initialize()
 {
     TestInitialiser.Initialise();
     crudOnProducts = TestInitialiser.ninjectKernel.kernel.Get <ICrudOnProducts>();
     product        = TestInitialiser.CreateProduct();
 }