Skip to content

Instantly share code, notes, and snippets.

@blanchonvincent
Last active July 5, 2019 09:17
Show Gist options
  • Save blanchonvincent/545ff12a587e719e281ebc4c5f5ca78c to your computer and use it in GitHub Desktop.
Save blanchonvincent/545ff12a587e719e281ebc4c5f5ca78c to your computer and use it in GitHub Desktop.
medium - test package - black box test
package deck_test
import (
"github.com/blanchonvincent/test-package/card"
"github.com/stretchr/testify/assert"
"testing"
)
func TestDeckCanDrawCards(t *testing.T) {
var num uint8 = 10
d := deck.NewDeck(num)
for i := uint8(0); i < num; i++ {
_, err := d.Draw()
assert.Nil(t, err)
}
_, err := d.Draw()
assert.Equal(t, err, deck.Empty)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment