Esempio n. 1
0
        public void WhenIInputTheEnrollment(string enrollmentNumber)
        {
            var calculator = new CheckDigitCalculator();

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

            Assert.AreEqual(expectedValue, output);
        }