-
Notifications
You must be signed in to change notification settings - Fork 0
/
gocards_test.go
82 lines (68 loc) · 1.46 KB
/
gocards_test.go
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package main
import (
"fmt"
"testing"
)
func TestNew(t *testing.T) {
var err error
d, err := NewDeck("Test")
if err != nil {
t.Error(err)
}
if d.Name != "Test" {
t.Error("Wrong Name. Was expecting Test but got ", d.Name)
}
}
/* func TestInitialize(t *testing.T) {
var err error
var d Deck
d.Initialize("Blackjack")
if err != nil {
t.Error(err)
}
if d.Name != "Blackjack" {
t.Error("Wrong Name. Was expecting Blackjack but got ", d.Name)
}
} */
/* func TestDealToPlayerApp(t *testing.T) {
var deck2 Deck
deck2.Initialize("Blackjack")
deck2.Shuffle()
deck2.dealToPlayers(5, 2)
c := deck2.dealCard()
p, _ := json.Marshal(c)
fmt.Println("Dealt:" + string(p))
player1Deck, e := NewDeck("Aymon")
if e != nil {
t.Error("Player1 Deck Failed: ", e)
}
player1Deck.addCard(c)
test, test2 := player1Deck.contains(c)
fmt.Println("Card in Deck: ", test)
fmt.Println("Position: ", test2)
} */
func TestGame(t *testing.T) {
testdeck := GenerateDeck("hanikalone")
fmt.Println(testdeck)
// TODO
}
/* func TestRemove(t *testing.T) {
var deck Deck
:= []Card{
{Suit: "Pink", Value: "5"},
{Suit: "Pink", Value: "5"},
{Suit: "Pink", Value: "5"},
{Suit: "Pink", Value: "5"},
{Suit: "Pink", Value: "5"},
{Suit: "Green", Value: "4"},
}
} */
/* func TestLoadDeckFail(t *testing.T) {
fmt.Println("TestLoadDeck")
loadDeck("TestLoadDeck")
}
*/
func TestLoadDeck(t *testing.T) {
fmt.Println("TestLoadDeck")
loadDeck("configs/carddecks.json")
}