private void InitData() { ((BookDataInMemory)bookDataInMemory).Clear(); BookBasic book0 = new BookBasic("0", "Livre 0"); bookDataInMemory.Add(book0); BookWithDvd book1 = new BookWithDvd("1", "Livre 1", 1); bookDataInMemory.Add(book1); }
public void Should_add_book() { init(); Book bookBasic = new BookBasic("0", "Titre0"); Assert.IsTrue(libraryController.AddBook(bookBasic)); Book bookWithDvd = new BookWithDvd("1", "Titre1", 3); Assert.IsTrue(libraryController.AddBook(bookWithDvd)); }
public BookDataInMemory() { Books = new List <Book>(); Book book1 = new BookBasic(1, "Harry Potter 1"); Book book2 = new BookWithDvd(2, "TOIC Preparation", 3); Book book3 = new BookBasic(3, "Harry Potter 2"); Books.Add(book1); Books.Add(book2); Books.Add(book3); }
private void initialUser(LibraryController controller) { /* Création d'un utilisateur initial */ UserDto userDto = new UserDto("admin", "KANE", "Harry", Role.librarian, null); controller.AddUser(userDto, "admin"); BookBasic book = new BookBasic("FR1", "Chartreuse"); controller.AddBook(book); BookBasic book1 = new BookBasic("FR2", "Code civil 2019 annoté. Édition limitée"); controller.AddBook(book1); BookBasic book2 = new BookBasic("OI1", "Shakespeare, Le Songe d’une nuit d’été"); controller.AddBook(book2); BookBasic book3 = new BookBasic("PO1", "L'Intelligence des plantes"); controller.AddBook(book3); BookBasic book4 = new BookBasic("FU1", "Passage des Ombres"); controller.AddBook(book4); BookBasic book5 = new BookBasic("TY8", "Les Lois naturelles de l'enfant"); controller.AddBook(book5); BookWithDvd book6 = new BookWithDvd("TR8", "Le capitalisme expliqué à ma petite-fille", 1); controller.AddBook(book6); BookWithDvd book7 = new BookWithDvd("PO1", "L'île des chasseurs d'oiseaux", 2); controller.AddBook(book7); }