public void DefaultSchemaNameParsedCorrectly() { var batchToParse = "exec DB1..ProcOne"; var procedures = BatchParser.GetExecutedProcedures(batchToParse); Assert.AreEqual(1, procedures.Count); }
public void AnEmptyStringReturnsNoProcedures() { var batchToParse = ""; var procedures = BatchParser.GetExecutedProcedures(batchToParse); Assert.AreEqual(0, procedures.Count); }
public void MultipleExecReturnsCorrectCount() { var batchToParse = "exec dbo.ProcOne exec dbo.ProcTwo"; var procedures = BatchParser.GetExecutedProcedures(batchToParse); Assert.AreEqual(2, procedures.Count); }
public void InvalidSQLReturnsNoProcedures() { var batchToParse = "this is not a valid pieceof SQL"; var procedures = BatchParser.GetExecutedProcedures(batchToParse); Assert.AreEqual(0, procedures.Count); }
public void ProcWithNoExecReturnsProcCount() { var batchToParse = "dbo.ProcOne;"; var procedures = BatchParser.GetExecutedProcedures(batchToParse); Assert.AreEqual(1, procedures.Count); }
public void ProcWithExecNoSchemaReturnsProcCount() { var batchToParse = "exec ProcOne;"; var procedures = BatchParser.GetExecutedProcedures(batchToParse); Assert.AreEqual(1, procedures.Count); }
public void BeginEndBlockCorrectlyHandled() { var batchToParse = @" begin exec dbo.ProcOne; end exec dbo.ProcTwo; "; var procedures = BatchParser.GetExecutedProcedures(batchToParse); Assert.AreEqual(2, procedures.Count); }