public void TestUserStatsExpENTER() { 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(10); Assert.Equal(10, test.Experience);// Check if total exp is 10. }
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 }