]> git.r.bdr.sh - rbdr/mobius/blob - hotline/client_conn_test.go
Add tests and clean up
[rbdr/mobius] / hotline / client_conn_test.go
1 package hotline
2
3 import (
4 "net"
5 "testing"
6 )
7
8 func TestClientConn_handleTransaction(t *testing.T) {
9 type fields struct {
10 Connection net.Conn
11 ID *[]byte
12 Icon *[]byte
13 Flags *[]byte
14 UserName []byte
15 Account *Account
16 IdleTime *int
17 Server *Server
18 Version *[]byte
19 Idle bool
20 AutoReply *[]byte
21 }
22 type args struct {
23 transaction *Transaction
24 }
25 tests := []struct {
26 name string
27 fields fields
28 args args
29 wantErr bool
30 }{
31 // TODO: Add test cases.
32 }
33 for _, tt := range tests {
34 t.Run(tt.name, func(t *testing.T) {
35 cc := &ClientConn{
36 Connection: tt.fields.Connection,
37 ID: tt.fields.ID,
38 Icon: tt.fields.Icon,
39 Flags: tt.fields.Flags,
40 UserName: tt.fields.UserName,
41 Account: tt.fields.Account,
42 IdleTime: tt.fields.IdleTime,
43 Server: tt.fields.Server,
44 Version: tt.fields.Version,
45 Idle: tt.fields.Idle,
46 AutoReply: tt.fields.AutoReply,
47 }
48 if err := cc.handleTransaction(tt.args.transaction); (err != nil) != tt.wantErr {
49 t.Errorf("handleTransaction() error = %v, wantErr %v", err, tt.wantErr)
50 }
51 })
52 }
53 }