Esempio n. 1
0
 public void Modulus11_WhenStringHasInvalidLength_ThrowsException(string chars)
 {
     // Arrange
     // Act
     // Assert
     Assert.That(() => CalcUtility.CheckDigitForIsbn10(chars), Throws.InstanceOf <ArgumentException>());
 }
Esempio n. 2
0
        public char Modulus11_WhenStringHasValidLength_ReturnsCheckDigit(string chars)
        {
            // Arrange
            var digits = Regex.Replace(chars, "[^0-9]+", string.Empty).Take(9);

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