Exemple #1
0
 /// <summary>
 /// Returns true if ISBN is valid.
 /// </summary>
 /// <param name="value">The value of the object to validate.</param>
 /// <returns>
 /// true if the specified value is valid; otherwise, false.
 /// </returns>
 public override bool IsValid(object value)
 {
     return(IsbnHelper.IsValidIsbn(value?.ToString()));
 }
Exemple #2
0
 public void Right10DigitalIsbn_Valid()
 {
     Assert.IsTrue(IsbnHelper.IsValidIsbn("0-684-84328-5"));
     Assert.IsTrue(IsbnHelper.IsValidIsbn("0-9752298-0-X"));
 }
Exemple #3
0
 public void WrongIsbn_Invalid()
 {
     Assert.IsFalse(IsbnHelper.IsValidIsbn("978 - 1"));
     Assert.IsFalse(IsbnHelper.IsValidIsbn("0-684-8432-5"));
     Assert.IsFalse(IsbnHelper.IsValidIsbn("0-9752298-G-X"));
 }
Exemple #4
0
 public void Right13DigitalIsbn_Valid()
 {
     Assert.IsTrue(IsbnHelper.IsValidIsbn("978 - 1420955095"));
     Assert.IsTrue(IsbnHelper.IsValidIsbn("978-3-16-148410-0"));
 }