public void Contains_EmptyRegister_False() { ReaderRegister register = new ReaderRegister(); bool actual = register.Contains("name"); Assert.IsFalse(actual); }
public void Contains_RegisterDoesNotContainReaderWithCertainName_False() { ReaderRegister register = new ReaderRegister(); register.Add(new Reader("name")); bool actual = register.Contains("n"); Assert.IsFalse(actual); }
public void Contains_RegisterContainsReaderWithCertainName_True() { ReaderRegister register = new ReaderRegister(); register.Add(new Reader("name")); bool actual = register.Contains("name"); Assert.IsTrue(actual); }
public void TakeBook_NewReaderTakesBook_SuccessfullTrueAddbookToTakenBookRegisterAndAddsNewReaderToReaderRegister() { BookRegister libraryRegister = new BookRegister(); Book book1 = new Book("name", "author", "category", "language", "1999", "123"); libraryRegister.Add(book1); ReaderRegister readerRegister = new ReaderRegister(); TakenBookRegister takenRegister = new TakenBookRegister(); bool successful; TaskUtils.TakeBook(libraryRegister, takenRegister, readerRegister, "123", "Name", Convert.ToDateTime("2021-05-16"), out successful, 3); bool containsTakenRegister = takenRegister.Contains("123"); bool containsReaderRegister = readerRegister.Contains("Name"); Assert.IsTrue(successful); Assert.IsTrue(containsTakenRegister); Assert.IsTrue(containsReaderRegister); }
public void DeleteBook_DeletesBookFromBookRegisterAndTakenBookREgister_BookRegisterAndTakenBookRegisterDoesNotContainBook() { BookRegister libraryRegister = new BookRegister(); Book book1 = new Book("name", "author", "category", "language", "1999", "123"); libraryRegister.Add(book1); ReaderRegister readerRegister = new ReaderRegister(); TakenBookRegister takenRegister = new TakenBookRegister(); bool successful; TaskUtils.TakeBook(libraryRegister, takenRegister, readerRegister, "123", "Name", Convert.ToDateTime("2022-05-16"), out successful, 3); TaskUtils.DeleteBook(takenRegister, libraryRegister, readerRegister, "123"); bool containsBookRegister = takenRegister.Contains("123"); bool containsTakenBookRegister = readerRegister.Contains("123"); Assert.IsFalse(containsBookRegister); Assert.IsFalse(containsTakenBookRegister); }