public void ValidateISBNEmpty() { TestResult = "Er is geen geldig ISBN ingevuld!"; long ISBN = 0; // null wordt omgezet naar 0 bookValidator.ValidateISBN(ISBN); Assert.AreEqual(TestResult, bookValidator.Result); }
public IActionResult AddBook(BookView bookView) { if (bookValidator.ValidateISBN(bookView.ISBN) && bookValidator.ValidateTitle(bookView.Title) && bookValidator.ValidateCategory(bookView.Category) && bookValidator.ValidateYear(bookView.Year_of_publication) && bookValidator.ValidateAuthor(bookView.author.Firstname)) { Book book = BookViewToBook(bookView); bookContainer.AddBook(book); ModelState.AddModelError("Succes", "Boek is toegevoegd"); return(View("BookToevoegen")); } else { ModelState.AddModelError("Alert", bookValidator.Result); return(View("BookToevoegen")); } }
public SearchByISBNCriteria(string isbn) { BookValidator.ValidateISBN(isbn); this.isbn = isbn; }