public void ShouldThrowIfGetAllNumbersReceivesIncorrectArgument() { var checker = new Mock <IPrimeChecker>(); var runner = new SequencialRunner(checker.Object); var topLimit = 1; runner.GetAllNumbers(topLimit); }
public void ShouldCalculatePrimeNumbers() { var checker = new PrimeSquareBasedMethod(); var runner = new SequencialRunner(checker); var topLimit = 100; var result = runner.GetAllNumbers(topLimit); Assert.AreEqual(25, result.Count()); }
public void ShouldCallChecker() { var checker = new Mock <IPrimeChecker>(); checker.Setup(x => x.IsPrime(It.IsAny <int>())); var runner = new SequencialRunner(checker.Object); var topLimit = 100; var result = runner.GetAllNumbers(topLimit); checker.Verify(x => x.IsPrime(It.IsAny <int>()), Times.AtMost(topLimit - 2)); }