コード例 #1
0
            public async Task HandlesMissingIsbns()
            {
                var isbns = new List <string> {
                    "0765326353", "missing", "9780765326362"
                };
                var expectedBookIds = new List <int?> {
                    7235533, null, 17332218
                };
                var actualBookIds = await BooksClient.GetBookIdsForIsbns(isbns);

                Assert.NotNull(actualBookIds);
                Assert.Equal(actualBookIds.Count, isbns.Count);
                Assert.Equal(actualBookIds.Count, expectedBookIds.Count);

                for (var i = 0; i < actualBookIds.Count; i++)
                {
                    Assert.Equal(actualBookIds[i], expectedBookIds[i]);
                }
            }