Пример #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
	}
}
Пример #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)
	}
}
Пример #3
0
func TestChapterNextChapter(t *testing.T) {
	c := readhacker.Chapter{}
	if c.NextChapter(1, 1) == nil {
		t.Error("next chapter is nil")
	}
}
Пример #4
0
func TestChapterPreviousChapter(t *testing.T) {
	c := readhacker.Chapter{}
	if c.PreviousChapter(2, 1) == nil {
		t.Error("previous chapter is nil")
	}
}