public async Task TestUserStatsExpCheckFalseAsync() { 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.False(await test.StatsCheckAsync());//Check if not ready to lvl up }
public async Task TestUserStatsExpCheckAsync() { 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.True(await test.StatsCheckAsync());//Check if its time for a levelup }
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 }