public void SelecteerPersonage() { bool x = personagerepo.SelecteerPersonage(1, 1); bool y = personagerepo.SelecteerPersonage(0, 1); Assert.AreEqual(true, x); Assert.AreEqual(false, y); }
public IActionResult StartGame(int id) { if (id != 0 && id <= 10) { int userId = Convert.ToInt32(HttpContext.Session.GetInt32("CurrentUserID")); personagerepo.SelecteerPersonage(id, userId); return(RedirectToAction("Gamewereld")); } else { TempData["Error"] = "Ongeldig personage geselecteerd."; return(RedirectToAction("NewGame")); } }