2011-11-21 50 views
0

MSpec大師,爲什麼不工作?爲什麼這會在ReSharper測試運行器中顯示出MSpec行爲?

public class with_command_line_args { 
    protected const string ValidFilename = "ValidFilename.txt"; 
    protected const string InvalidFilename = "Invalid:Filename"; 
    protected static string[] Args; 
    protected static Exception Exception; 
} 

[Behaviors] 
public class InvalidCommandlineArgsBehaviours 
{ 
    protected static Exception Exception; 
    It should_throw=() => Exception.ShouldNotBeNull(); 
    //It should_not_store_any_filename; 
} 

[Subject(typeof(Program), "Invalid command line parameter")] 
public class when_invoked_with_no_parameters : with_command_line_args 
{ 
    Establish context =() => Args = new string[] {}; 
    Because of =() => Exception = Catch.Exception(() => Program.ProcessCommandLineArgs(Args)); 
    Behaves_like<InvalidCommandlineArgsBehaviours> invalid_args; 
} 

,當我在ReSharper的運行它,規格顯示出來,但不執行(我也不能對它進行調試):
ReSharper Unit Test Runner output
奇怪的是,被註釋掉的規格在ReSharper的顯示出來輸出。嗯?顯然我沒有做正確的事,請賜教!

回答

1

啊,這一定是一個奇怪的ReSharper的東西。退出Visual Studio並重新運行上下文後,它按預期工作。 ReSharper test Runner output

0

這對我來說是一個不變的問題。有時重新啓動Visual Studio可以解決它。有時重命名行爲。有時只是在行爲中評論測試,然後逐個重新啓用測試! 我試過升級Machine.Specifications ReSharper插件無濟於事。

現在我有一個問題,我不能去在R#測試運行可靠地運行,不管我怎麼努力...

我真的很感激任何幫助提供!

ReSharper的6.1.1000.82 Machine.Specifications 0.5.6 Visual Studio 2010中

相關問題