public void CreateProcedure(IConnectionManager connection) { //Arrange //Act CreateProcedureTask.CreateOrAlter(connection, "Proc1", "SELECT 1;"); //Assert IfProcedureExistsTask.IsExisting(connection, "Proc1"); }
public void AlterProcedure(IConnectionManager connection) { //Arrange CreateProcedureTask.CreateOrAlter(connection, "Proc2", "SELECT 1;"); Assert.True(IfProcedureExistsTask.IsExisting(connection, "Proc2")); //Act CreateProcedureTask.CreateOrAlter(connection, "Proc2", "SELECT 5;"); //Assert Assert.True(IfProcedureExistsTask.IsExisting(connection, "Proc2")); }
public void Drop(IConnectionManager connection) { //Arrange CreateProcedureTask.CreateOrAlter(connection, "DropProc1", "SELECT 1;"); Assert.True(IfProcedureExistsTask.IsExisting(connection, "DropProc1")); //Act DropProcedureTask.Drop(connection, "DropProc1"); //Assert Assert.False(IfProcedureExistsTask.IsExisting(connection, "DropProc1")); }
public void IfProcedureExists(IConnectionManager connection) { //Arrange var existsBefore = IfProcedureExistsTask.IsExisting(connection, "sp_test"); CreateProcedureTask.CreateOrAlter(connection, "sp_test", "SELECT 1;"); //Act var existsAfter = IfProcedureExistsTask.IsExisting(connection, "sp_test"); //Assert Assert.False(existsBefore); Assert.True(existsAfter); }
public void CreateProcedureWithParameter(IConnectionManager connection) { //Arrange List <ProcedureParameter> pars = new List <ProcedureParameter>() { new ProcedureParameter("Par1", "VARCHAR(10)"), new ProcedureParameter("Par2", "INT", "7"), }; //Act CreateProcedureTask.CreateOrAlter(connection, "Proc3", "SELECT 1;", pars); //Assert IfProcedureExistsTask.IsExisting(connection, "Proc3"); }
public void CreatProcedureWithProcedureObject(IConnectionManager connection) { //Arrange List <ProcedureParameter> pars = new List <ProcedureParameter>() { new ProcedureParameter("Par1", "varchar(10)"), new ProcedureParameter("Par2", "int", "7"), }; ProcedureDefinition procDef = new ProcedureDefinition("Proc4", "SELECT 1;", pars); //Act CreateProcedureTask.CreateOrAlter(connection, procDef); //Assert IfProcedureExistsTask.IsExisting(connection, "Proc4"); }