go-poker/pokercore/pokercore_test.go

31 lines
664 B
Go
Raw Normal View History

2019-03-23 09:43:25 +00:00
package pokercore
2019-03-24 03:59:45 +00:00
import "github.com/stretchr/testify/assert"
2019-03-23 09:43:25 +00:00
import "testing"
2019-03-23 11:21:03 +00:00
type ShuffleTestResults []struct {
SeedVal int64
Expected string
}
2019-03-23 09:43:25 +00:00
func TestPokerHand(t *testing.T) {
//test stuff here
2019-03-23 11:21:03 +00:00
d := NewDeck()
d.ShuffleDeterministically(437)
cards := d.Deal(7)
//expected := "7C,5S,QS,2D,6D,QC,3H"
expected := "7♣,5♠,Q♠,2♦,6♦,Q♣,3♥"
2019-03-24 03:59:45 +00:00
assert.Equal(t, cards.String(), expected)
2019-03-23 11:21:03 +00:00
x := d.Remaining()
2019-03-24 03:59:45 +00:00
assert.Equal(t, 45, x)
d.ShuffleDeterministically(123456789)
cards = d.Deal(10)
expected = "2♣,T♠,4♥,Q♣,9♦,7♥,7♠,6♥,5♥,5♠"
assert.Equal(t, expected, cards.String())
x = d.Remaining()
assert.Equal(t, 42, x)
2019-03-23 09:43:25 +00:00
}