public void CreateOleDbConnection() { IDataService service = new OleDbDataService(); IDbConnection connection = service.CreateConnection(OleDbConnection); Assert.IsNotNull(connection); Assert.IsInstanceOfType(connection, typeof(OleDbConnection)); Assert.AreEqual(OleDbConnection, connection.ConnectionString); }
public void CreateOleDbSPCommand() { IDataService service = new OleDbDataService(); IDbConnection connection = service.CreateConnection(OleDbConnection); IDbCommand command = service.CreateSPCommand(SPName, connection); Assert.IsNotNull(command); Assert.IsInstanceOfType(command, typeof(OleDbCommand)); Assert.AreEqual(SPName, command.CommandText); Assert.AreEqual(CommandType.StoredProcedure, command.CommandType); }
public void CreateOleDbTextCommand() { IDataService service = new OleDbDataService(); IDbConnection connection = service.CreateConnection(OleDbConnection); IDbCommand command = service.CreateTextCommand(SelectText, connection); Assert.IsNotNull(command); Assert.IsInstanceOfType(command, typeof(OleDbCommand)); Assert.AreEqual(SelectText, command.CommandText); Assert.AreEqual(CommandType.Text, command.CommandType); }
public void CreateOleDbOutputParameter() { IDataService service = new OleDbDataService(); IDbConnection connection = service.CreateConnection(OleDbConnection); IDbDataParameter parameter = service.CreateOutputParameter("Id", 1); Assert.IsNotNull(parameter); Assert.IsInstanceOfType(parameter, typeof(OleDbParameter)); Assert.AreEqual("@Id", parameter.ParameterName); Assert.AreEqual(1, parameter.Value); Assert.AreEqual(ParameterDirection.Output, parameter.Direction); }