public void TestIsIsbn() { var isIsbn10 = ArticleNumberHelper.IsValidIsbn10(null); Assert.AreEqual(isIsbn10, false); isIsbn10 = ArticleNumberHelper.IsValidIsbn10(string.Empty); Assert.AreEqual(isIsbn10, false); isIsbn10 = ArticleNumberHelper.IsValidIsbn10("3551559015"); Assert.AreEqual(isIsbn10, true); var isIsbn13 = ArticleNumberHelper.IsValidIsbn13(null); Assert.AreEqual(isIsbn13, false); isIsbn13 = ArticleNumberHelper.IsValidIsbn13(string.Empty); Assert.AreEqual(isIsbn13, false); isIsbn13 = ArticleNumberHelper.IsValidIsbn13("978-3551559012"); Assert.AreEqual(isIsbn13, true); isIsbn13 = ArticleNumberHelper.IsValidIsbn13("9783551559012"); Assert.AreEqual(isIsbn13, true); }
public void IsValidIsbn10(bool expected, string input) { // Act var actual = ArticleNumberHelper.IsValidIsbn10(input); // Assert Assert.Equal(expected, actual); }