Ejemplo n.º 1
0
 public void TestConstec()
 {
     game = new SpeakingGame(4, 40);
     Assert.Equal(4, game.Index);
     Assert.Equal(40, game.Score);
     Assert.Equal("do you speek english ?", game.CurrentExplain(game.Index));
 }
Ejemplo n.º 2
0
        //public void OnPost()
        //{

        //}

        public IActionResult OnPostNext()
        {
            Score = HttpContext.Session.GetInt32(SCORE) ?? 0;
            Index = HttpContext.Session.GetInt32(INDEX) ?? 0;

            Index = 1 + Index;
            Score = Score + 10;
            game  = new SpeakingGame(Index, Score);
            if (game.CurrentWord(Index) != "Game Over")
            {
                Meanning = game.CurrentExplain(Index);
                TunWord  = game.CurrentWord(game.Index);
            }
            if (Score >= 100)
            {
                Meanning = "end of the Game";
                TunWord  = "el loaabaa wfet";
                Score    = 100;
            }


            HttpContext.Session.SetInt32(INDEX, game.Index);
            HttpContext.Session.SetInt32(SCORE, game.Score);

            return(Page());
        }
Ejemplo n.º 3
0
 public void TestExplain()
 {
     Assert.Equal("what time is it ?", game.CurrentExplain(3));
 }