Exemple #1
0
        public Task <Unit> Handle(StartPlayingSoundEffect request, CancellationToken cancellationToken)
        {
            _buzzer.StartPlaying(request.Frequency);

            _logger.LogInformation("Sent start playing request.");

            return(Unit.Task);
        }
Exemple #2
0
        public async Task Handle_StartPlayingSoundEffect_starts_playing_sound_effect()
        {
            // Arrange
            var command = new StartPlayingSoundEffect(_frequency);

            // Act
            await _sut.Handle(command, _defaultCancellationToken);

            // Assert
            A.CallTo(() => _buzzer.StartPlaying(_frequency))
            .MustHaveHappenedOnceExactly();
        }