Ejemplo n.º 1
0
        public void ShouldAddArrayOfNewThemes()
        {
            var topTenGame  = new mod.TopTenGame();
            var themesToAdd = GetArrayOfThemes().ToList();

            List <string> expectedListOfThemes = themesToAdd.ToList();

            topTenGame.RegisterTheme(themesToAdd.ToArray());

            topTenGame.Themes.Should().BeEquivalentTo(expectedListOfThemes);
        }
Ejemplo n.º 2
0
        public void ShouldPopFirstTheme()
        {
            var           topTenGame         = new mod.TopTenGame();
            const string  expectedTheme      = "New theme";
            List <string> expectedThemesList = new List <string>();

            topTenGame.RegisterTheme(expectedTheme);

            string theme = topTenGame.GetNextTheme();

            theme.Should().Be(expectedTheme);
            topTenGame.Themes.Should().BeEquivalentTo(expectedThemesList);
        }
Ejemplo n.º 3
0
        public void ShouldRegisterTopTenTheme()
        {
            //Given
            var topTenGame = new mod.TopTenGame();

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

            //With
            topTenGame.RegisterTheme(theme);

            //Then
            topTenGame.Themes.Should().BeEquivalentTo(themesList);
        }
Ejemplo n.º 4
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);
        }