Test store.UpdateQuiz

This commit is contained in:
Andrea Fazzi 2023-07-07 18:15:09 +02:00
parent 56038e014a
commit 7a1135de0f

View file

@ -127,13 +127,13 @@ func (t *testSuite) TestUpdateQuiz() {
}, },
}) })
t.Nil(err, "The quiz to update should be created without issue") t.Nil(err, "The quiz to be updated should be created without issue")
if !t.Failed() { if !t.Failed() {
_, err = store.UpdateQuiz( _, err = store.UpdateQuiz(
&client.CreateUpdateQuizRequest{ &client.CreateUpdateQuizRequest{
Quiz: &client.Quiz{ Quiz: &client.Quiz{
Question: &client.Question{Text: "Newly created question text."}, Question: &client.Question{Text: "Updated question text."},
Answers: []*client.Answer{ Answers: []*client.Answer{
{Text: "Answer 1", Correct: true}, {Text: "Answer 1", Correct: true},
{Text: "Answer 2", Correct: false}, {Text: "Answer 2", Correct: false},
@ -144,6 +144,7 @@ func (t *testSuite) TestUpdateQuiz() {
}, quiz.ID) }, quiz.ID)
} }
} }
} }
func createQuizOnDisk(store *FileProboCollectorStore, req *client.CreateUpdateQuizRequest) (*models.Quiz, error) { func createQuizOnDisk(store *FileProboCollectorStore, req *client.CreateUpdateQuizRequest) (*models.Quiz, error) {