Exemplo n.º 1
0
 public BookController(IModelContainer ModelContainer)
 {
     repo = new Repository(ModelContainer);
 }
Exemplo n.º 2
0
 public BookShopRoleProvider()
 {
     repo = new Repository(new ModelContainerEF());
 }
Exemplo n.º 3
0
 public AccountController(IModelContainer ModelContainer)
 {
     repo = new Repository(ModelContainer);
 }
Exemplo n.º 4
0
 public void MyTestInitialize()
 {
     repo = new Repository(new ModelContainerMock());
 }
Exemplo n.º 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 });
        }