private async Task AndAMessageIsPublished() { _message = new GenericMessage { Id = Guid.NewGuid() }; await _publisher.PublishAsync(_message); }
protected override async Task When() { await Publisher.PublishAsync(new OrderPlaced("1234")); await WaitForDone(); TearDownPubSub(); }
private async Task AndAMessageIsPublished() { _message = new SimpleMessage { Id = Guid.NewGuid() }; await _publisher.PublishAsync(_message); await Task.Delay(TimeSpan.FromSeconds(1)); }
private async Task WhenMessagesArePublishedToBothRegions() { _message1 = new GenericMessage { Id = Guid.NewGuid() }; _message2 = new GenericMessage { Id = Guid.NewGuid() }; await _primaryPublisher.PublishAsync(_message1); await _secondaryPublisher.PublishAsync(_message2); }
private async Task WhenMessagesArePublishedToBothRegions() { _message1 = new SimpleMessage { Id = Guid.NewGuid() }; _message2 = new SimpleMessage { Id = Guid.NewGuid() }; await _primaryPublisher.PublishAsync(_message1); await _secondaryPublisher.PublishAsync(_message2); await Task.Delay(TimeSpan.FromSeconds(1)); }
public async Task <IActionResult> Post([FromBody] CreateSongRequest request) { if (request.Url == null || !request.Url.Authority.Contains("youtube.com")) { return(this.BadRequest("Uri is invalid")); } await _publisher.PublishAsync(new CreateSongCommand { Url = request.Url.ToString(), Email = request.Email }); return(this.Ok()); }