public IActionResult BuyProduct(string name) { var username = HttpContext.User.FindFirstValue("username"); if (!logic.canBuySprite(username, name)) { ModelState.AddModelError("", "not enough points"); } logic.unlockSprite(username, name); return(View("Product")); }
void testGetUserSprites() { logic.AddSprite("test", "test", 500); logic.unlockSprite("jake", "test"); Assert.True(logic.getSpritesByUsername("jake").Count() == 1); }