public void WhenIInputTheEnrollment(string enrollmentNumber) { var calculator = new CheckDigitCalculator(); try { _result = calculator.Calculate(enrollmentNumber); } catch (FormatException e) { _exception = e; } }
public void CheckDigitCalculator_TryNullString() { Assert.Throws <ArgumentNullException>(() => CheckDigitCalculator.Calculate(null)); }
[TestCase("AB2134", 5)] // Example Case public void CheckDidgitcalculator_ValidateInputString(string input, int expectedValue) { var output = CheckDigitCalculator.Calculate(input); Assert.AreEqual(expectedValue, output); }