Skip to content

Commit

Permalink
final
Browse files Browse the repository at this point in the history
  • Loading branch information
talDoFlemis committed Apr 29, 2024
1 parent f7bfec0 commit 8810cb2
Showing 1 changed file with 0 additions and 178 deletions.
178 changes: 0 additions & 178 deletions backend/internal/adapters/driven/postgres/game_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,142 +251,6 @@ func (suite *PostgresGameStorerTestSuite) TestStoreGameWithQuizQuestions() {
},
}

// table := []struct {
// gameId uuid.UUID
// description string
// questions []game.Question
// }{
// {
// gameId: uuid.New(),
// description: "single quiz question empty alternatives",
// questions: []game.Question{
// &game.QuizQuestion{
// Id: uuid.New(),
// Title: "quz question 420",
// Points: 1,
// TimeLimit: 30,
// Alternatives: []game.Alternative{},
// },
// },
// },
// {
// gameId: uuid.New(),
// description: "single quiz question with one alternative",
// questions: []game.Question{
// &game.QuizQuestion{
// Id: uuid.New(),
// Title: "quz question 69",
// Points: 1,
// TimeLimit: 30,
// Alternatives: []game.Alternative{
// {
// Data: "testAlternative asdf",
// IsCorrect: true,
// },
// },
// },
// },
// },
// {
// gameId: uuid.New(),
// description: "multiples quiz question",
// questions: []game.Question{
// &game.QuizQuestion{
// Id: uuid.New(),
// Title: "quz question 1",
// Points: 1,
// TimeLimit: 30,
// Alternatives: []game.Alternative{
// {
// Data: "testAlternative 0",
// IsCorrect: true,
// },
// },
// },
// &game.QuizQuestion{
// Id: uuid.New(),
// Title: "quz question 2",
// Points: 1,
// TimeLimit: 30,
// Alternatives: []game.Alternative{
// {
// Data: "testAlternative 2",
// IsCorrect: true,
// },
// },
// },
// },
// },
// {
// gameId: uuid.New(),
// description: "single quiz multiples alternatives",
// questions: []game.Question{
// &game.QuizQuestion{
// Id: uuid.New(),
// Title: "quiz 10",
// Points: 1,
// TimeLimit: 30,
// Alternatives: []game.Alternative{
// {
// Data: "testAlternative 30",
// IsCorrect: true,
// },
// {
// Data: "testAlternative 40",
// IsCorrect: true,
// },
// {
// Data: "testAlternative 50",
// IsCorrect: true,
// },
// },
// },
// },
// },
// {
// gameId: uuid.New(),
// description: "multiples quizzes multiples alternatives",
// questions: []game.Question{
// &game.QuizQuestion{
// Id: uuid.New(),
// Title: "quiz 1",
// Points: 1,
// TimeLimit: 30,
// Alternatives: []game.Alternative{
// {
// Data: "testAlternative 3",
// IsCorrect: true,
// },
// {
// Data: "testAlternative 4",
// IsCorrect: true,
// },
// {
// Data: "testAlternative 5",
// IsCorrect: true,
// },
// },
// },
// &game.QuizQuestion{
// Id: uuid.New(),
// Title: "quiz 2",
// Points: 1,
// TimeLimit: 30,
// Alternatives: []game.Alternative{
// {
// Data: "testAlternative 7",
// IsCorrect: true,
// },
// {
// Data: "testAlternative 8",
// IsCorrect: true,
// },
// },
// },
// },
// },
// }

// Act
err := suite.repo.StoreGame(suite.ctx, mockedGame)

Expand Down Expand Up @@ -421,48 +285,6 @@ func (suite *PostgresGameStorerTestSuite) TestStoreGameWithQuizQuestions() {
}
}
assert.False(t, rows.Next())

// for _, tt := range table {
// mockedGame.Questions = tt.questions
// mockedGame.Id = tt.gameId
//
// t.Run(tt.description, func(t *testing.T) {
// // Act
// err := suite.repo.StoreGame(suite.ctx, mockedGame)
//
// // Assert
// assert.NoError(t, err)
//
// // _, err = suite.pool.Query(
// // suite.ctx,
// // `SELECT id FROM questions WHERE game_id = $1`,
// // tt.gameId)
// // assert.NoError(t, err)
//
// // for _, mockedQuestion := range mockedGame.Questions {
// // rows.Next()
// // var id uuid.UUID
// // err = rows.Scan(&id)
// // assert.NoError(t, err)
// // _, err := suite.pool.Query(
// // suite.ctx,
// // `SELECT data, correct FROM quiz_questions WHERE question_id = $1`,
// // id,
// // )
// // mockedQuestion.GetTitle()
// // assert.NoError(t, err)
// // // for _, mockedAlternative := range mockedQuestion.(*game.QuizQuestion).Alternatives {
// // // alternatives.Next()
// // // var actualA game.Alternative
// // //
// // // err = alternatives.Scan(&actualA.Data, &actualA.IsCorrect)
// // // assert.NoError(t, err)
// // // assert.Equal(t, mockedAlternative, actualA)
// // // }
// // }
// // assert.False(t, rows.Next())
// })
// }
}

func (suite *PostgresGameStorerTestSuite) TestStoreGameWithDiverseQuestions() {
Expand Down

0 comments on commit 8810cb2

Please sign in to comment.