Skip to content

Commit

Permalink
MsTest does not refresh tests automatically (Issue 25)
Browse files Browse the repository at this point in the history
  • Loading branch information
gasparnagy committed Nov 19, 2009
1 parent 9b7b8d8 commit 82021c5
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 12 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 17 additions & 8 deletions VsIntegration/BaseCodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
using System.Text;
using System.Windows.Forms;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.OLE.Interop;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;

namespace TechTalk.SpecFlow.VsIntegration
Expand Down Expand Up @@ -71,21 +73,28 @@ int IVsSingleFileGenerator.Generate(string wszInputFilePath,
bytes = Encoding.UTF8.GetBytes(message);
}

// if (bytes == null)
// {
// // --- This signals that GenerateCode() has failed.
// rgbOutputFileContents = null;
// pcbOutput = 0;
// return VSConstants.E_FAIL;
// }

int outputLength = bytes.Length;
rgbOutputFileContents[0] = Marshal.AllocCoTaskMem(outputLength);
Marshal.Copy(bytes, 0, rgbOutputFileContents[0], outputLength);
pcbOutput = (uint)outputLength;

RefreshMsTestWindow();

return VSConstants.S_OK;
}

private void RefreshMsTestWindow()
{
//refreshCmdGuid,cmdID is the command id of refresh command.
Guid refreshCmdGuid = new Guid("{B85579AA-8BE0-4C4F-A850-90902B317571}");
IOleCommandTarget cmdTarget = Package.GetGlobalService(typeof(SUIHostCommandDispatcher)) as IOleCommandTarget;
const uint cmdID = 13109;
if (cmdTarget != null)
cmdTarget.Exec(ref refreshCmdGuid, cmdID,
(uint)OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER,
IntPtr.Zero, IntPtr.Zero);
}

protected virtual string GenerateError(IVsGeneratorProgress pGenerateProgress, Exception ex)
{
string message = GetMessage(ex);
Expand Down
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@

vNext - ???

New features:

Fixed issues:
+ MsTest does not refresh tests automatically (Issue 25)

1.1.0 - 2009/11/11

New features:
Expand Down

0 comments on commit 82021c5

Please sign in to comment.