示例#1
0
        public void InsertCategoryList_ShouldAddNewListCountItems()
        {
            List <Category> toBeAdded = new List <Category>()
            {
                new Category()
                {
                    Name = "ioi"
                },
                new Category()
                {
                    Name = "iooi"
                },
                new Category()
                {
                    Name = "iiiooi"
                }
            };
            int expected_difference = toBeAdded.Count;

            CategoriesUpdater.TablesProvider = tables;

            int actual_size = tables.GetCategoryTable().FetchAllCategories().Count;

            CategoriesUpdater.InsertCategoryList(toBeAdded);
            int resulted_size = tables.GetCategoryTable().FetchAllCategories().Count;

            int actual_difference = resulted_size - actual_size;

            Assert.Equal(expected_difference, actual_difference);
        }
示例#2
0
        public void UpdateHome_ShouldChangeTheListSize()
        {
            ICategoryTable categoryTable = tables.GetCategoryTable();
            int            actual_size   = categoryTable.FetchAllCategories().Count;

            CategoriesUpdater.TablesProvider = tables;
            CategoriesUpdater.UpdateHome();

            int new_size = categoryTable.FetchAllCategories().Count;

            Assert.NotEqual(actual_size, new_size);
        }
示例#3
0
        public void GetAllAvailableCategories_ShouldReturnALL()
        {
            CategoriesUpdater.UpdateCategories(tables);

            Assert.NotEmpty(tables.GetCategoryTable().FetchAllCategories());
        }
 /// <summary>
 /// Updates the categories.
 /// </summary>
 private void UpdateCategories()
 {
     CategoriesUpdater.UpdateCategories(this.tablesProvider);
     this.availableCategories = CategoriesUpdater.GetAllAvailableCategories();
     Log.Info("UpdateCategories succeed!");
 }