public void checkAddManager() { //new manager string[] manager = new string[5]; manager[0] = "125"; manager[1] = "John"; manager[2] = "893-88"; manager[3] = "Генеральный директор"; manager[4] = "user"; //create form with table managers form = new managers(); //add 3 records managers.dataManagers.Rows.Add("1", "Petya", "8888", "Менеджер", "petya"); managers.dataManagers.Rows.Add("2", "Vasya", "6666", "Менеджер", "vas"); managers.dataManagers.Rows.Add("3", "Egor", "3333", "Менеджер", "egor"); ManagerTypeCol coll = new ManagerTypeCol(); ManagerFactory fact = new ManagerFactory(); int a = ManagerFactory.count(); ManagerFactory.AddNewManager(manager); Assert.AreEqual(a + 1, ManagerFactory.count()); }
public void checkAddOrder() { string[] order = new string[7]; order[0] = "225"; order[1] = "Petr"; order[2] = "Vasya"; order[3] = "12 may 2013"; order[4] = "tour"; clients formCL = new clients(); clients.dataClients.Rows.Add("1", "Pet", "*****@*****.**", "88-88", "12 may 1990", "true", "VIP"); ClientTypeCol col = new ClientTypeCol(); ClientFactory factCl = new ClientFactory(); managers formMan = new managers(); managers.dataManagers.Rows.Add("1", "Petya", "8888", "Менеджер", "petya"); ManagerTypeCol coll = new ManagerTypeCol(); ManagerFactory factMan = new ManagerFactory(); orders formOrd = new orders(); orders.dataOrders.Rows.Add("Pet", "Petya", "12 may 2015", "1", "tour1"); orders.dataOrders.Rows.Add("Pet", "Petya", "13 may 2014", "2", "tou2"); orders.dataOrders.Rows.Add("Pet", "Petya", "14 may 2014", "3", "tou3"); countries contr = new countries(); countries.dataCountries.Rows.Add("1", "Россия"); Countries_Col obj = new Countries_Col(); hotels hot = new hotels(); hotels.dataHotels.Rows.Add("1", "hotel", "****", "12000"); HotelFactory hotelfac = new HotelFactory(); FoodCol food = new FoodCol(); TransportCol tr = new TransportCol(); TourTypeCol tourtype = new TourTypeCol(); tours formTour = new tours(); tours.dataTours.Rows.Add("1", "tour", "VIP туры", "Россия", "true", "hotel", "Автобус", "BB", "12000", "Рубль"); TourFactory factTour = new TourFactory(); OrderFactory fact = new OrderFactory(); int a = OrderFactory.count(); OrderFactory.AddOrder(order); Assert.AreEqual(a + 1, OrderFactory.count()); }
public void checkDelManager() { managers form = new managers(); //add 3 records managers.dataManagers.Rows.Add("1", "Petya", "8888", "Менеджер", "petya"); managers.dataManagers.Rows.Add("2", "Vasya", "6666", "Менеджер", "vas"); managers.dataManagers.Rows.Add("3", "Egor", "3333", "Менеджер", "egor"); ManagerTypeCol coll = new ManagerTypeCol(); ManagerFactory fact = new ManagerFactory(); int a = ManagerFactory.count(); ManagerFactory.DeleteManager(1); Assert.AreEqual(a - 1, ManagerFactory.count()); }
public void checkAddOrder() { string[] order = new string[5]; order[0] = "225"; order[1] = "Petr"; order[2] = "Vasya"; order[3] = "12 may 2013"; order[4] = "goods"; Clients formCL = new Clients(); Clients.dataClients.Rows.Add("1", "Pet", "*****@*****.**", "88-88", "12 may 1990", "VIP"); ClientTypeCol col = new ClientTypeCol(); ClientFactory factCl = new ClientFactory(); managers formMan = new managers(); managers.dataManagers.Rows.Add("1", "Petya", "8888", "Менеджер", "petya", " 22 мая"); ManagerTypeCol coll = new ManagerTypeCol(); ManagerFactory factMan = new ManagerFactory(); OrdersForm formOrd = new OrdersForm(); OrdersForm.dataOrders.Rows.Add("Pet", "Petya", "12 may 2015", "1", "Goods1"); OrdersForm.dataOrders.Rows.Add("Pet", "Petya", "13 may 2014", "2", "Goods2"); OrdersForm.dataOrders.Rows.Add("Pet", "Petya", "14 may 2014", "3", "Goods3"); TypeGoodsForm type = new TypeGoodsForm(); TypeGoodsForm.dataTypeGoods.Rows.Add("1", "Саморез"); TypeGoodsCol obj = new TypeGoodsCol(); GoodsTypeCol goodstype = new GoodsTypeCol(); GoodsForm formGoods = new GoodsForm(); GoodsForm.dataGoods.Rows.Add("1", "goods", "type", "12000", "Рубль"); GoodFactory factTour = new GoodFactory(); OrderFactory fact = new OrderFactory(); int a = OrderFactory.count(); OrderFactory.AddOrder(order); Assert.AreEqual(a + 1, OrderFactory.count()); }