-
Notifications
You must be signed in to change notification settings - Fork 14
/
tileset_test.go
46 lines (44 loc) · 917 Bytes
/
tileset_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
package tilepix
import (
"testing"
)
func TestTileset_String(t *testing.T) {
type fields struct {
Name string
TileWidth int
TileHeight int
Spacing int
Tilecount int
}
tests := []struct {
name string
fields fields
want string
}{
{
name: "Basic string",
fields: fields{
Name: "name ts",
TileWidth: 10,
TileHeight: 15,
Spacing: 0,
Tilecount: 150,
},
want: "TileSet{Name: name ts, Tile size: 10x15, Tile spacing: 0, Tilecount: 150, Properties: []}",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
ts := &Tileset{
Name: tt.fields.Name,
TileWidth: tt.fields.TileWidth,
TileHeight: tt.fields.TileHeight,
Spacing: tt.fields.Spacing,
Tilecount: tt.fields.Tilecount,
}
if got := ts.String(); got != tt.want {
t.Errorf("String() = %v, want %v", got, tt.want)
}
})
}
}