Example #1
0
func TestChapterSize(t *testing.T) {
	c := readhacker.Chapter{}
	size := c.Size()
	if size == 0 {
		t.Error("size cannot be 0")
	} else {
		// do nothing
	}
}
Example #2
0
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)
	}
}
Example #3
0
func TestChapterNextChapter(t *testing.T) {
	c := readhacker.Chapter{}
	if c.NextChapter(1, 1) == nil {
		t.Error("next chapter is nil")
	}
}
Example #4
0
func TestChapterPreviousChapter(t *testing.T) {
	c := readhacker.Chapter{}
	if c.PreviousChapter(2, 1) == nil {
		t.Error("previous chapter is nil")
	}
}