Exemplo n.º 1
0
        public void CreateRoomThatCannotHaveStories()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoomHaveStories("Test Room", false);
            var info   = game.GetRoomInfo();

            Assert.False(info.haveStories);
        }
Exemplo n.º 2
0
        public void DontShowVotesToObservers()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoomObserverSeeingVotes("John", false);
            var info   = game.GetRoomInfo();

            Assert.False(info.showVotingToObservers);
        }
Exemplo n.º 3
0
        public void SkipStoriesWithoutConfirmation()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoomSkipConfirmation("John", false);
            var info   = game.GetRoomInfo();

            Assert.False(info.confirmSkip);
        }
Exemplo n.º 4
0
        public void NoAutomaticRevealVotes()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoomAutoVoteReveal("John", false);
            var info   = game.GetRoomInfo();

            Assert.False(info.autoReveal);
        }
Exemplo n.º 5
0
        public void AllowVoteChangeAfterVoting()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoomAllowChangeVote("John", true);
            var info   = game.GetRoomInfo();

            Assert.True(info.changeVote);
        }
Exemplo n.º 6
0
        public void SignUpLoginGameRoom()
        {
            var client = new PlanitPockerClient();
            var player = client.SignUpLogin("*****@*****.**", "John", "password123");
            var game   = player.CreateRoom("Test Room");
            var info   = game.GetRoomInfo();

            Assert.Equal("Test Room", info.title);
        }
Exemplo n.º 7
0
        public void QuickPlayLoginGameRoom()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");
            var info   = game.GetRoomInfo();

            Assert.Equal("Test Room", info.title);
        }
Exemplo n.º 8
0
        public void UseCountdownTimer()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            //this next method also requires the duration of the countdown timer in seconds
            var game = player.UseCountDownTimer("John", true, 30);
            var info = game.GetRoomInfo();

            Assert.True(info.countdownTimer);
        }
Exemplo n.º 9
0
        public void DeleteGameRoom()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");
            var info   = game.DeleteGameRoom();
            var sert   = info.GetGamesListInfo();

            //asserts that the game room that previously had the name "Test Room" does not longer has its name
            Assert.Null(sert[0].name);
        }
Exemplo n.º 10
0
        public void ModifyGameRoomSettings()
        {
            //by default, the game creates rooms without a countdown timer
            //this test will create a game (without a countdown timer) and then add the countdowntimer
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");
            //now we add the countdown timer by modifying the Room settings
            var info = game.EditCreatedGameRoom("Test Room", true, 30);
            var sert = info.GetGamesListInfo();

            Assert.True(sert[0].countdownTimer);
        }
Exemplo n.º 11
0
        public void ResetGameRoom()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");

            game.StartGame();
            game.Vote();
            game.FinishVoting();
            var info = game.ResetGameRoom();

            Assert.False(info.GetPlayersAndStateInfo().players[0].voted);
        }
Exemplo n.º 12
0
        public void CanNewUserStartTheGame()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");

            game.CreateStory("Test Story");
            var uGame = game.NewUserQuickPlayLogin("Jack");

            uGame.GetInGameRoom();
            var info = uGame.StartGame();

            Assert.False(info.GetRoomInfo().gameStarted);
        }
Exemplo n.º 13
0
        public void CanNewUserConnectToGame()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");

            game.CreateStory("Test Story");
            var uGame = game.NewUserQuickPlayLogin("Jack");

            uGame.GetInGameRoom();
            var info = game.StartGame();

            Assert.Equal("Jack", info.GetPlayersAndStateInfo().players[1].name);
        }
Exemplo n.º 14
0
        public void CanNewUserEndTheVotingProcess()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");

            game.CreateStory("Test Story");
            game.StartGame();
            var uGame = game.NewUserQuickPlayLogin("Jack");

            uGame.GetInGameRoom();
            game.Vote();
            var info = uGame.FinishVoting();

            Assert.False(info.GetPlayersAndStateInfo().closed);
        }
