예제 #1
0
        public void TakeBook_ReaderHasAlreadyTakenThreeBooks_SuccessfullFalse()
        {
            BookRegister libraryRegister = new BookRegister();
            Book         book            = new Book("name", "author", "category", "language", "1999", "123");

            libraryRegister.Add(book);
            ReaderRegister readerRegister = new ReaderRegister();
            Reader         reader         = new Reader("Name");

            readerRegister.Add(reader);
            readerRegister.AddBookCount(reader);
            readerRegister.AddBookCount(reader);
            TakenBookRegister takenRegister = new TakenBookRegister();
            bool successful;

            TaskUtils.TakeBook(libraryRegister, takenRegister, readerRegister, "123", "Name", Convert.ToDateTime("2021-05-16"), out successful, 3);
            Assert.IsFalse(successful);
        }
예제 #2
0
        public void AddBookCount_AddOneToReadersBookCount_ReaderBookCountShouldBeTwo()
        {
            ReaderRegister register = new ReaderRegister();
            Reader         reader   = new Reader("name");

            register.Add(reader);
            register.AddBookCount(reader);
            reader.BookCount.Should().Be(2);
        }