public void ShouldCount0TopTenUsers() { var topTenGame = new mod.TopTenGame(); const int expectedNbOfUsers = 0; topTenGame.NbsUsers.Should().Be(expectedNbOfUsers); }
private static void Add5PlayersToGame(mod.TopTenGame topTenGame) { var players = GetArrayOfPlayers(); foreach (string player in players) { topTenGame.RegisterUser(player); } }
public void ShouldCount5TopTenUsers() { var topTenGame = new mod.TopTenGame(); Add5PlayersToGame(topTenGame); const int expectedNbOfUsers = 5; topTenGame.NbsUsers.Should().Be(expectedNbOfUsers); }
public void ShouldReturnTopTenThemeBuilder() { var args = new mod.TopTenGame(); var builder = srv.EmbedBuilderService.GenerateBuilderForNumberDisplay(args, "toto"); var stringifiedBuilder = builder.ToStringCustom(); stringifiedBuilder.Should().Be("TopTen, , #147786, , Le thème est le suivant :, toto, Le Cap'TEN est :, No Capten was selected, Tirage des numéros :, No players, "); }
public void ShouldNotHaveCaptenWithoutDistribution() { var topTenGame = new mod.TopTenGame(); Add5PlayersToGame(topTenGame); const bool expectedCaptenPresence = false; topTenGame.HasCapten.Should().Be(expectedCaptenPresence); }
public void ShouldCount1TopTenUsers() { var topTenGame = new mod.TopTenGame(); const string player = "Player 1"; topTenGame.RegisterUser(player); const int expectedNbOfUsers = 1; topTenGame.NbsUsers.Should().Be(expectedNbOfUsers); }
public void ShouldReturnTopTenBuilder() { var args = new mod.TopTenGame(); var builder = srv.EmbedBuilderService.InitBuilder(new List <EmbedFieldBuilder>(), args.ColorTopTen); var stringifiedBuilder = builder.ToStringCustom(); stringifiedBuilder.Should().Be("TopTen, , #147786, , , "); }
public void ShouldCaptenBeFirstTopTenPlayer() { var topTenGame = new mod.TopTenGame(); Add5PlayersToGame(topTenGame); const int expectedIndexCapten = 0; topTenGame.NextCapten(); topTenGame.IndexCapten.Should().Be(expectedIndexCapten); }
public void ShouldHaveCaptenAfter1Distribution() { var topTenGame = new mod.TopTenGame(); Add5PlayersToGame(topTenGame); const bool expectedCaptenPresence = true; topTenGame.NextCapten(); topTenGame.HasCapten.Should().Be(expectedCaptenPresence); }
public void ShouldReturnTopTenPlayersBuilder() { var args = new mod.TopTenGame(); var builder = srv.EmbedBuilderService.GenerateBuilderReadRegister(new List <string> { "toto" }, args.ColorTopTen); var stringifiedBuilder = builder.ToStringCustom(); stringifiedBuilder.Should().Be("TopTen, , #147786, , Liste des joueurs :, toto, "); }
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); }
public void ShouldHaveCorrectCaptenAfter1Distribution() { var topTenGame = new mod.TopTenGame(); const string expectedCapten = "The Capten"; topTenGame.RegisterUser(expectedCapten); topTenGame.NextCapten(); topTenGame.Capten.Should().Be(expectedCapten); }
public void ShouldCaptenBeSecondTopTenPlayerAfter2Distributions() { var topTenGame = new mod.TopTenGame(); Add5PlayersToGame(topTenGame); const int expectedIndexCapten = 1; topTenGame.NextCapten(); topTenGame.NextCapten(); topTenGame.IndexCapten.Should().Be(expectedIndexCapten); }
public void ShouldStoreTopTenRegisterMessage() { //Given var topTenGame = new mod.TopTenGame(); const ulong idMsg = 25; //With topTenGame.StoreRegisterMsg(idMsg); //Then topTenGame.RegisterMsgId.Should().Be(idMsg); }
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); }
public void ShouldNotAddExistingPlayersAmongUsers() { var topTenGame = new mod.TopTenGame(); const string playerToAddTwice = "New Player"; List <string> expectedListOfPlayers = new List <string> { playerToAddTwice }; topTenGame.RegisterUser(playerToAddTwice); topTenGame.RegisterUser(playerToAddTwice); topTenGame.Users.Should().BeEquivalentTo(expectedListOfPlayers); }
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); }
public void ShouldResetTopTenRegisterMessage() { //Given var topTenGame = new mod.TopTenGame(); const ulong idMsg = 25; topTenGame.StoreRegisterMsg(idMsg); const ulong expectedIdMsg = 0; //With topTenGame.ResetRegisterMsg(); //Then topTenGame.RegisterMsgId.Should().Be(expectedIdMsg); }
public void ShouldRegisterTopTenUser() { //Given var topTenGame = new mod.TopTenGame(); const string player = "Player 1"; List <string> playersList = new List <string> { player }; //With topTenGame.RegisterUser(player); //Then topTenGame.Users.Should().BeEquivalentTo(playersList); }
public void ShouldAddArrayOfNewPlayers() { var topTenGame = new mod.TopTenGame(); Add5PlayersToGame(topTenGame); const string playerToAdd = "New Player"; var playersToAdd = GetArrayOfPlayers().ToList(); playersToAdd.Add(playerToAdd); List <string> expectedListOfPlayers = playersToAdd.ToList(); topTenGame.RegisterUser(playersToAdd.ToArray()); topTenGame.Users.Should().BeEquivalentTo(expectedListOfPlayers); }
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); }
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); }
public void ShouldReturnTopTenGameProperties() { // Given var topTenGame = new mod.TopTenGame(); const string expectedColor = "#147786"; int[] expectationNumberList = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, }; const string expectedEmote = "💯"; int? expectedIndexCapten = null; const ulong expectedIdMsg = 0; // Then topTenGame.NumberList.Should().BeEquivalentTo(expectationNumberList); topTenGame.ColorTopTen.ToString().Should().Be(expectedColor); topTenGame.RegisterEmoteChar.ToString().Should().Be(expectedEmote); topTenGame.IndexCapten.Should().Be(expectedIndexCapten); topTenGame.RegisterMsgId.Should().Be(expectedIdMsg); topTenGame.Users.Should().BeEmpty(); topTenGame.Themes.Should().BeEmpty(); }