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 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(); }
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(); }