You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
hexmap/server/action/action_test.go

190 lines
3.8 KiB

package action
import (
"git.reya.zone/reya/hexmap/server/state"
"go.uber.org/zap/zapcore"
"reflect"
"testing"
)
func TestCellColor_Apply(t *testing.T) {
type fields struct {
At state.StorageCoordinates
Color state.Color
}
type args struct {
s *state.Synced
}
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) {
c := CellColor{
At: tt.fields.At,
Color: tt.fields.Color,
}
if err := c.Apply(tt.args.s); (err != nil) != tt.wantErr {
t.Errorf("Apply() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}
func TestCellColor_MarshalLogObject(t *testing.T) {
type fields struct {
At state.StorageCoordinates
Color state.Color
}
type args struct {
encoder zapcore.ObjectEncoder
}
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) {
c := CellColor{
At: tt.fields.At,
Color: tt.fields.Color,
}
if err := c.MarshalLogObject(tt.args.encoder); (err != nil) != tt.wantErr {
t.Errorf("MarshalLogObject() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}
func TestIDed_MarshalLogObject(t *testing.T) {
type fields struct {
ID uint32
Action Client
}
type args struct {
encoder zapcore.ObjectEncoder
}
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) {
i := IDed{
ID: tt.fields.ID,
Action: tt.fields.Action,
}
if err := i.MarshalLogObject(tt.args.encoder); (err != nil) != tt.wantErr {
t.Errorf("MarshalLogObject() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}
func TestServerSlice_MarshalLogArray(t *testing.T) {
type args struct {
encoder zapcore.ArrayEncoder
}
tests := []struct {
name string
s ServerSlice
args args
wantErr bool
}{
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if err := tt.s.MarshalLogArray(tt.args.encoder); (err != nil) != tt.wantErr {
t.Errorf("MarshalLogArray() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}
func TestUserActiveColor_Apply(t *testing.T) {
type fields struct {
Color state.Color
}
type args struct {
s *state.Synced
}
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) {
c := UserActiveColor{
Color: tt.fields.Color,
}
if err := c.Apply(tt.args.s); (err != nil) != tt.wantErr {
t.Errorf("Apply() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}
func TestUserActiveColor_MarshalLogObject(t *testing.T) {
type fields struct {
Color state.Color
}
type args struct {
encoder zapcore.ObjectEncoder
}
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) {
c := UserActiveColor{
Color: tt.fields.Color,
}
if err := c.MarshalLogObject(tt.args.encoder); (err != nil) != tt.wantErr {
t.Errorf("MarshalLogObject() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}
func Test_serverPBFromClient(t *testing.T) {
type args struct {
c Client
}
tests := []struct {
name string
args args
want *ServerActionPB
}{
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := serverPBFromClient(tt.args.c); !reflect.DeepEqual(got, tt.want) {
t.Errorf("serverPBFromClient() = %v, want %v", got, tt.want)
}
})
}
}