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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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()); }
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); }
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); }
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); }