public void FibUlongValidation(int n, long expectedResult) { var handler = new FibLongCommandHandler(); var result = handler.ExecuteAsync(new FibLongCommand { N = n }, 0).GetAwaiter().GetResult(); result.ShouldBe(expectedResult); }
public void FibLongOverflowsSafely() { const int shouldCauseNumericOverflow = 93; var handler = new FibLongCommandHandler(); Should.Throw <OverflowException>(() => handler.ExecuteAsync(new FibLongCommand { N = shouldCauseNumericOverflow }, 0).GetAwaiter().GetResult()); }