diff --git a/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculation.feature.cs b/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculation.feature.cs index dab5e2507..7de45683c 100644 --- a/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculation.feature.cs +++ b/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculation.feature.cs @@ -23,7 +23,7 @@ public partial class ScoreCalculationFeature public static void FeatureSetup(Microsoft.VisualStudio.TestTools.UnitTesting.TestContext testContext) { testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo("Score Calculation", "In order to know my performance\r\nAs a player\r\nI want the system to calculate my t" + + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en"), "Score Calculation", "In order to know my performance\r\nAs a player\r\nI want the system to calculate my t" + "otal score", ((string[])(null))); testRunner.OnFeatureStart(featureInfo); } diff --git a/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculationAlternatives.feature.cs b/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculationAlternatives.feature.cs index 65f30a828..136351df9 100644 --- a/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculationAlternatives.feature.cs +++ b/Samples/BowlingKata - MsTest/Bowling.SpecFlow/ScoreCalculationAlternatives.feature.cs @@ -23,7 +23,7 @@ public partial class ScoreCalculationAlternativeFormsFeature public static void FeatureSetup(Microsoft.VisualStudio.TestTools.UnitTesting.TestContext testContext) { testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo("Score Calculation (alternative forms)", "In order to know my performance\r\nAs a player\r\nI want the system to calculate my t" + + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en"), "Score Calculation (alternative forms)", "In order to know my performance\r\nAs a player\r\nI want the system to calculate my t" + "otal score", ((string[])(null))); testRunner.OnFeatureStart(featureInfo); } diff --git a/Samples/BowlingKata/Bowling.Specflow/ScoreCalculation.feature.cs b/Samples/BowlingKata/Bowling.Specflow/ScoreCalculation.feature.cs index 4593ac729..dddea821b 100644 --- a/Samples/BowlingKata/Bowling.Specflow/ScoreCalculation.feature.cs +++ b/Samples/BowlingKata/Bowling.Specflow/ScoreCalculation.feature.cs @@ -24,7 +24,7 @@ public partial class ScoreCalculationFeature public virtual void FeatureSetup() { testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo("Score Calculation", "In order to know my performance\r\nAs a player\r\nI want the system to calculate my t" + + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en"), "Score Calculation", "In order to know my performance\r\nAs a player\r\nI want the system to calculate my t" + "otal score", ((string[])(null))); testRunner.OnFeatureStart(featureInfo); } diff --git a/Samples/BowlingKata/Bowling.Specflow/ScoreCalculationAlternatives.feature.cs b/Samples/BowlingKata/Bowling.Specflow/ScoreCalculationAlternatives.feature.cs index 6bdba29ab..ccc4024ab 100644 --- a/Samples/BowlingKata/Bowling.Specflow/ScoreCalculationAlternatives.feature.cs +++ b/Samples/BowlingKata/Bowling.Specflow/ScoreCalculationAlternatives.feature.cs @@ -24,7 +24,7 @@ public partial class ScoreCalculationAlternativeFormsFeature public virtual void FeatureSetup() { testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo("Score Calculation (alternative forms)", "In order to know my performance\r\nAs a player\r\nI want the system to calculate my t" + + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en"), "Score Calculation (alternative forms)", "In order to know my performance\r\nAs a player\r\nI want the system to calculate my t" + "otal score", ((string[])(null))); testRunner.OnFeatureStart(featureInfo); } diff --git a/VsIntegration/BaseCodeGenerator.cs b/VsIntegration/BaseCodeGenerator.cs index 5ae036922..38f18549f 100644 --- a/VsIntegration/BaseCodeGenerator.cs +++ b/VsIntegration/BaseCodeGenerator.cs @@ -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 @@ -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); diff --git a/changelog.txt b/changelog.txt index 13a6edd50..c47fd29f1 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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: