コード例 #1
0
        public async Task ListCharactersGivenStarWarsApiAdapterShouldReturnSomething()
        {
            var swAdapter = new StarWarsApiPeopleAdapter();
            var service   = new StarWarsCharacterDisplayService(swAdapter);

            await CallListCharactersAndAssertContainsExpectedCharacters(service).ConfigureAwait(false);
        }
コード例 #2
0
        private static async Task CallListCharactersAndAssertContainsExpectedCharacters(StarWarsCharacterDisplayService service)
        {
            var result = await service.ListCharacters().ConfigureAwait(false);

            Assert.Contains("Luke Skywalker", result, StringComparison.OrdinalIgnoreCase);
            Assert.Contains("Darth Vader", result, StringComparison.OrdinalIgnoreCase);
        }