示例#1
0
        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);
        }
示例#2
0
        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);
        }