From 467907d391680f628ed89e68c1af7e7472cec493 Mon Sep 17 00:00:00 2001 From: pasha1coil Date: Fri, 25 Apr 2025 18:11:36 +0300 Subject: [PATCH] added low test --- tests/integration/questionRepo_test.go | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/integration/questionRepo_test.go 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) + +}