Last active
January 9, 2020 04:15
-
-
Save taylorc/47cb383d6f04bccdf27ac586b7d16ee8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Collection("QueryTests")] | |
public class GetTodosQueryTests { | |
private readonly ApplicationDbContext _context; | |
private readonly IMapper _mapper; | |
public GetTodosQueryTests(QueryTestFixture fixture) { | |
_context = fixture.Context; | |
_mapper = fixture.Mapper; | |
} | |
[Fact] | |
public async Task Handle_ReturnsCorrectVmAndListCount() { | |
var query = new GetTodosQuery(); | |
var handler = new GetTodosQuery.GetTodosQueryHandler(_context, _mapper); | |
var result = await handler.Handle(query, CancellationToken.None); | |
result.ShouldBeOfType < TodosVm > (); | |
result.Lists.Count.ShouldBe(1); | |
var list = result.Lists.First(); | |
list.Items.Count.ShouldBe(5); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment