public void RejoinRetrospectiveCommandHandler_IfNotFound2() { // Given var authService = Substitute.For <ICurrentParticipantService>(); var handler = new RejoinRetrospectiveCommandHandler(this.Context, authService); var query = new RejoinRetrospectiveCommand(this._retro1Id, 3 /*Baz*/); // When TestDelegate action = () => handler.Handle(query, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult(); // Then Assert.That(action, Throws.InstanceOf <NotFoundException>()); }
public async Task RejoinRetrospectiveCommandHandler_SetsParticipantInfo_IfFound() { // Given var authService = Substitute.For <ICurrentParticipantService>(); var handler = new RejoinRetrospectiveCommandHandler(this.Context, authService); var query = new RejoinRetrospectiveCommand(this._retro1Id, /*John*/ 1); // When await handler.Handle(query, CancellationToken.None); // Then authService.Received().SetParticipant(Arg.Any <CurrentParticipantModel>()); }