Example #1
0
        public async void Match_NoMatch_ReturnsStatusNewBook()
        {
            var books = Substitute.For <IFullDataSource>();

            books.GetBooks(true, true).Returns(new BookInfo[] { MakeBook("123", "Title1", "Author1") });
            var matcher = new BookFinder(books);
            var result  = await matcher.Find(MakeBook("456", "Title2", "Author2"));

            Assert.IsNotNull(result);
            Assert.AreEqual(MatchStatus.NewBook, result.Status);
            Assert.IsNull(result.Book);
        }
Example #2
0
 public async void Match_Null_ReturnsEmpty()
 {
     var books   = Substitute.For <IFullDataSource>();
     var matcher = new BookFinder(books);
     var result  = await matcher.Find(null);
 }