public void ExecuteAddsDurationToResult() { MethodInfo method = ((Action)TestClass.MethodWithMoyaAttribute).Method; timerDecorator = new TimerDecorator(new StressTestRunner()); var result = timerDecorator.Execute(method); Assert.True(result.Duration > 0); }
public void DecoratedTestRunnerRunsMethod() { timerDecorator = new TimerDecorator(testRunnerMock.Object); bool methodRun = false; MethodInfo method = ((Action)(() => methodRun = true)).Method; testRunnerMock .Setup(x => x.Execute(method)) .Callback(() => methodRun = true) .Returns(new TestResult()); timerDecorator.Execute(method); Assert.True(methodRun); }