func TestBookListAll(t *testing.T) { b := readhacker.Book{} for _, v := range b.ListAll() { fmt.Println(v.String()) } }
func TestBookGetByBookId(t *testing.T) { b := readhacker.Book{} book := b.GetByBookId(1) if book == nil { t.Error("book is nil") } else { fmt.Printf(book.BookName) } }
func TestBookGetAllChapter(t *testing.T) { b := readhacker.Book{} chapters := b.GetAllChapter(1) if len(chapters) == 0 { t.Error("chapter not found") } else { for _, chapter := range chapters { fmt.Print(chapter.ChapterName + "\n") } } }