private void CreatetSQLtTest(object sender, EventArgs e) { try { var dte = (DTE) GetService(typeof (DTE)); if (dte.ActiveDocument == null) { return; } var doc = dte.ActiveDocument.Object("TextDocument") as TextDocument; if (null == doc) { return; } var ep = doc.StartPoint.CreateEditPoint(); ep.EndOfDocument(); var length = ep.AbsoluteCharOffset; ep.StartOfDocument(); var originalText = ep.GetText(length); var builder = new TestBuilder(originalText, dte.ActiveDocument.ProjectItem.ContainingProject); builder.Go(); // builder.CreateTests(); } catch (Exception ex) { OutputPane.WriteMessage("Exception creating tSQLt tests, error: {0}", ex.Message); } }
private void CreatetSQLtTest(object sender, EventArgs e) { var dte = (DTE) GetService(typeof (DTE)); if (dte.ActiveDocument == null) { return; } var doc = dte.ActiveDocument.Object("TextDocument") as TextDocument; if (null == doc) { return; } var ep = doc.StartPoint.CreateEditPoint(); ep.EndOfDocument(); var length = ep.AbsoluteCharOffset; ep.StartOfDocument(); var originalText = ep.GetText(length); var builder = new TestBuilder(originalText, dte.ActiveDocument.ProjectItem.ContainingProject); builder.Go(); // builder.CreateTests(); }