public void TestScriptWarnings() { var f = new Routine("dbo", "udf_GetDate2", null) { Text = ExampleFunc, RoutineType = Routine.RoutineKind.Function }; Assert.IsTrue(f.Warnings().Any()); }
public void TestScriptWarnings() { const string baseText = @"--example of routine that has been renamed since creation CREATE PROCEDURE {0} @id int AS select * from Address where id = @id "; var getAddress = new Routine("dbo", "GetAddress", null); getAddress.RoutineType = Routine.RoutineKind.Procedure; getAddress.Text = string.Format(baseText, "[dbo].[NamedDifferently]"); Assert.IsTrue(getAddress.Warnings().Any()); getAddress.Text = string.Format(baseText, "dbo.NamedDifferently"); Assert.IsTrue(getAddress.Warnings().Any()); getAddress.Text = string.Format(baseText, "dbo.[GetAddress]"); Assert.IsFalse(getAddress.Warnings().Any()); getAddress.Text = string.Format(baseText, "dbo.GetAddress"); Assert.IsFalse(getAddress.Warnings().Any()); getAddress.Text = string.Format(baseText, "GetAddress"); Assert.IsFalse(getAddress.Warnings().Any()); }