aboutsummaryrefslogtreecommitdiff
path: root/hotline/client_conn_test.go
blob: da0a2cc1187181d49dd5df8c399d02547845817a (plain)
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
47
48
49
50
51
52
package hotline

import (
	"net"
	"testing"
)

func TestClientConn_handleTransaction(t *testing.T) {
	type fields struct {
		Connection net.Conn
		ID         *[]byte
		Icon       *[]byte
		Flags      *[]byte
		UserName   []byte
		Account    *Account
		IdleTime   int
		Server     *Server
		Version    *[]byte
		Idle       bool
		AutoReply  []byte
	}
	type args struct {
		transaction *Transaction
	}
	tests := []struct {
		name    string
		fields  fields
		args    args
		wantErr bool
	}{
		// TODO: Add test cases.
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			cc := &ClientConn{
				Connection: tt.fields.Connection,
				ID:         tt.fields.ID,
				Icon:       tt.fields.Icon,
				Flags:      tt.fields.Flags,
				UserName:   tt.fields.UserName,
				Account:    tt.fields.Account,
				Server:     tt.fields.Server,
				Version:    tt.fields.Version,
				Idle:       tt.fields.Idle,
				AutoReply:  tt.fields.AutoReply,
			}
			if err := cc.handleTransaction(tt.args.transaction); (err != nil) != tt.wantErr {
				t.Errorf("handleTransaction() error = %v, wantErr %v", err, tt.wantErr)
			}
		})
	}
}