示例#1
0
        public async Task GetAllWordsAsync_ReturnsEmptySetIfNone()
        {
            var service = new WordsService(_context);
            var actual  = await service.GetAllWordsAsync <Adverb>("en");

            Assert.Empty(actual);
        }
示例#2
0
        public async Task GetAllWordsAsync_ReturnsAllFromSet()
        {
            const int expectedCount = 3;
            var       ids           = (await FeedTestData(_context, expectedCount)).OfType <Noun>().Select(w => w.Id).ToList();

            var service = new WordsService(_context);
            var actual  = await service.GetAllWordsAsync <Noun>("en");

            Assert.Equal(expectedCount, actual.Count);
            actual.Select(w => w.Id).Should().Equal(ids);
        }