added low test
This commit is contained in:
parent
7f57d8c289
commit
467907d391
30
tests/integration/questionRepo_test.go
Normal file
30
tests/integration/questionRepo_test.go
Normal file
@ -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)
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user