Exemple #1
0
        public void TestUserStatsExpLeftMAX()
        {
            string tempFile = Path.GetTempFileName();                            //create a temporary file

            File.WriteAllText(tempFile, "HEALTH:100\nMANA:40\nLEVEL:1\nEXP:36"); //Create values
            StatsModel test = new StatsModel(tempFile);

            Assert.Equal("LEVEL UP", test.ExpLeft());//Check if user has leveled up
        }
Exemple #2
0
        public void TestUserStatsExpLeft()
        {
            string tempFile = Path.GetTempFileName();                           //create a temporary file

            File.WriteAllText(tempFile, "HEALTH:100\nMANA:40\nLEVEL:1\nEXP:0"); //Create values
            StatsModel test = new StatsModel(tempFile);

            Assert.Equal("36", test.ExpLeft());//Check the remaining exp left
        }
Exemple #3
0
        public async Task TestUserStatsExpCOMBOAsync()
        {
            string tempFile = Path.GetTempFileName();                           //create a temporary file

            File.WriteAllText(tempFile, "HEALTH:100\nMANA:40\nLEVEL:1\nEXP:0"); //Create values
            StatsModel test = new StatsModel(tempFile);

            test.ExpEnterAsync(36);
            Assert.Equal(36, test.Experience);         // Check if total exp is 10.
            Assert.Equal("LEVEL UP", test.ExpLeft());  //Check if user has leveled up
            Assert.True(await test.StatsCheckAsync()); //Check if its time for a levelup

            Assert.Equal(2, test.Level);               //Check if level has updated
            Assert.Equal(120, test.Health);            //Check if Health has updated
            Assert.Equal(50, test.Mana);               //Check if Mana has updated
        }