예제 #1
0
 public void Modulus10_WhenStringHasInvalidLength_ThrowsException(string chars)
 {
     // Arrange
     // Act
     // Assert
     Assert.That(() => CalcUtility.CheckDigitForIsbn13(chars), Throws.InstanceOf <ArgumentException>());
 }
예제 #2
0
        public char Modulus10_WhenStringHasValidLength_ReturnsCheckDigit(string chars)
        {
            // Arrange
            var digits = Regex.Replace(chars, "[^0-9]+", string.Empty).Take(12);

            // Act
            // Assert
            return(CalcUtility.CheckDigitForIsbn13(digits));
        }