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 CartaMaisAltaTest {
  
  @Test
  def GanhaCartaMaisAlta() {
    assertTrue(c((2, PAUS), (3, PAUS), (4, OUROS), (5, OUROS), (8, ESPADAS)) > 
               c((2, OUROS), (3, OUROS), (4, PAUS), (5, PAUS), (7, COPAS)))

    assertTrue(c((2, PAUS), (3, PAUS), (4, OUROS), (5, OUROS), (7, ESPADAS)) < 
               c((2, OUROS), (3, OUROS), (4, PAUS), (5, PAUS), (8, COPAS)))
  }
  
  @Test
  def ASCartaMaisAlta() {
    assertTrue(c((2, PAUS), (3, PAUS), (4, OUROS), (6, OUROS), (AS, ESPADAS)) > 
               c((2, OUROS), (3, OUROS), (4, PAUS), (6, PAUS), (K, COPAS)))
  }

  @Test
  def GanhaSegundaCartaMaisAlta() {
    assertTrue(c((2, PAUS), (3, PAUS), (4, OUROS), (6, OUROS), (K, ESPADAS)) > 
               c((2, OUROS), (3, OUROS), (4, PAUS), (5, PAUS), (K, COPAS)))
  }
  
  @Test
  def GanhaTerceiraCartaMaisAlta() {
    assertTrue(c((2, PAUS), (3, PAUS), (5, OUROS), (6, OUROS), (K, ESPADAS)) > 
               c((2, OUROS), (3, OUROS), (4, PAUS), (6, PAUS), (K, COPAS)))
  }
  
  @Test
  def GanhaUltimaCartaMaisAlta() {
    assertTrue(c((3, PAUS), (4, PAUS), (5, OUROS), (6, OUROS), (K, ESPADAS)) > 
               c((2, OUROS), (4, OUROS), (5, PAUS), (6, PAUS), (K, COPAS)))
  }
  
  @Test
  def Empate() {
		var comb = c((2, PAUS), (4, PAUS), (5, OUROS), (6, OUROS), (AS, ESPADAS))
    assertTrue(comb >= comb)
		assertTrue(comb <= comb)
  }
  
}
