public void TestIsIssn() { var isIssn = ArticleNumberHelper.IsValidIssn(null); Assert.AreEqual(isIssn, false); isIssn = ArticleNumberHelper.IsValidIssn(string.Empty); Assert.AreEqual(isIssn, false); isIssn = ArticleNumberHelper.IsValidIssn("2229-5518"); Assert.AreEqual(isIssn, true); isIssn = ArticleNumberHelper.IsValidIssn("1365-201X"); Assert.AreEqual(isIssn, true); isIssn = ArticleNumberHelper.IsValidIssn("1911-1479"); Assert.AreEqual(isIssn, true); isIssn = ArticleNumberHelper.IsValidIssn("2049-3630"); Assert.AreEqual(isIssn, true); isIssn = ArticleNumberHelper.IsValidIssn("XXXX-0000"); Assert.AreEqual(isIssn, false); isIssn = ArticleNumberHelper.IsValidIssn("0000-000X"); Assert.AreEqual(isIssn, false); isIssn = ArticleNumberHelper.IsValidIssn("0000-00X0"); Assert.AreEqual(isIssn, false); }
public void IsValidIssn(bool expected, string input) { // Act var actual = ArticleNumberHelper.IsValidIssn(input); // Assert Assert.Equal(expected, actual); }