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) }); } }
public static void When(this string message, Action act) { Console.Write(">>> " + message); SpecificationContext.Do(message, act); }
public static void Then(this string message, Action assert) { Console.WriteLine(": " + message); SpecificationContext.Assert(message, assert); }
public static void Given(this string message, Action arrange) { Console.WriteLine(message); SpecificationContext.Context(message, arrange); }