예제 #1
0
        public void RejoinPokerSessionCommandHandler_IfNotFound2()
        {
            // Given
            var authService = Substitute.For <ICurrentParticipantService>();
            var handler     = new RejoinPokerSessionCommandHandler(this.Context, authService);
            var query       = new RejoinPokerSessionCommand(this._retro1Id, 3 /*Baz*/);

            // When
            TestDelegate action = () => handler.Handle(query, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult();

            // Then
            Assert.That(action, Throws.InstanceOf <NotFoundException>());
        }
예제 #2
0
        public async Task RejoinPokerSessionCommandHandler_SetsParticipantInfo_IfFound()
        {
            // Given
            var authService = Substitute.For <ICurrentParticipantService>();
            var handler     = new RejoinPokerSessionCommandHandler(this.Context, authService);
            var query       = new RejoinPokerSessionCommand(this._retro1Id, /*John*/ 1);

            // When
            await handler.Handle(query, CancellationToken.None);

            // Then
            authService.Received().SetParticipant(Arg.Any <CurrentParticipantModel>());
        }