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的顯示出來輸出。嗯?顯然我沒有做正確的事,請賜教!