public void InitiateGroupingStageCommandHandler_InvalidRetroId_ThrowsNotFoundException() { // Given const string retroId = "not found surely :)"; var handler = new InitiateGroupingStageCommandHandler(this.Context, this.RetrospectiveStatusUpdateDispatcherMock); var request = new InitiateGroupingStageCommand { RetroId = retroId }; // When TestDelegate action = () => handler.Handle(request, CancellationToken.None).GetAwaiter().GetResult(); // Then Assert.That(action, Throws.InstanceOf <NotFoundException>()); }
public async Task InitiateGroupingStageCommandHandler_OnStatusChange_UpdatesRetroStageAndInvokesNotification() { // Given var handler = new InitiateGroupingStageCommandHandler(this.Context, this.RetrospectiveStatusUpdateDispatcherMock); var request = new InitiateGroupingStageCommand { RetroId = this.RetroId }; this.SystemClockMock.CurrentTimeOffset.Returns(DateTimeOffset.UnixEpoch); // When await handler.Handle(request, CancellationToken.None); this.RefreshObject(); // Then Assert.That(this.Retrospective.CurrentStage, Is.EqualTo(RetrospectiveStage.Grouping)); await this.RetrospectiveStatusUpdateDispatcherMock.Received().DispatchUpdate(Arg.Any <Retrospective>(), CancellationToken.None); }