public override TestResult Execute(T sut) { DateTime now = DateTime.Now; TestResultWithException <T, TException> result = new TestResultWithException <T, TException>(this, default(T), null, now, now); return(result); }
public override TestResult Execute(T instance) { TException caughtException = null; TResult result = default(TResult); DateTime end, start = DateTime.Now; try { result = Func(instance); end = DateTime.Now; } catch (TException ex) { end = DateTime.Now; caughtException = ex; } TestResultWithException <T, TException> testResult = new TestResultWithException <T, TException>(this, instance, caughtException, start, end); return(testResult); }
public override TestResult Execute(T instance) { TException caughtException = null; DateTime end, start = DateTime.Now; try { Action(instance); end = DateTime.Now; } catch (TException ex) { end = DateTime.Now; caughtException = ex; } bool success = caughtException != null; TestResultWithException <T, TException> testResult = new TestResultWithException <T, TException>(this, instance, caughtException, start, end); return(testResult); }