-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcharacter_test.go
More file actions
29 lines (23 loc) · 841 Bytes
/
character_test.go
File metadata and controls
29 lines (23 loc) · 841 Bytes
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
package wow
import (
. "launchpad.net/gocheck"
)
type CharacterSuite struct{}
var _ = Suite(&CharacterSuite{})
func (s *CharacterSuite) Test_CharacterClass_noApiClient(c *C) {
ch := &Character{}
_, err := ch.Class()
c.Assert(err.Error(), Equals, "Character instance does not have an ApiClient reference. Please set ApiClient before calling Class(). c.ApiClient = NewApiClient(\"US\", \"\")")
}
func (s *CharacterSuite) Test_CharacterClass_noClassId(c *C) {
client, _ := NewApiClient("US", "")
ch := NewCharacter(client)
_, err := ch.Class()
c.Assert(err.Error(), Equals, "Character instance does not have a class id.")
}
func (s *CharacterSuite) Test_CharacterClass(c *C) {
client, _ := NewApiClient("US", "")
ch := &Character{ApiClient: client, ClassId: 6}
class, _ := ch.Class()
c.Assert(class, Equals, "Death Knight")
}