public async Task ExecuteAsync_WhenCalled_AssertIdentifierWasCalledOnCommand() { CommandHandler sut = CreateSut(); Mock <IDeleteUserIdentityCommand> commandMock = CreateCommandMock(); await sut.ExecuteAsync(commandMock.Object); commandMock.Verify(m => m.Identifier, Times.Once); }
public async Task ExecuteAsync_WhenCalled_AssertDeleteUserIdentityAsyncWasCalledOnSecurityRepository() { CommandHandler sut = CreateSut(); int identifier = _fixture.Create <int>(); IDeleteUserIdentityCommand command = CreateCommandMock(identifier).Object; await sut.ExecuteAsync(command); _securityRepositoryMock.Verify(m => m.DeleteUserIdentityAsync(It.Is <int>(value => value == identifier)), Times.Once); }