public void Validate_ISBN10_Checksum_validWithX() { string ISBN = "043942089X"; ISBNFinder sut = new ISBNFinder(); Assert.True(sut.checkISBN10(ISBN)); }
public void Validate_ISBN10_Checksum_invalid() { string ISBN = "0134757590"; ISBNFinder sut = new ISBNFinder(); Assert.False(sut.checkISBN10(ISBN)); }
public void Validate_ISBN10_Checksum() { string ISBN = "0134757599"; ISBNFinder sut = new ISBNFinder(); Assert.True(sut.checkISBN10(ISBN)); }
public void ISBN_ValidateChecksum10WithX() { string ISBN = "043942089X"; ISBNFinder sut = new ISBNFinder(); bool actual = sut.validateCheckSum10(ISBN); Assert.True(actual); }
public void ISBN_BookAvailableFromFinder() { String unknownISBN = "0553562614"; ISBNFinder sut = new ISBNFinder(); BookInfo actual = sut.lookup(unknownISBN); Assert.Equal("Title not found", actual.Title); }
public void ISBN_LongerThan10Characters_ReturnsInvalidBookInfo() { string longISBN = "123456789ABCEDF"; ISBNFinder sut = new ISBNFinder(); BookInfo actual = sut.lookup(longISBN); Assert.Equal("ISBN must be 10 characters in length", actual.Title); }
public void ISBN10_Validate_Check_Sum() { var isbnNumber10 = "0471958697"; ISBNFinder sut = new ISBNFinder(); BookInfo actual = sut.lookup(isbnNumber10); Assert.Equal(7, sut.IsValidIsbn10(isbnNumber10)); }
public void ISBN_StripDashesAndSpaces() { string ISBN = "04 -3942-089-X"; ISBNFinder sut = new ISBNFinder(); string actual = sut.stripDashAndSpace(ISBN); Assert.Equal("043942089X", actual); }
public void ISBN_CheckSumISBN10WithX() { string ISBN = "043942089X"; ISBNFinder sut = new ISBNFinder(); string actual = sut.calcCheckSum10(ISBN); Assert.Equal("X", actual.ToString()); }
public void ISBN_CheckSumISBN10() { string ISBN = "0201485672"; ISBNFinder sut = new ISBNFinder(); string actual = sut.calcCheckSum10(ISBN); Assert.Equal("2", actual.ToString()); }
public void Retrieve_ISB13() { var ISBN = "9780321146533"; ISBNFinder sut = new ISBNFinder(); BookInfo actual = sut.lookup(ISBN); BookInfo expected = new BookInfo("Test Driven Development by Example", "Kent Beck", "0321146530", "9780321146533"); Assert.Equal(expected.ToString(), actual.ToString()); }
public void ISBN_RemoveDashAndSpaceCheck() { string ISBN = "03-21146 530"; ISBNFinder sut = new ISBNFinder(); BookInfo actual = sut.lookup(ISBN); BookInfo expected = new BookInfo("Test Driven Development by Example", "Kent Beck", "0321146530", "9780321146533"); Assert.Equal(expected.ToString(), actual.ToString()); }
public void ISBN_ShorterThan10Characters_ReturnsInvalidBookInfo() { //Arrange string shortISBN = "12345"; //Act ISBNFinder sut = new ISBNFinder(); BookInfo actual = sut.lookup(shortISBN); //Assert Assert.Equal("ISBN must be 10 characters in length", actual.Title); }
public void goodCheckSum() { //Arrange string goodISBN = "9780131177055"; //Act ISBNFinder sut = new ISBNFinder(); //BookInfo actual = sut.lookup(goodISBN); //Assert Assert.True(sut.calcCheckSum13(goodISBN)); }
public void validInputLength10() { //Arrange string goodISBN = "0134757599"; //Act ISBNFinder sut = new ISBNFinder(); //BookInfo actual = sut.lookup(goodISBN); //Assert Assert.True(sut.ValidInputLength(goodISBN)); }