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 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 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 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 SearchPart_EmptySN() { DBConnection_Accessor connection = new DBConnection_Accessor(); SearchFunction_Accessor SF = new SearchFunction_Accessor(connection.GetDB()); DataTable dt = new DataTable(); try { dt = SF.SearchPart(""); } catch (OleDbException ex) { throw ex; } }
public void SearchPart_NonExistent() { DBConnection_Accessor connection = new DBConnection_Accessor(); SearchFunction_Accessor SF = new SearchFunction_Accessor(connection.GetDB()); DataTable dt = new DataTable(); try { dt = SF.SearchPart("56456452"); } catch (OleDbException ex) { throw ex; } Assert.IsTrue(dt.Rows.Count == 0); }
public void SearchPart_NormalPath() { DBConnection_Accessor connection = new DBConnection_Accessor(); SearchFunction_Accessor SF = new SearchFunction_Accessor(connection.GetDB()); DataTable dt = new DataTable(); try { dt = SF.SearchPart("6"); } catch (OleDbException ex) { throw ex; } Assert.IsTrue(dt.Rows.Count == 1); }