aboutsummaryrefslogtreecommitdiff
path: root/tracker_test.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2021-07-28 18:21:52 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2021-07-28 14:21:52 -0700
commit22c599abc18895f73e96095f35b71cf3357d41b4 (patch)
tree482ef57d386c955692ea43c43e4655b3c3763499 /tracker_test.go
parent71c56068adca18f76ebee86355f000a3e51d3127 (diff)
Move code to hotline dir
Diffstat (limited to 'tracker_test.go')
-rw-r--r--tracker_test.go57
1 files changed, 0 insertions, 57 deletions
diff --git a/tracker_test.go b/tracker_test.go
deleted file mode 100644
index b904462..0000000
--- a/tracker_test.go
+++ /dev/null
@@ -1,57 +0,0 @@
-package hotline
-
-import (
- "reflect"
- "testing"
-)
-
-func TestTrackerRegistration_Payload(t *testing.T) {
- type fields struct {
- Port []byte
- UserCount int
- PassID []byte
- Name string
- Description string
- }
- tests := []struct {
- name string
- fields fields
- want []byte
- }{
- {
- name: "returns expected payload bytes",
- fields: fields{
- Port: []byte{0x00, 0x10},
- UserCount: 2,
- PassID: []byte{0x00, 0x00, 0x00, 0x01},
- Name: "Test Serv",
- Description: "Fooz",
- },
- want: []byte{
- 0x00, 0x01,
- 0x00, 0x10,
- 0x00, 0x02,
- 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- 0x09,
- 0x54, 0x65, 0x73, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76,
- 0x04,
- 0x46, 0x6f, 0x6f, 0x7a,
- },
- },
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- tr := &TrackerRegistration{
- Port: tt.fields.Port,
- UserCount: tt.fields.UserCount,
- PassID: tt.fields.PassID,
- Name: tt.fields.Name,
- Description: tt.fields.Description,
- }
- if got := tr.Payload(); !reflect.DeepEqual(got, tt.want) {
- t.Errorf("Payload() = %v, want %v", got, tt.want)
- }
- })
- }
-}