Exemple #1
0
        public void GetReadersByName()
        {
            readerRepository.Save(reader1);
            readerRepository.Save(reader2);
            IEnumerable <Reader> readers = readerRepository.GetReadersByName("John Doe", true);

            Assert.AreEqual(1, readers.Count());
            Assert.AreEqual(reader1, readers.First());
            readers = readerRepository.GetReadersByName("n", false);
            Assert.AreEqual(2, readers.Count());
            Assert.IsNotNull(readers.SingleOrDefault(r => r.Id == reader1.Id));
            Assert.IsNotNull(readers.SingleOrDefault(r => r.Id == reader2.Id));
        }