-
Notifications
You must be signed in to change notification settings - Fork 0
/
type10_test.go
40 lines (32 loc) · 870 Bytes
/
type10_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
package nmeaais
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestType10MessageProcessing(t *testing.T) {
Convey("When processing a type 10 message", t, func() {
raws := []string{
"!AIVDM,1,1,,A,:5MwvSQGRlc8,0*45",
}
packets := buildPackets(raws)
message, err := Process(packets)
type10, err := message.GetAsUTCDateInquiry()
expected := &UTCDateInquiry{
MessageType: 10,
RepeatIndicator: 0,
MMSI: 367001230,
DestinationMMSI: 367186610,
}
Convey("The get should return a type 10 message", func() {
Convey("Where the message is not nil", func() {
So(type10, ShouldNotBeNil)
})
})
Convey("The get should not return an error", func() {
So(err, ShouldBeNil)
})
Convey("The fields should be populated correctly", func() {
So(type10, ShouldResemble, expected)
})
})
}