本文整理汇总了C#中DBConnection_Accessor类的典型用法代码示例。如果您正苦于以下问题:C# DBConnection_Accessor类的具体用法?C# DBConnection_Accessor怎么用?C# DBConnection_Accessor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DBConnection_Accessor类属于命名空间,在下文中一共展示了DBConnection_Accessor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SearchName_NonExistent
public void SearchName_NonExistent()
{
//Person array = id, name, phone no, address, sex
DBConnection_Accessor connection = new DBConnection_Accessor();
SearchFunction_Accessor SF = new SearchFunction_Accessor(connection.GetDB());
DataTable dt = new DataTable();
//String[] p = new String[] { "1", "1", "1", "1", "1" };
//MakePerson_Accessor Person = new MakePerson_Accessor(p, connection.GetDB());
//Person.DeletePerson();
//Person.CreatePerson();
try
{
dt = SF.SearchPersonName("dyrone tonkson");
}
catch (OleDbException ex)
{
throw ex;
}
Assert.IsTrue(dt.Rows.Count == 0);
//Person.DeletePerson();
}
示例2: MonthlySales_NoSalesValidMonth
public void MonthlySales_NoSalesValidMonth()
{
DBConnection_Accessor db = new DBConnection_Accessor();
StatsCalc_Accessor st = new StatsCalc_Accessor(db.GetDB());
string s = st.MonthlySales("1", "2001");
Assert.IsTrue(int.Parse(s) == 0);
}
示例3: AddSale_EIDNonExistent
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)
{
}
}
示例4: DeletePart_NormalPath
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);
}
示例5: EmployeeProgress_NormalPath
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");
}
示例6: RevenueTest_MultipleSales
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");
}
示例7: AddCustomerControl_badPhoneNumber
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);
}
示例8: SearchID_NormalPath
public void SearchID_NormalPath()
{
//Person array = id, name, phone no, address, sex
DBConnection_Accessor connection = new DBConnection_Accessor();
SearchFunction_Accessor SF = new SearchFunction_Accessor(connection.GetDB());
DataTable dt = new DataTable();
//String[] p = new String[] {"1", "1", "1", "1", "1"};
/*
MakePerson_Accessor Person = new MakePerson_Accessor(p, connection.GetDB());
Person.DeletePerson();
Person.CreatePerson();
*/
try
{
dt = SF.SearchPersonID("3");
}
catch (OleDbException ex)
{
throw ex;
}
Assert.IsTrue(dt.Rows.Count == 1);
//Person.DeletePerson();
}
示例9: DeletePerson_NormalPath
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);
}
示例10: AddCustomerControl_constructor
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);
}
示例11: VehicleParts_NoVehicle
public void VehicleParts_NoVehicle()
{
DBConnection_Accessor db = new DBConnection_Accessor();
StatsCalc_Accessor st = new StatsCalc_Accessor(db.GetDB());
DataTable dt = st.VehicleParts("2");
Assert.IsTrue(dt.Rows.Count == 0);
}
示例12: EmployeeProgress_NoSales
public void EmployeeProgress_NoSales()
{
DBConnection_Accessor db = new DBConnection_Accessor();
StatsCalc_Accessor st = new StatsCalc_Accessor(db.GetDB());
DataTable dt = st.CalculateProgress();
Assert.IsTrue(dt.Rows.Count == 0);
}
示例13: GUIAddCarTest_NormalPath
public void GUIAddCarTest_NormalPath()
{
// To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
// For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463
UIMap.GUIAddCar_NormalPath();
DBConnection_Accessor db = new DBConnection_Accessor();
SearchFunction_Accessor sc = new SearchFunction_Accessor(db.GetDB());
DataTable dt = sc.SearchVehicle("55555");
int expected = 1;
int actual = dt.Rows.Count;
Assert.AreEqual(expected, actual);
}
示例14: TruckInventory_NormalPath
public void TruckInventory_NormalPath()
{
DBConnection_Accessor db = new DBConnection_Accessor();
StatsCalc_Accessor st = new StatsCalc_Accessor(db.GetDB());
DataTable dt = new DataTable();
dt = st.TrucksInventory();
DataColumn[] dc = new DataColumn[] { dt.Columns[0] };
dt.PrimaryKey = dc;
Assert.IsTrue(dt.Rows.Contains("5"));
}
示例15: CarInventory_Sold
public void CarInventory_Sold()
{
DBConnection_Accessor db = new DBConnection_Accessor();
StatsCalc_Accessor st = new StatsCalc_Accessor(db.GetDB());
DataTable dt = new DataTable();
dt = st.CarsInventory();
DataColumn[] dc = new DataColumn[] { dt.Columns[0] };
dt.PrimaryKey = dc;
Assert.IsFalse(dt.Rows.Contains("12345"));
}