public void EditTableTest()
        {
            if (table1 == null)
            {
                AddNewTableTest();
            }

            ManagerLogInTest();

            table1.Description = tableEditedDescription1;
            bool result = managerDataAccess.EditTable(managerContext1.Id, table1);

            Assert.IsTrue(result);

            var tables = managerDataAccess.GetTables(managerContext1.Id);

            Assert.IsTrue(tables != null && tables.Any());

            var editedTable = tables.FirstOrDefault(t => t.Id == table1.Id);

            Assert.IsNotNull(editedTable);

            Assert.AreEqual(editedTable.Description, tableEditedDescription1);

            ManagerLogOutTest();
        }
        public bool EditTable(Table table, int number, string tableDescription)
        {
            bool result;

            var oldNumber      = table.Number;
            var oldDescription = table.Description;

            table.Number      = number;
            table.Description = tableDescription;

            try
            {
                result = _managerDataAccess.EditTable(table);
            }
            catch
            {
                table.Number      = oldNumber;
                table.Description = oldDescription;

                throw new Exception("Exception from DB");
            }

            if (result)
            {
                return(true);
            }

            table.Number      = oldNumber;
            table.Description = oldDescription;

            return(false);
        }