diff --git a/tests/integration/questionRepo_test.go b/tests/integration/questionRepo_test.go new file mode 100644 index 0000000..20e660a --- /dev/null +++ b/tests/integration/questionRepo_test.go @@ -0,0 +1,30 @@ +package integration + +import ( + "context" + "fmt" + "gitea.pena/SQuiz/common/dal" + "testing" +) + +func Test_GetQuestionList(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + d, err := dal.New(ctx, "host=localhost port=35432 user=squiz password=Redalert2 dbname=squiz sslmode=disable", nil) + if err != nil { + t.Fatal(err) + } + + defer d.Close() + + limit := int32(10) + offset := int32(1000) + + list, count, err := d.QuestionRepo.GetQuestionsAI(ctx, 1308, "", limit, offset) + if err != nil { + t.Fatal(err) + } + fmt.Println(list) + fmt.Println(count) + +}