Exemplo n.º 15
0
        public void CanNewUserChangeStoryName()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");
            var info   = game.CreateStory("First Story");
            var uGame  = game.NewUserQuickPlayLogin("Jack");

            uGame.GetInGameRoom();
            var story = uGame.GetStoryEditInfo();

            story.StoriesUpdate("First Story Modified");
            var edit = story.GetStoryChangeInformation();

            Assert.Equal("First Story", edit.stories[0].title);
        }
Exemplo n.º 16
0
        public void CanNewUserCreateAStory()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");

            game.CreateStory("Test Story");
            var uGame = game.NewUserQuickPlayLogin("Jack");

            uGame.GetInGameRoom();
            var info = uGame.CreateStory("New User Test Story");

            //second user cannot create stories;
            //thus even if he calls the "CreateStory" API, the number of stories is the number of stories created by the moderator
            Assert.Equal(1, info.GetStoryInfo().storiesCount);
        }
Exemplo n.º 17
0
        public void CanNewUserSkipStories()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");

            game.CreateStory("First Story");
            game.CreateStory("Second Story");
            var uGame = game.NewUserQuickPlayLogin("Jack");

            uGame.GetInGameRoom();
            game.StartGame();
            uGame.SkipStory();
            var info = game.StartGame();

            Assert.Equal("First Story", info.GetCurrentStoryInfo().title);
        }
Exemplo n.º 18
0
        public void CanNewUserVote()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");

            game.CreateStory("Test Story");
            var uGame = game.NewUserQuickPlayLogin("Jack");

            uGame.GetInGameRoom();
            game.StartGame();
            var info = uGame.Vote();

            //extra assert to make sure that the vote is not registered for User John (players[0])
            //Assert.False(info.GetVoteInfo().players[0].voted);
            Assert.True(info.GetVoteInfo().players[1].voted);
        }
Exemplo n.º 19
0
        public void CanNewUserClearVotes()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");

            game.CreateStory("First Story");
            game.StartGame();
            var uGame = game.NewUserQuickPlayLogin("Jack");

            uGame.GetInGameRoom();
            game.Vote();
            var info = uGame.ClearVotes();

            Assert.True(info.GetPlayersAndStateInfo().players[0].voted);
            //user 1 votes and user 2 tried to clear votes, and is unable to
            //thus user 1 voted parameter remains true
        }
Exemplo n.º 20
0
        public void CanNewUserClearVotesAfterFinishVoting()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");

            game.CreateStory("First Story");
            game.StartGame();
            var uGame = game.NewUserQuickPlayLogin("Jack");

            uGame.GetInGameRoom();
            game.Vote();
            game.FinishVoting();
            var info = uGame.ClearVotes();

            Assert.True(info.GetPlayersAndStateInfo().players[0].voted);
            //see above test for explanations
        }
Exemplo n.º 21
0
        public void CanNewUserRevealCards()  //BUG FOUND !!!
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");

            game.CreateStory("First Story");
            game.StartGame();
            var uGame = game.NewUserQuickPlayLogin("Jack");

            uGame.GetInGameRoom();
            var info = uGame.RevealCards();

            Assert.Null(info.GetVoteInfo().players[1].vote);

            //if the votes are revealed before the users vote, the vote values become -1
            //if the cards are not revealed, the "vote" parameter should be null, however Test Explorer shows vote = -1
            //apparently the second user (using his own cookie) can Reveal the cards; this should not happen normally
        }
Exemplo n.º 22
0
        public void CanNewUserResetTimer()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");

            game.CreateStory("First Story");
            var info         = game.StartGame();
            var first        = info.GetCurrentStoryInfo();
            var initialTimer = first.GetVotingStart();
            var uGame        = game.NewUserQuickPlayLogin("Jack");

            uGame.GetInGameRoom();
            uGame.ResetTimer();
            var second     = info.GetCurrentStoryInfo();
            var resetTimer = second.GetVotingStart();

            //see ResetGameTimerTest in GameTests.cs
            //since the timer cannot be reset by the non-Moderator-user, the 2 variables are the same
            Assert.True(initialTimer == resetTimer);
        }