func TestChapterSize(t *testing.T) { c := readhacker.Chapter{} size := c.Size() if size == 0 { t.Error("size cannot be 0") } else { // do nothing } }
func TestChapterGetByChapterId(t *testing.T) { c := readhacker.Chapter{} chapter := c.GetByChapterId(int64(1)) if chapter == nil { t.Errorf("chapter is nil pointer") } else { fmt.Printf(chapter.ChapterName) fmt.Printf(chapter.ChapterLink) fmt.Printf(chapter.Content) //fmt.Printf("%s", chapter.Content) } }
func TestChapterNextChapter(t *testing.T) { c := readhacker.Chapter{} if c.NextChapter(1, 1) == nil { t.Error("next chapter is nil") } }
func TestChapterPreviousChapter(t *testing.T) { c := readhacker.Chapter{} if c.PreviousChapter(2, 1) == nil { t.Error("previous chapter is nil") } }