public async Task QueryAsync_WhenCalled_ReturnsContactGroupFromContactRepository() { IContactGroup contactGroup = _fixture.BuildContactGroupMock().Object; QueryHandler sut = CreateSut(contactGroup); IGetContactGroupQuery query = CreateQueryMock().Object; IContactGroup result = await sut.QueryAsync(query); Assert.That(result, Is.EqualTo(contactGroup)); }
public async Task QueryAsync_WhenCalled_AssertGetContactGroupAsyncWasCalledOnContactRepository() { QueryHandler sut = CreateSut(); int number = _fixture.Create <int>(); IGetContactGroupQuery query = CreateQueryMock(number).Object; await sut.QueryAsync(query); _contactRepositoryMock.Verify(m => m.GetContactGroupAsync(It.Is <int>(value => value == number)), Times.Once); }