public void Modulus10_WhenStringHasInvalidLength_ThrowsException(string chars) { // Arrange // Act // Assert Assert.That(() => CalcUtility.CheckDigitForIsbn13(chars), Throws.InstanceOf <ArgumentException>()); }
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)); }