Exemple #1
0
        public void GetAllCategoriesMethodTest()
        {
            Category category1 = new Category {
                Id = "1111111", Name = "Category 1"
            };
            Category category2 = new Category {
                Id = "2222222", Name = "Category 2"
            };
            Category category3 = new Category {
                Id = "3333333", Name = "Category 3"
            };

            using (var bc = new BusinessContext()) {
                bc.AddNewCategory(category1);
                bc.AddNewCategory(category2);
                bc.AddNewCategory(category3);

                ICollection <Category> categories = (ICollection <Category>)bc.GetAllCategories();

                Assert.IsTrue(categories.Contains(category1));
                Assert.IsTrue(categories.Contains(category2));
                Assert.IsTrue(categories.Contains(category3));
            }
        }