public void Add(TestCycle cycle, Exception exception) { var testException = exception as TestCycleExceptions; if (testException != null) { Add(testException); return; } //Unwrap Target invocation Exceptions if possible if (exception is TargetInvocationException) { exception = exception.InnerException ?? exception; } switch (cycle) { case TestCycle.Setup: Setup.Add(exception); break; case TestCycle.Test: Test.Add(exception); break; case TestCycle.Teardown: Teardown.Add(exception); break; } }
public static Setup ToSetup(this KeyValueConfigurationCollection config) { var result = new Setup(); foreach (KeyValueConfigurationElement el in config) { result.Add(el.Key, el.Value); } return result; }
public void Add(TestCycleExceptions exceptions) { foreach (var ex in exceptions.Setup) { Setup.Add(ex); } foreach (var ex in exceptions.Test) { Test.Add(ex); } foreach (var ex in exceptions.Teardown) { Teardown.Add(ex); } }
public void AddSetup(ICardTransformer trans) { Setup.Add(trans); }