public void CheckIsbnTest_Condition4() { var checkDigit = new CheckDigit(); string returned = CheckDigit.CheckIsbn("978037428158"); Assert.AreEqual("0374281580", returned); }
public void CheckIsbnTest_Condition3() { var checkDigit = new CheckDigit(); string returned = CheckDigit.CheckIsbn("978037541457"); Assert.AreEqual("0375414576", returned); }
public void CheckIsbnTest_Condition2() { var checkDigit = new CheckDigit(); string returned = CheckDigit.CheckIsbn("978140007917"); Assert.AreEqual("1400079179", returned); }
public void CheckIsbnTest_Condition1() { var checkDigit = new CheckDigit(); string returned = CheckDigit.CheckIsbn("978155192370"); Assert.AreEqual("155192370x", returned); }
static void Main(string[] args) { isbn myFavoriteBook = new isbn(); bool isValid = CheckDigit.CheckIsbn(myFavoriteBook.GetIsbn()); Console.WriteLine(string.Format("Your book {0} a valid ISBN", isValid ? "has" : "doesn't have")); Console.ReadLine(); }
static void Main(string[] args) { //create a new instance of the ISBN/book class. you're prompted as part //of the constructor. isbn myFavoriteBook = new isbn(); //new class contains the method for checking validity bool isValid = CheckDigit.CheckIsbn(myFavoriteBook.GetIsbn()); //write out the results of the validity. Console.WriteLine(string.Format("Your book {0} a valid ISBN", isValid ? "has" : "doesn't have")); Console.ReadLine(); }