示例#1
0
 public BookController(IModelContainer ModelContainer)
 {
     repo = new Repository(ModelContainer);
 }
 public BookShopRoleProvider()
 {
     repo = new Repository(new ModelContainerEF());
 }
示例#3
0
 public AccountController(IModelContainer ModelContainer)
 {
     repo = new Repository(ModelContainer);
 }
示例#4
0
 public void MyTestInitialize()
 {
     repo = new Repository(new ModelContainerMock());
 }
示例#5
0
        public void MyTestInitialize()
        {
            modelContainer = new ModelContainerMock();
            controller = new HomeController(modelContainer);
            myContext = new ContextMocks(controller);

            repo = new Repository(modelContainer);
            repo.CreateUser("TestUser", "123456", "TestEmail");
            myContext.SetUser("TestUser");
            repo.CreateTheme(new Theme { Id = 1, ThemeName = "TestTheme" });
            repo.CreateAuthor(new Author { Id = 1, FirstName = "TestName", LastName = "TestLastName" });
            repo.CreateBook(new Book { Id = 1, AuthorId = 1, ThemeId = 1, Price = 100, BookName = "TestBook" });
            repo.CreateBook(new Book { Id = 2, AuthorId = 1, ThemeId = 1, Price = 150, BookName = "TestBook2" });
            repo.CreateSale("TestUser", new Sale { BookId = 1, Quantity = 2, UserId = 0 });
            repo.CreateSale("TestUser", new Sale { BookId = 2, Quantity = 1, UserId = 0 });
        }