Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

likorn / quick_max

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • quick_max
  • ..
  • quickmax
  • AnswerSetTest.kt
Find file
BlameHistoryPermalink
  • likorn's avatar
    Changed the package name · 9c95e259
    likorn committed 5 years ago
    9c95e259
AnswerSetTest.kt 634 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
package com.paktalin.quickmax

import com.paktalin.quickmax.answers.AnswerSet
import com.paktalin.quickmax.answers.findSecondMax
import org.junit.Test

import org.junit.Assert.*

class AnswerSetTest {

    private val numOptions = 4
    private val numDigits = 3
    private val numberSet = AnswerSet(numOptions, numDigits)

    @Test
    fun test_constructor() {
        assertEquals(numOptions, numberSet.answers.size)
        numberSet.answers.forEach { n -> n in (100..999) }
    }

    @Test
    fun isCorrect() {
        val secondMax = findSecondMax(numberSet.answers)
        assertTrue(numberSet.isCorrect(secondMax))
    }
}