Esempio n. 1
0
        public void RegisterFailedAttemptShouldUpdateDateAndNrOfAttempts()
        {
            var role = RoleTestHelper.PendingRegistration().Build();
            var evt  = new RoleCreated(role, new UserId(5),
                                       new DomainEventId(IdTestHelper.Next()), _clock.UtcNow().PlusHours(-1));

            evt.RegisterFailedAttempt(_clock.UtcNow());

            evt.LastAttemptedAt.Should().Be(_clock.UtcNow());
            evt.NrOfAttempts.Should().Be(1);
        }
Esempio n. 2
0
        public void JoiningWhenStartedThrowsValidationError()
        {
            var game = GameTestHelper.StartedInternationalGame().Build();

            var thirdPlayer = PlayerTestHelper.White()
                              .WithId(IdTestHelper.Next())
                              .WithUsername("Ender")
                              .Build();

            Action joinGame = () => game.JoinGame(thirdPlayer, _fakeClock.UtcNow());

            joinGame.Should().Throw <ManualValidationException>();
        }