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 出力に表示されます。え?明らかに私は正しいことをしていません。教えてください!