コード例 #1
0
 protected override IEnumerable <ITestCommand> EnumerateTestCommands(MethodInfo method)
 {
     try
     {
         object obj = Activator.CreateInstance(method.ReflectedType);
         method.Invoke(obj, null);
         return(SpecificationContext.ToTestCommands(method));
     }
     catch (Exception ex)
     {
         return(new ITestCommand[] { new ExceptionTestCommand(method, ex) });
     }
 }
コード例 #2
0
 public static void When(this string message, Action act)
 {
     Console.Write(">>> " + message);
     SpecificationContext.Do(message, act);
 }
コード例 #3
0
 public static void Then(this string message, Action assert)
 {
     Console.WriteLine(": " + message);
     SpecificationContext.Assert(message, assert);
 }
コード例 #4
0
 public static void Given(this string message, Action arrange)
 {
     Console.WriteLine(message);
     SpecificationContext.Context(message, arrange);
 }