public void GetBookInfoTest() { BookInfo book = new BookInfo(); DataSet ds = book.GetBookInfo("011"); Assert.IsNotNull(ds); Assert.AreEqual("axb", ds.Tables[0].Rows[0]["BookName"]); }
public void DeleteBook() { BookInfo book = new BookInfo(); Assert.IsTrue(book.DeleteBook("A23")); DataSet ds = book.GetBookInfo("A23"); Assert.IsNotNull(ds); Assert.AreEqual(0, ds.Tables[0].Rows.Count); }
public void InsertNewBook() { BookInfo book = new BookInfo(); Assert.IsTrue(book.InsertNewBook("t4050000", "12345678912360", "axb", "axb", Convert.ToDateTime("1999-1-1"), "1", 12, 12, "axb", "T")); DataSet ds = book.GetBookInfo("t4050000"); Assert.IsNotNull(ds); Assert.AreEqual("12345678912360", ds.Tables[0].Rows[0]["isbn"].ToString().Trim()); Assert.AreEqual("axb", ds.Tables[0].Rows[0]["bookname"]); Assert.AreEqual("axb", ds.Tables[0].Rows[0]["author"]); Assert.AreEqual(Convert.ToDateTime("1999-1-1"), ds.Tables[0].Rows[0]["publishdate"]); Assert.AreEqual("1", ds.Tables[0].Rows[0]["bookversion"]); Assert.AreEqual(12, ds.Tables[0].Rows[0]["wordcount"]); Assert.AreEqual(Convert.ToInt16(12), ds.Tables[0].Rows[0]["pagecount"]); Assert.AreEqual("axb", ds.Tables[0].Rows[0]["publisher"]); Assert.AreEqual("T", ds.Tables[0].Rows[0]["classid"]); }
public DataSet GetBookInfoByBookID(string bookid) { return(book.GetBookInfo(bookid)); }