Exemplo n.º 1
0
        public void CreateRoom()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");

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

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

            game.CreateStory("Test Story");
            var info = game.StartGame();

            Assert.True(info.GetPlayersAndStateInfo().gameStarted);
        }
Exemplo n.º 4
0
        public void UserThatCreatedGameShouldBeModerator()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");

            game.CreateStory("Test Story");
            var info = game.GetRoomInfo();

            Assert.True(info.moderatorConnected);
        }
Exemplo n.º 5
0
        public void UserVoting()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");

            game.CreateStory("Test Story");
            game.StartGame();
            var info = game.Vote();

            Assert.Equal("John", info.GetVoteInfo().players[0].name);
            Assert.True(info.GetVoteInfo().players[0].voted);
        }
Exemplo n.º 6
0
        public void ChangeStoryName()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");
            var info   = game.CreateStory("First Story");
            var story  = info.GetStoryEditInfo();

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

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

            game.CreateStory("First Story");
            game.StartGame();
            game.Vote();
            var info = game.ClearVotes();

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

            story.StoriesDelete();
            var sert = story.GetStoryState();

            //since only 1 story was created, if that story is deleted, there are no "created" stories anymore
            Assert.False(sert.storiesCreated);
        }
Exemplo n.º 9
0
        public void RevealCards()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");

            game.CreateStory("First Story");
            game.StartGame();
            var info = game.RevealCards();

            //if the user has not voted and the Moderator has revealed the cards,
            //that specific user will have his vote value set to -1
            Assert.Equal(-1, info.GetVoteInfo().players[0].vote);
        }
Exemplo n.º 10
0
        public void SkipStory()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");

            game.CreateStory("First Story");
            game.CreateStory("Second Story");
            game.StartGame();
            game.SkipStory();
            var info = game.StartGame();

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

            game.CreateStory("Test Story");
            var info = game.StartGame();
            var user = info.GetUserId();

            user.ChangeRoleToObserver();
            var sert = user.GetUserInfo();

            Assert.Equal(5, sert.players[0].inGameRole);
        }
Exemplo n.º 12
0
        public void ExportGameReport()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");

            game.CreateStory("First Story");
            game.StartGame();
            game.Vote();
            game.FinishVoting();
            var info = game.GetGameReport();

            Assert.Contains("John", info.GetExportInfo());
            Assert.Contains("First Story", info.GetExportInfo());
        }
Exemplo n.º 13
0
        public void ChangeEstimate()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");

            game.CreateStory("First Story");
            game.StartGame();
            game.Vote();
            var info  = game.FinishVoting();
            var story = info.GetStoryEstimateEditInfo();

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

            Assert.Equal(5, edit.stories[0].estimate);
        }
Exemplo n.º 14
0
        public void AddNewStoryAfterVotingFinishes()
        {
            var client = new PlanitPockerClient();
            var player = client.QuickPlayLogin("John");
            var game   = player.CreateRoom("Test Room");

            game.CreateStory("First Story");
            game.CreateStory("Second Story");
            game.StartGame();
            game.Vote();
            game.FinishVoting();
            var info = game.CreateStory("Third Story After Voting");

            //voting on the First Story is done, so it is not longer in the initial list
            //therefore the "Second Story" has the index of "0"
            //and the Latest added story is next in line, thus index "1"
            Assert.Equal("Third Story After Voting", info.GetStoryInfo().stories[1].title);
        }
Exemplo n.º 15
0
        public void ResetGameTimer()    //TIMER TESTS ARE NOT POSSIBLE BY API
        {
            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();

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

            //since voting duration can change based on how fast the test runs, votingDuration CANNOT be used
            //after reseting the timer, votingStart receives new time and code values (votingStart string will be different)
            //thus the votingStart parameter is stored in 2 variables
            //if the timer is actually reset, those 2 variables will be different
            Assert.True(initialTimer != resetTimer);
        }