public void EmployeeProgress_NormalPath() { DBConnection_Accessor db = new DBConnection_Accessor(); StatsCalc_Accessor st = new StatsCalc_Accessor(db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); TestingFunctions tf = new TestingFunctions(db.GetDB()); try { tf.DeleteSale("3", "121", "9"); } catch (Exception e) { } String[] sale = new String[] { "3", "121", "9", "4/10/2008", "34000" }; MakeSale sa = new MakeSale(sale, db.GetDB()); sa.CreateSale(); DataTable dt = st.CalculateProgress(); Double actual = (Double)dt.Rows[0].ItemArray[2]; Double expected = 34000; Assert.IsTrue(actual == expected); tf.DeleteSale("3", "121", "9"); }
public void MonthlySales_OneSaleWrongDate() { DBConnection_Accessor db = new DBConnection_Accessor(); StatsCalc_Accessor st = new StatsCalc_Accessor(db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); TestingFunctions tf = new TestingFunctions(db.GetDB()); try { tf.DeleteSale("3", "121", "9"); } catch (Exception e) { } String[] sale = new String[] { "3", "121", "9", "4/10/2008", "34000" }; MakeSale sa = new MakeSale(sale, db.GetDB()); sa.CreateSale(); String s = st.MonthlySales("11", "2003"); Assert.IsTrue(int.Parse(s) == 0); tf.DeleteSale("3", "121", "9"); }
public void DeletePart_NormalPath() { DBConnection_Accessor connection = new DBConnection_Accessor(); SearchFunction_Accessor SF = new SearchFunction_Accessor(connection.GetDB()); DataTable dt = new DataTable(); Delete_Accessor d = new Delete_Accessor(connection.GetDB()); try { d.DeletePart(10); } catch (Exception e) { } String[] D = new String[] {"10", "3", "1", "1"}; MakePart_Accessor part = new MakePart_Accessor(D, connection.GetDB()); part.CreatePart(); d.DeletePart(10); try { dt = SF.SearchPart("10"); } catch (OleDbException ex) { throw ex; } Assert.IsTrue(dt.Rows.Count == 0); }
public void AddCustomerControl_createDuplicate() { DBConnection_Accessor db = new DBConnection_Accessor(); Delete_Accessor d = new Delete_Accessor(db.GetDB()); SearchFunction_Accessor sf = new SearchFunction_Accessor(db.GetDB()); AddCustomerControl_Accessor aec = new AddCustomerControl_Accessor(db.GetDB()); String[] D = new String[] { "10011", "Sean", "5555555555", "calgary", "M", "10011", "Customer" }; MakePerson_Accessor mp = new MakePerson_Accessor(D, db.GetDB()); try { d.DeletePerson(10011); } catch (Exception) { } aec.createCustomer(D); ErrorWindow ew = aec.createCustomer(D); DataTable dt = sf.SearchPersonID("10011"); Assert.IsTrue(dt.Rows.Count == 1); Assert.IsNotNull(ew); }
public void RevenueTest_DecimalSales() { DBConnection_Accessor db = new DBConnection_Accessor(); StatsCalc_Accessor st = new StatsCalc_Accessor(db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); TestingFunctions tf = new TestingFunctions(db.GetDB()); try { tf.DeleteSale("3", "121", "9"); tf.DeleteSale("7", "121", "9"); } catch (Exception) { } String[] sale = new String[] { "3", "121", "9", "3/3/3", "1200.3" }; MakeSale sa = new MakeSale(sale, db.GetDB()); sa.CreateSale(); String[] sale2 = new String[] { "7", "121", "9", "3/3/3", "1200.75" }; MakeSale sa2 = new MakeSale(sale2, db.GetDB()); sa2.CreateSale(); String s = st.Revenue(); Assert.IsTrue(double.Parse(s) == 2401.05); tf.DeleteSale("3", "121", "9"); tf.DeleteSale("7", "121", "9"); }
public void AddSale_CIDNonExistent() { DBConnection_Accessor db = new DBConnection_Accessor(); StatsCalc_Accessor st = new StatsCalc_Accessor(db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); TestingFunctions tf = new TestingFunctions(db.GetDB()); try { tf.DeleteSale("3", "121", "9"); } catch (Exception e) { } String[] sale = new String[] { "3", "99999", "9", "4/10/2008", "34000" }; MakeSale sa = new MakeSale(sale, db.GetDB()); sa.CreateSale(); try { tf.DeleteSale("3", "99999", "0"); } catch (Exception e) { } }
public void RevenueTest_OneSale() { DBConnection_Accessor db = new DBConnection_Accessor(); StatsCalc_Accessor st = new StatsCalc_Accessor(db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); TestingFunctions tf = new TestingFunctions(db.GetDB()); try { tf.DeleteSale("3", "121", "9"); } catch (Exception) { } String[] sale = new String[] { "3", "121", "9", "3/3/3", "1200" }; MakeSale sa = new MakeSale(sale, db.GetDB()); sa.CreateSale(); String s = st.Revenue(); Assert.IsTrue(int.Parse(s) == 1200); tf.DeleteSale("3", "121", "9"); }
public void RevenueTest_MultipleSales() { DBConnection_Accessor db = new DBConnection_Accessor(); StatsCalc_Accessor st = new StatsCalc_Accessor(db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); TestingFunctions tf = new TestingFunctions(db.GetDB()); try { tf.DeleteSale("3", "121", "9"); tf.DeleteSale("7", "121", "9"); } catch (Exception) { } String[] sale = new String[] { "3", "121", "9", "3/3/3", "1200" }; MakeSale sa = new MakeSale(sale, db.GetDB()); sa.CreateSale(); String[] sale2 = new String[] { "7", "121", "9", "3/3/3", "1200" }; MakeSale sa2 = new MakeSale(sale2, db.GetDB()); sa2.CreateSale(); String s = st.Revenue(); Assert.IsTrue(int.Parse(s) == 2400); tf.DeleteSale("3", "121", "9"); tf.DeleteSale("7", "121", "9"); }
public void AddEmployeeControl_negativeIDValue() { DBConnection_Accessor db = new DBConnection_Accessor(); Delete_Accessor d = new Delete_Accessor(db.GetDB()); SearchFunction_Accessor sf = new SearchFunction_Accessor(db.GetDB()); AddEmployeeControl_Accessor aec = new AddEmployeeControl_Accessor(db.GetDB()); try { d.DeletePerson(-500); } catch (Exception) { } String[] D = new String[] { "-500", "", "", "", "", "-500", "", "", "" }; ErrorWindow ew = aec.createEmployee(D); DataTable dt = null; try { dt = sf.SearchPersonID("abc"); } catch (Exception e) { }; Assert.IsTrue(dt.Rows.Count == 0); Assert.IsNotNull(ew); }
public void AddCustomerControl_badPhoneNumber() { DBConnection_Accessor db = new DBConnection_Accessor(); Delete_Accessor d = new Delete_Accessor(db.GetDB()); SearchFunction_Accessor sf = new SearchFunction_Accessor(db.GetDB()); AddCustomerControl_Accessor aec = new AddCustomerControl_Accessor(db.GetDB()); String[] D = new String[] { "10011", "Sean", "5555555555", "calgary", "M", "10011", "Customer" }; MakePerson_Accessor mp = new MakePerson_Accessor(D, db.GetDB()); try { d.DeletePerson(10011); } catch (Exception) { } ErrorWindow ew = aec.createCustomer(D); DataTable dt = null; try { dt = sf.SearchPersonID("10011"); } catch (Exception e) { }; Assert.IsTrue(dt.Rows.Count == 0); Assert.IsNotNull(ew); }
public void AddSale_EIDNonExistent() { DBConnection_Accessor db = new DBConnection_Accessor(); StatsCalc_Accessor st = new StatsCalc_Accessor(db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); TestingFunctions tf = new TestingFunctions(db.GetDB()); try { tf.DeleteSale("3", "121", "99999"); } catch (Exception e) { } String[] sale = new String[] { "3", "121", "99999", "4/10/2008", "34000" }; MakeSale sa = new MakeSale(sale, db.GetDB()); sa.CreateSale(); try { tf.DeleteSale("3", "121", "99999"); } catch (Exception e) { } }
public void DeletePerson_NormalPath() { DBConnection_Accessor connection = new DBConnection_Accessor(); SearchFunction_Accessor SF = new SearchFunction_Accessor(connection.GetDB()); DataTable dt = new DataTable(); Delete_Accessor d = new Delete_Accessor(connection.GetDB()); try { d.DeletePerson(1005); } catch (Exception e) { } String[] p = new String[] {"1005", "1", "1123123123", "1", "M"}; MakePerson_Accessor pers = new MakePerson_Accessor(p, connection.GetDB()); pers.CreatePerson(); MakeEmployee_Accessor person = new MakeEmployee_Accessor("1005", "1234", "3/3/3", "", connection.GetDB()); person.CreateEmployee(); d.DeletePerson(1005); try { dt = SF.SearchPersonID("1005"); } catch (OleDbException ex) { throw ex; } Assert.IsTrue(dt.Rows.Count == 0); }
public void DeletePart_NormalPath() { DBConnection_Accessor connection = new DBConnection_Accessor(); SearchFunction_Accessor SF = new SearchFunction_Accessor(connection.GetDB()); DataTable dt = new DataTable(); Delete_Accessor d = new Delete_Accessor(connection.GetDB()); try { d.DeletePart(10); } catch (Exception e) { } String[] D = new String[] { "10", "3", "1", "1" }; MakePart_Accessor part = new MakePart_Accessor(D, connection.GetDB()); part.CreatePart(); d.DeletePart(10); try { dt = SF.SearchPart("10"); } catch (OleDbException ex) { throw ex; } Assert.IsTrue(dt.Rows.Count == 0); }
public void AddCustomerControl_constructor() { DBConnection_Accessor db = new DBConnection_Accessor(); Delete_Accessor d = new Delete_Accessor(db.GetDB()); AddCustomerControl_Accessor acc = new AddCustomerControl_Accessor(db.GetDB()); Assert.IsNotNull(acc); }
public void AddEmployeeControl_constructor() { DBConnection_Accessor db = new DBConnection_Accessor(); Delete_Accessor d = new Delete_Accessor(db.GetDB()); AddEmployeeControl_Accessor aec = new AddEmployeeControl_Accessor(db.GetDB()); Assert.IsNotNull(aec); }
public void AddSale_NullVIN() { DBConnection_Accessor db = new DBConnection_Accessor(); StatsCalc_Accessor st = new StatsCalc_Accessor(db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); TestingFunctions tf = new TestingFunctions(db.GetDB()); String[] sale = new String[] { "", "121", "9", "4/10/2008", "34000" }; MakeSale sa = new MakeSale(sale, db.GetDB()); sa.CreateSale(); }
public void AddPart_NullID() { DBConnection_Accessor db = new DBConnection_Accessor(); String[] D = new String[] { "", "", "", "", "", "" }; MakePart_Accessor mc = new MakePart_Accessor(D, db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); MakeVehicle_Accessor mp = new MakeVehicle_Accessor(D, db.GetDB()); mc.CreatePart(); }
public void DeleteVehicle_ExistsInSale() { DBConnection_Accessor connection = new DBConnection_Accessor(); Delete_Accessor d = new Delete_Accessor(connection.GetDB()); TestingFunctions tf = new TestingFunctions(connection.GetDB()); try { tf.DeleteSale("112", "121", "9"); } catch (Exception e) { } try { d.DeleteVehicle(112); } catch (Exception e) { } String[] D = new String[] { "112", "1", "1", "1", "1", "1" }; MakeVehicle_Accessor veh = new MakeVehicle_Accessor(D, connection.GetDB()); veh.CreateVehicle(); MakeCar_Accessor car = new MakeCar_Accessor("112", "smart car", connection.GetDB()); car.CreateCar(); String[] sale = new String[] { "112", "121", "9", "4/10/2008", "34000" }; MakeSale sa = new MakeSale(sale, connection.GetDB()); sa.CreateSale(); try { d.DeleteVehicle(112); } catch (Exception ex) { try { tf.DeleteSale("112", "121", "9"); } catch (Exception e) { } throw ex; } }
public void AddTruck_NullID() { DBConnection_Accessor db = new DBConnection_Accessor(); MakeTruck_Accessor mc = new MakeTruck_Accessor("", "", db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); String[] D = new String[] { "", "", "", "", "", "" }; MakeVehicle_Accessor mp = new MakeVehicle_Accessor(D, db.GetDB()); mp.CreateVehicle(); mc.CreateTruck(); }
public void AddEmployee_NullID() { DBConnection_Accessor db = new DBConnection_Accessor(); MakeEmployee_Accessor mc = new MakeEmployee_Accessor("", "", "", "", db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); String[] D = new String[] { "", "", "", "", "" }; MakePerson_Accessor mp = new MakePerson_Accessor(D, db.GetDB()); mp.CreatePerson(); mc.CreateEmployee(); }
public void DeleteVehicle_NonExistent() { DBConnection_Accessor connection = new DBConnection_Accessor(); Delete_Accessor d = new Delete_Accessor(connection.GetDB()); try { d.DeleteVehicle(23452345); } catch (OleDbException ex) { throw ex; } }
public void DeleteVehicle_Empty() { DBConnection_Accessor connection = new DBConnection_Accessor(); Delete_Accessor d = new Delete_Accessor(connection.GetDB()); try { d.DeleteVehicle(new int()); } catch (OleDbException ex) { throw ex; } }
public void DeletePart_NonExistent() { DBConnection_Accessor connection = new DBConnection_Accessor(); Delete_Accessor d = new Delete_Accessor(connection.GetDB()); try { d.DeletePart(10); } catch (OleDbException ex) { throw ex; } }
public void AddTires_DeleteInstance() { DBConnection_Accessor db = new DBConnection_Accessor(); MakeTires_Accessor mc = new MakeTires_Accessor("1", "", "", db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); String[] D = new String[] { "1", "", "", "", "", "" }; MakePart_Accessor mp = new MakePart_Accessor(D, db.GetDB()); try { d.DeletePart(1); } catch (Exception) { } mp.CreatePart(); mc.CreateTires(); SearchFunction_Accessor SF = new SearchFunction_Accessor(db.GetDB()); DataTable dt1 = new DataTable(); DataTable dt2 = new DataTable(); try { dt2 = SF.SearchPart("1"); } catch (OleDbException ex) { throw ex; } mc.DeleteTires(); mp.DeletePart(); try { dt1 = SF.SearchPart("1"); } catch (OleDbException ex) { throw ex; } Assert.IsTrue(dt1.Rows.Count == 0 && dt2.Rows.Count == 1); }
public void AddEmployee_DeleteInstance() { DBConnection_Accessor db = new DBConnection_Accessor(); MakeEmployee_Accessor mc = new MakeEmployee_Accessor("21113", "", "", "", db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); String[] D = new String[] { "21113", "", "", "", "", "" }; MakePerson_Accessor mp = new MakePerson_Accessor(D, db.GetDB()); try { d.DeletePerson(21113); } catch (Exception) { } mp.CreatePerson(); mc.CreateEmployee(); SearchFunction_Accessor SF = new SearchFunction_Accessor(db.GetDB()); DataTable dt1 = new DataTable(); DataTable dt2 = new DataTable(); try { dt2 = SF.SearchPersonID("21113"); } catch (OleDbException ex) { throw ex; } mc.DeleteEmployee(); mp.DeletePerson(); try { dt1 = SF.SearchPersonID("21113"); } catch (OleDbException ex) { throw ex; } Assert.IsTrue(dt1.Rows.Count == 0 && dt2.Rows.Count == 1); }
public void AddEngine_DeleteInstance() { DBConnection_Accessor db = new DBConnection_Accessor(); MakeEngine_Accessor mc = new MakeEngine_Accessor("1", "", "", db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); String[] D = new String[] { "1", "", "", "", "", "" }; MakePart_Accessor mp = new MakePart_Accessor(D, db.GetDB()); try { d.DeletePart(1); } catch (Exception) { } mp.CreatePart(); mc.CreateEngine(); SearchFunction_Accessor SF = new SearchFunction_Accessor(db.GetDB()); DataTable dt1 = new DataTable(); DataTable dt2 = new DataTable(); try { dt2 = SF.SearchPart("1"); } catch (OleDbException ex) { throw ex; } mc.DeleteEngine(); mp.DeletePart(); try { dt1 = SF.SearchPart("1"); } catch (OleDbException ex) { throw ex; } Assert.IsTrue(dt1.Rows.Count == 0 && dt2.Rows.Count == 1); }
public void AddTires_NormalPath() { DBConnection_Accessor db = new DBConnection_Accessor(); String[] D = new String[] { "1", "22", "Name", "Man", "", "" }; MakePart_Accessor mc = new MakePart_Accessor(D, db.GetDB()); MakeTires_Accessor me = new MakeTires_Accessor("1", "Winter", "50", db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); try { d.DeletePart(1); } catch (Exception) { } mc.CreatePart(); me.CreateTires(); }
public void AddPart_NormalPath() { DBConnection_Accessor db = new DBConnection_Accessor(); String[] D = new String[] { "1", "22", "123", "123", "123", "123" }; MakePart_Accessor mc = new MakePart_Accessor(D, db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); MakeVehicle_Accessor mp = new MakeVehicle_Accessor(D, db.GetDB()); try { d.DeletePart(1); } catch (Exception) { } mc.CreatePart(); }
public void AddCustomer_BadIDFormat() { DBConnection_Accessor db = new DBConnection_Accessor(); MakeCustomer_Accessor mc = new MakeCustomer_Accessor("abc", "", db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); String[] D = new String[] { "abc", "", "", "", "" }; MakePerson_Accessor mp = new MakePerson_Accessor(D, db.GetDB()); try { d.DeletePerson(1); } catch (Exception) { } mp.CreatePerson(); mc.CreateCustomer(); }
public void AddPart_NegativeID() { DBConnection_Accessor db = new DBConnection_Accessor(); String[] D = new String[] { "-5", "22", "", "", "", "" }; MakePart_Accessor mc = new MakePart_Accessor(D, db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); MakeVehicle_Accessor mp = new MakeVehicle_Accessor(D, db.GetDB()); try { d.DeletePart(-5); } catch (Exception) { } mc.CreatePart(); }
public void AddEmployee_BadManIDFormat() { DBConnection_Accessor db = new DBConnection_Accessor(); MakeEmployee_Accessor mc = new MakeEmployee_Accessor("1114", "", "", "abc", db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); String[] D = new String[] { "1114", "", "", "", "" }; MakePerson_Accessor mp = new MakePerson_Accessor(D, db.GetDB()); try { d.DeletePerson(1114); } catch (Exception) { } mp.CreatePerson(); mc.CreateEmployee(); }
public void AddCustomerControl_badIDValue() { DBConnection_Accessor db = new DBConnection_Accessor(); Delete_Accessor d = new Delete_Accessor(db.GetDB()); SearchFunction_Accessor sf = new SearchFunction_Accessor(db.GetDB()); AddCustomerControl_Accessor aec = new AddCustomerControl_Accessor(db.GetDB()); String[] D = new String[] { "abc", "", "", "", "", "abc", "Customer" }; ErrorWindow ew = aec.createCustomer(D); DataTable dt = null; try { dt = sf.SearchPersonID("abc"); } catch (Exception e) { }; Assert.IsTrue(dt.Rows.Count == 0); Assert.IsNotNull(ew); }
public void DeleteVehicle_ExistsInPart() { DBConnection_Accessor connection = new DBConnection_Accessor(); Delete_Accessor d = new Delete_Accessor(connection.GetDB()); try { d.DeletePart(1); } catch (Exception) { } try { d.DeleteVehicle(111); } catch (Exception e) { } String[] D = new String[] { "111", "1", "1", "1", "1", "1" }; MakeVehicle_Accessor veh = new MakeVehicle_Accessor(D, connection.GetDB()); veh.CreateVehicle(); MakeCar_Accessor car = new MakeCar_Accessor("111", "smart car", connection.GetDB()); car.CreateCar(); String[] D2 = new String[] { "1", "111", "", "", "", "" }; MakePart_Accessor mc = new MakePart_Accessor(D2, connection.GetDB()); mc.CreatePart(); try { d.DeleteVehicle(111); } catch (OleDbException ex) { throw ex; } }
public void AddEmployee_OverFlowSalary() { DBConnection_Accessor db = new DBConnection_Accessor(); MakeEmployee_Accessor mc = new MakeEmployee_Accessor("1113", "10000000", "", "", db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); String[] D = new String[] { "1113", "", "", "", "" }; MakePerson_Accessor mp = new MakePerson_Accessor(D, db.GetDB()); try { d.DeletePerson(1113); } catch (Exception) { } mp.CreatePerson(); mc.CreateEmployee(); }
public void AddEmployee_BadPhoneChars() { DBConnection_Accessor db = new DBConnection_Accessor(); MakeEmployee_Accessor mc = new MakeEmployee_Accessor("1113", "", "", "", db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); String[] D = new String[] { "1113", "", "123456789b", "", "" }; MakePerson_Accessor mp = new MakePerson_Accessor(D, db.GetDB()); try { d.DeletePerson(1113); } catch (Exception) { } mp.CreatePerson(); mc.CreateEmployee(); }
public void AddEmployee_NegativeID() { DBConnection_Accessor db = new DBConnection_Accessor(); MakeEmployee_Accessor mc = new MakeEmployee_Accessor("-5", "", "", "", db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); String[] D = new String[] { "-5", "", "", "", "" }; MakePerson_Accessor mp = new MakePerson_Accessor(D, db.GetDB()); try { d.DeletePerson(-5); } catch (Exception) { } mp.CreatePerson(); mc.CreateEmployee(); }
public void AddCustomer_OnlyID() { DBConnection_Accessor db = new DBConnection_Accessor(); MakeCustomer_Accessor mc = new MakeCustomer_Accessor("1", "", db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); String[] D = new String[] { "1", "", "", "", "" }; MakePerson_Accessor mp = new MakePerson_Accessor(D, db.GetDB()); try { d.DeletePerson(1); } catch (Exception) { } mp.CreatePerson(); mc.CreateCustomer(); }
public void AddEngine_Empty() { DBConnection_Accessor db = new DBConnection_Accessor(); String[] D = new String[] { "2", "", "", "", "", "" }; MakePart_Accessor mc = new MakePart_Accessor(D, db.GetDB()); MakeEngine_Accessor me = new MakeEngine_Accessor("2", "", "", db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); MakeVehicle_Accessor mp = new MakeVehicle_Accessor(D, db.GetDB()); try { d.DeletePart(2); } catch (Exception) { } mc.CreatePart(); me.CreateEngine(); }
public void AddEmployee_NormalPath() { DBConnection_Accessor db = new DBConnection_Accessor(); MakeEmployee_Accessor mc = new MakeEmployee_Accessor("1", "123", "1/1/1", "", db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); String[] D = new String[] { "1", "Sean", "5555555555", "calgary", "M" }; MakePerson_Accessor mp = new MakePerson_Accessor(D, db.GetDB()); try { d.DeletePerson(1); } catch (Exception) { } mp.CreatePerson(); mc.CreateEmployee(); }
public void AddTruck_DuplicateID() { DBConnection_Accessor db = new DBConnection_Accessor(); MakeTruck_Accessor mc = new MakeTruck_Accessor("1", "1", db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); String[] D = new String[] { "1", "123", "123", "123", "123", "123" }; MakeVehicle_Accessor mp = new MakeVehicle_Accessor(D, db.GetDB()); try { d.DeleteVehicle(1); } catch (Exception) { } mp.CreateVehicle(); mc.CreateTruck(); mp.CreateVehicle(); mc.CreateTruck(); }
public void MonthlySales_OneSale() { DBConnection_Accessor db = new DBConnection_Accessor(); StatsCalc_Accessor st = new StatsCalc_Accessor(db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); TestingFunctions tf = new TestingFunctions(db.GetDB()); try { tf.DeleteSale("3", "121", "9"); } catch (Exception e) { } String[] sale = new String[] { "3", "121", "9", "4/10/2008", "34000" }; MakeSale sa = new MakeSale(sale, db.GetDB()); sa.CreateSale(); String s = st.MonthlySales("4", "2008"); Assert.IsTrue(int.Parse(s) == 34000); tf.DeleteSale("3", "121", "9"); }
public void DeleteVehicle_NormalPath() { DBConnection_Accessor connection = new DBConnection_Accessor(); SearchFunction_Accessor SF = new SearchFunction_Accessor(connection.GetDB()); DataTable dt = new DataTable(); Delete_Accessor d = new Delete_Accessor(connection.GetDB()); try { d.DeleteVehicle(1); } catch (Exception e) { } String[] D = new String[] { "1", "1", "1", "1", "1", "1" }; MakeVehicle_Accessor veh = new MakeVehicle_Accessor(D, connection.GetDB()); veh.CreateVehicle(); MakeCar_Accessor car = new MakeCar_Accessor("1", "smart car", connection.GetDB()); car.CreateCar(); d.DeleteVehicle(1); try { dt = SF.SearchVehicle("1"); } catch (OleDbException ex) { throw ex; } Assert.IsTrue(dt.Rows.Count == 0); }
public void AddEngine_NormalPath() { DBConnection_Accessor db = new DBConnection_Accessor(); String[] D = new String[] { "1", "22", "Name", "Man", "", "" }; MakePart_Accessor mc = new MakePart_Accessor(D, db.GetDB()); MakeEngine_Accessor me = new MakeEngine_Accessor("1", "350", "6", db.GetDB()); Delete_Accessor d = new Delete_Accessor(db.GetDB()); try { d.DeletePart(1); } catch (Exception) { } mc.CreatePart(); me.CreateEngine(); }