public async Task CreateWordAsync_AddsNewWord() { var expected = GenerateWord <Adverb>(false, false); var service = new WordsService(_context); var actual = await service.CreateWordAsync(expected); Assert.Equal(expected.Id, actual); Assert.Equal(1, _context.Set <Adverb>().Count()); }
public async Task CreateWordAsync_ConvertsWordValueToPascalCase(string givenValue, string expectedValue) { var expected = GenerateWord <Noun>(false, false, givenValue); var service = new WordsService(_context); var actual = await service.CreateWordAsync(expected); Assert.Equal(expected.Id, actual); Assert.Equal(1, _context.Set <Noun>().Count()); var actualValue = (await _context.Set <Noun>().FindAsync(expected.Id)).Value; Assert.Equal(expectedValue, actualValue); }
public async Task CreateWordAsync_WithPreviousData_AddsNewWord() { const int previousDataCount = 3; await FeedTestData(_context, previousDataCount); var expected = GenerateWord <Adjective>(false, false); var service = new WordsService(_context); var actual = await service.CreateWordAsync(expected); Assert.Equal(expected.Id, actual); Assert.Equal(previousDataCount + 1, _context.Set <Adjective>().Count()); }