Beispiel #1
0
        public void ShouldCaptenBeSecondTopTenPlayerAfter2Distributions()
        {
            var topTenGame = new mod.TopTenGame();

            Add5PlayersToGame(topTenGame);
            const int expectedIndexCapten = 1;

            topTenGame.NextCapten();
            topTenGame.NextCapten();

            topTenGame.IndexCapten.Should().Be(expectedIndexCapten);
        }
Beispiel #2
0
        public void ShouldHaveCorrectCaptenAfter1Distribution()
        {
            var          topTenGame     = new mod.TopTenGame();
            const string expectedCapten = "The Capten";

            topTenGame.RegisterUser(expectedCapten);

            topTenGame.NextCapten();

            topTenGame.Capten.Should().Be(expectedCapten);
        }
Beispiel #3
0
        public void ShouldHaveCaptenAfter1Distribution()
        {
            var topTenGame = new mod.TopTenGame();

            Add5PlayersToGame(topTenGame);
            const bool expectedCaptenPresence = true;

            topTenGame.NextCapten();

            topTenGame.HasCapten.Should().Be(expectedCaptenPresence);
        }
Beispiel #4
0
        public void ShouldCaptenBeFirstTopTenPlayer()
        {
            var topTenGame = new mod.TopTenGame();

            Add5PlayersToGame(topTenGame);
            const int expectedIndexCapten = 0;

            topTenGame.NextCapten();

            topTenGame.IndexCapten.Should().Be(expectedIndexCapten);
        }
Beispiel #5
0
        public void ShouldResetTopTenGameParams()
        {
            //Given
            var         topTenGame = new mod.TopTenGame();
            const ulong idMsg      = 25;

            topTenGame.StoreRegisterMsg(idMsg);
            topTenGame.RegisterMsgId.Should().Be(idMsg);

            const string  theme      = "Thème 1";
            List <string> themesList = new List <string> {
                theme
            };

            topTenGame.RegisterTheme(theme);
            topTenGame.Themes.Should().BeEquivalentTo(themesList);

            const string  player      = "Player 1";
            List <string> playersList = new List <string> {
                player
            };

            topTenGame.RegisterUser(player);
            topTenGame.Users.Should().BeEquivalentTo(playersList);

            const ulong   expectedIdMsg       = 0;
            List <string> themesListExpected  = new List <string> {
            };
            List <string> playersListExpected = new List <string> {
            };

            const bool expectedCaptenPresence = false;

            topTenGame.NextCapten();

            //With
            topTenGame.Clear();

            //Then
            topTenGame.RegisterMsgId.Should().Be(expectedIdMsg);
            topTenGame.Themes.Should().BeEquivalentTo(themesListExpected);
            topTenGame.Users.Should().BeEquivalentTo(playersListExpected);
            topTenGame.HasCapten.Should().Be(expectedCaptenPresence);
        }
Beispiel #6
0
        public void ShouldCaptenDistributionBeACircularPermutation()
        {
            var topTenGame = new mod.TopTenGame();

            Add5PlayersToGame(topTenGame);
            const int expectedIndexCapten = 0;

            topTenGame.NextCapten();
            topTenGame.NextCapten();
            topTenGame.NextCapten();
            topTenGame.NextCapten();
            topTenGame.NextCapten();
            topTenGame.NextCapten();

            topTenGame.IndexCapten.Should().Be(expectedIndexCapten);
        }