public void DisplayWinner_CompareWithConsoleOuput_Equal()
 {
     using (StringWriter sw = new StringWriter())
     {
         Console.SetOut(sw);
         sut.DisplayWinner("Rogge", 10000);
         string expected = string.Format("\nRogge WON!\nWith a total-score of: 10000\n");
         Assert.Equal(expected, sw.ToString());
     }
 }
Example #2
0
        private async Task Roll(IPlayer player, bool a_noTest, model.task.delay.IAsyncDelay a_asyncDelay)
        {
            player.Roll();
            player.UpdateTotalScore();

            m_IView.DisplayRolledDices(player.GetPlayername(), player.GetHand(), player.CalculateScore(), player.GetTotalScore());

            await a_asyncDelay.Delay(TimeSpan.FromSeconds(2));

            if (player.IsPlayerWinner())
            {
                m_IView.DisplayWinner(player.GetPlayername(), player.GetTotalScore());

                await a_asyncDelay.Delay(TimeSpan.FromSeconds(5));

                if (a_noTest)
                {
                    await Start();
                }
            }
        }