You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
795 B

package trivia_test
import (
"testing"
"github.com/gabehf/trivia-api/trivia"
)
var Q trivia.Questions
var expect *trivia.Question
func TestMain(m *testing.M) {
Q.Init()
Q.Categories = []string{"world history"}
Q.M = map[string][]trivia.Question{
"world history": {
{
Question: "The ancient city of Rome was built on how many hills?",
Format: "MultipleChoice",
Category: "World History",
Choices: []string{
"Eight",
"Four",
"Nine",
"Seven",
},
Answer: "Seven",
},
},
}
expect = &trivia.Question{
Question: "The ancient city of Rome was built on how many hills?",
Category: "World History",
Format: "MultipleChoice",
Choices: []string{
"Eight",
"Four",
"Nine",
"Seven",
},
Answer: "Seven",
}
m.Run()
}