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); }
// GET: Table public ActionResult Index() { List <GameTable> gameTables; GameTableServiceAccess gameTableServiceAcces = new GameTableServiceAccess(); ViewBag.Situation = 0; gameTables = gameTableServiceAcces.GetAll(); return(View(gameTables)); }
public void GetAllTest() { //Arrange GameTableServiceAccess gameTableServiceAccess = new GameTableServiceAccess(); //Act List <GameTableModel> gameTables = gameTableServiceAccess.GetAll(); //Assert Assert.IsTrue(gameTables.Count > 0); }
public void GetByIdTest() { //Arrange GameTableServiceAccess gameTableServiceAccess = new GameTableServiceAccess(); GameTableModel gameTable = null, gameTable2 = null; List <GameTableModel> tables = gameTableServiceAccess.GetAll(); if (tables.Count > 0) { gameTable = tables[0]; } //Act gameTable2 = gameTableServiceAccess.GetById(gameTable.Id); //Assert Assert.AreEqual(gameTable.TableName, gameTable2.TableName); }
public List <GameTableModel> GetAll() { return(gameTableAccess.GetAll()); }