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