本文整理汇总了C#中DBConnection_Accessor类的典型用法代码示例。如果您正苦于以下问题:C# DBConnection_Accessor类的具体用法?C# DBConnection_Accessor怎么用?C# DBConnection_Accessor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DBConnection_Accessor类属于命名空间,在下文中一共展示了DBConnection_Accessor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:dmryan,项目名称:CPSC471-Project,代码行数:25,代码来源:SearchPersonNameTests.cs
示例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);
}
开发者ID:dmryan,项目名称:CPSC471-Project,代码行数:7,代码来源:MonthlySalesTests.cs
示例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)
{
}
}
开发者ID:dmryan,项目名称:CPSC471-Project,代码行数:26,代码来源:AddSaleTests.cs
示例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);
}
开发者ID:dmryan,项目名称:CPSC471-Project,代码行数:31,代码来源:DeletePartTests.cs
示例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");
}
开发者ID:dmryan,项目名称:CPSC471-Project,代码行数:25,代码来源:EmployeeSalesTests.cs
示例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");
}
开发者ID:dmryan,项目名称:CPSC471-Project,代码行数:31,代码来源:RevenueTests.cs
示例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);
}
开发者ID:dmryan,项目名称:CPSC471-Project,代码行数:29,代码来源:IntegrationTests.cs
示例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();
}
开发者ID:dmryan,项目名称:CPSC471-Project,代码行数:26,代码来源:SearchPersonIDTests.cs
示例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);
}
开发者ID:dmryan,项目名称:CPSC471-Project,代码行数:33,代码来源:DeletePersonTests.cs
示例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);
}
开发者ID:dmryan,项目名称:CPSC471-Project,代码行数:8,代码来源:IntegrationTests.cs
示例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);
}
开发者ID:dmryan,项目名称:CPSC471-Project,代码行数:8,代码来源:VehiclePartsTests.cs
示例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);
}
开发者ID:dmryan,项目名称:CPSC471-Project,代码行数:9,代码来源:EmployeeSalesTests.cs
示例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);
}
开发者ID:dmryan,项目名称:CPSC471-Project,代码行数:12,代码来源:GUIAddCarTests.cs
示例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"));
}
开发者ID:dmryan,项目名称:CPSC471-Project,代码行数:12,代码来源:TruckInventoryTests.cs
示例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"));
}
开发者ID:dmryan,项目名称:CPSC471-Project,代码行数:12,代码来源:CarInventoryTests.cs
示例16: MonthlySales_InvalidYear
public void MonthlySales_InvalidYear()
{
DBConnection_Accessor db = new DBConnection_Accessor();
StatsCalc_Accessor st = new StatsCalc_Accessor(db.GetDB());
try
{
String s = st.MonthlySales("3", "-39");
}
catch (ArgumentException ae)
{
throw ae;
}
}
开发者ID:dmryan,项目名称:CPSC471-Project,代码行数:13,代码来源:MonthlySalesTests.cs
示例17: DeleteVehicle_Empty
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;
}
}
开发者ID:dmryan,项目名称:CPSC471-Project,代码行数:15,代码来源:DeleteVehicleTests.cs
示例18: DeletePart_NonExistent
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;
}
}
开发者ID:dmryan,项目名称:CPSC471-Project,代码行数:15,代码来源:DeletePartTests.cs
示例19: SearchVehicle_EmptyID
public void SearchVehicle_EmptyID()
{
DBConnection_Accessor connection = new DBConnection_Accessor();
SearchFunction_Accessor SF = new SearchFunction_Accessor(connection.GetDB());
DataTable dt = new DataTable();
try
{
dt = SF.SearchVehicle("");
}
catch (OleDbException ex)
{
throw ex;
}
}
开发者ID:dmryan,项目名称:CPSC471-Project,代码行数:15,代码来源:SearchVehicleTests.cs
示例20: DeleteVehicle_ExistsInSale
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;
}
}
开发者ID:dmryan,项目名称:CPSC471-Project,代码行数:48,代码来源:DeleteVehicleTests.cs
注:本文中的DBConnection_Accessor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论