public void DeleteTest() { //Arrange GameTableServiceAccess gameTableServiceAccess = new GameTableServiceAccess(); CGUserModel userModel = new CGUserModel { Id = "Test", Email = "*****@*****.**", UserName = "******" }; GameTableModel tableModel = null; gameTableServiceAccess.CreateGameTable(userModel, "TestTable"); List <GameTableModel> tables = gameTableServiceAccess.GetAll(); foreach (var table in tables) { if (table.TableName == "TestTable") { tableModel = table; } } bool res = false; //Act res = gameTableServiceAccess.Delete(tableModel.Id); //Assert Assert.IsTrue(res); }
public ActionResult Create(string tableName) { GameTable foundGt = null; GameTableServiceAccess gameTableServiceAcces = new GameTableServiceAccess(); if (tableName != null) { string userId = User.Identity.GetUserId(); try { foundGt = gameTableServiceAcces.CreateGameTable(userId, tableName); }catch (Exception e) { return(RedirectToAction("Error", "ErrorHandler", new { id = 4 })); } } ViewBag.Situation = 3; return(RedirectToAction("Lobby", new { tableId = foundGt.Id })); }
public GameTableModel CreateGameTable(CGUserModel userModel, string tableName) { return(gameTableAccess.CreateGameTable(userModel, tableName)); }