package poker.domain.classificacao

import poker.domain.Carta
import poker.domain.Valor._
import poker.domain.Naipe._
import org.testng.annotations._
import org.junit.Assert._
import poker.PokerHelperTest._

class DoisParesTest {
  
  @Test
  def menorDoisParesGanhaMaiorPar() {
    assertTrue(menorDoisPares() > maiorPar())
    assertTrue(maiorPar() < menorDoisPares())
  }

  @Test
  def MaiorParGanha() {
    assertTrue(c((3, PAUS), (2, PAUS), (2, OUROS), (AS, OUROS), (AS, ESPADAS)) >
               c((J, OUROS), (Q, OUROS), (Q, PAUS), (K, PAUS), (K, COPAS)))
  }
  
  @Test
  def MaiorParEmpataGanhaMenorPar() {
    assertTrue(c((2, PAUS), (3, PAUS), (3, OUROS), (AS, OUROS), (AS, ESPADAS)) >
               c((K, OUROS), (2, OUROS), (2, PAUS), (AS, PAUS), (AS, COPAS)))
  }
  
  @Test
  def ParesEmpatamGanhaCartaMaisAlta() {
    assertTrue(c((3, PAUS), (K, PAUS), (K, OUROS), (AS, OUROS), (AS, ESPADAS)) >
               c((2, OUROS), (K, OUROS), (K, PAUS), (AS, PAUS), (AS, COPAS)))
  }
  
  @Test
  def Empata() {
		var comb = c((Q, PAUS), (K, PAUS), (K, OUROS), (AS, OUROS), (AS, ESPADAS))
    assertTrue(comb >= comb)
		assertTrue(comb <= comb)
  }
  
}
