public void RandomDataPopulatorTest()
 {
     Assert.AreEqual(repository.GetAllReaders().Count(), 6);
     Assert.AreEqual(repository.GetAllBookDescriptions().Count(), 6);
     Assert.AreEqual(repository.GetAllBookCopies().Count(), 10);
     Assert.AreEqual(repository.GetAllBookEvents().Count(), 6);
 }
Beispiel #2
0
        public void AddTheSameObjectTest()
        {
            Reader reader = new Reader("Dominik", "Karski");

            Assert.AreEqual(repository.GetAllReaders().Count(), 4);
            repository.AddReader(reader);
            Assert.AreNotEqual(repository.GetAllReaders().Count(), 5);

            BookDescription book  = new BookDescription("Metro 2033", "Dmitry Glukhovsky", "Insignis");
            var             count = repository.GetAllBookDescriptions().Count();

            Assert.AreEqual(count, 5);

            repository.AddBookDescription(book);
            repository.AddBookDescription(book);
            repository.AddBookDescription(book);
            Assert.AreEqual(count, 5);

            count = repository.GetAllBookDescriptions().Count();
            Assert.AreNotEqual(count, 6);

            Assert.AreEqual(repository.GetAllBookCopies().Count(), 5);
            repository.AddBookCopy(repository.GetBookCopy(0));
            Assert.AreEqual(repository.GetAllBookCopies().Count(), 5);

            Assert.AreEqual(repository.GetAllBookEvents().Count(), 7);
            repository.AddBookEvent(repository.GetBookEvent(0));
            Assert.AreEqual(repository.GetAllBookEvents().Count(), 7);
        }
 public IEnumerable <KeyValuePair <string, BookDescription> > GetAllBookDescriptions()
 {
     return(_dataRepository.GetAllBookDescriptions());
 }