public async Task ExecuteAsync_WhenCalled_AssertToDomainWasCalledOnCommand() { CommandHandler sut = CreateSut(); Mock <IUpdateUserIdentityCommand> commandMock = CreateCommandMock(); await sut.ExecuteAsync(commandMock.Object); commandMock.Verify(m => m.ToDomain(), Times.Once); }
public async Task ExecuteAsync_WhenCalled_AssertUpdateUserIdentityAsyncWasCalledOnSecurityRepository() { CommandHandler sut = CreateSut(); IUserIdentity userIdentity = _fixture.BuildUserIdentityMock().Object; IUpdateUserIdentityCommand command = CreateCommandMock(userIdentity).Object; await sut.ExecuteAsync(command); _securityRepositoryMock.Verify(m => m.UpdateUserIdentityAsync(It.Is <IUserIdentity>(value => value == userIdentity)), Times.Once); }