forked from alaingilbert/ogame
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathattackEvent_test.go
More file actions
33 lines (30 loc) · 879 Bytes
/
Copy pathattackEvent_test.go
File metadata and controls
33 lines (30 loc) · 879 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
30
31
32
33
package ogame
import (
"testing"
"time"
"github.com/magiconair/properties/assert"
)
func TestAttackEvent_String(t *testing.T) {
a := AttackEvent{
ID: 123,
MissionType: 3,
Origin: Coordinate{1, 2, 3, PlanetType},
Destination: Coordinate{4, 5, 6, PlanetType},
DestinationName: "Homeworld",
ArrivalTime: time.Date(2018, 9, 11, 1, 2, 3, 4, time.UTC),
AttackerID: 456,
Missiles: 0,
Ships: &ShipsInfos{LargeCargo: 10},
}
expected := "" +
" ID: 123\n" +
" Mission Type: 3\n" +
" Origin: [P:1:2:3]\n" +
" Destination: [P:4:5:6]\n" +
" Destination Name: Homeworld\n" +
" ArrivalTime: 2018-09-11 01:02:03.000000004 +0000 UTC\n" +
" AttackerID: 456\n" +
" UnionID: 0\n" +
" Missiles: 0"
assert.Equal(t, expected, a.String())
}