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.
240 lines
5.3 KiB
240 lines
5.3 KiB
package action
|
|
|
|
import (
|
|
"git.reya.zone/reya/hexmap/server/state"
|
|
"google.golang.org/protobuf/runtime/protoimpl"
|
|
"reflect"
|
|
"testing"
|
|
)
|
|
|
|
func TestCellColor_ToClientPB(t *testing.T) {
|
|
type fields struct {
|
|
At state.StorageCoordinates
|
|
Color state.Color
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
fields fields
|
|
want *ClientActionPB
|
|
}{
|
|
// 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 got := c.ToClientPB(); !reflect.DeepEqual(got, tt.want) {
|
|
t.Errorf("ToClientPB() = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
func TestCellColor_ToServerPB(t *testing.T) {
|
|
type fields struct {
|
|
At state.StorageCoordinates
|
|
Color state.Color
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
fields fields
|
|
want *ServerActionPB
|
|
}{
|
|
// 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 got := c.ToServerPB(); !reflect.DeepEqual(got, tt.want) {
|
|
t.Errorf("ToServerPB() = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
func TestCellSetColorPB_ToGo(t *testing.T) {
|
|
type fields struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
Color uint32
|
|
At *state.StorageCoordinatesPB
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
fields fields
|
|
want *CellColor
|
|
wantErr bool
|
|
}{
|
|
// TODO: Add test cases.
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
x := &CellSetColorPB{
|
|
state: tt.fields.state,
|
|
sizeCache: tt.fields.sizeCache,
|
|
unknownFields: tt.fields.unknownFields,
|
|
Color: tt.fields.Color,
|
|
At: tt.fields.At,
|
|
}
|
|
got, err := x.ToGo()
|
|
if (err != nil) != tt.wantErr {
|
|
t.Errorf("ToGo() error = %v, wantErr %v", err, tt.wantErr)
|
|
return
|
|
}
|
|
if !reflect.DeepEqual(got, tt.want) {
|
|
t.Errorf("ToGo() got = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
func TestClientActionPB_ToGo(t *testing.T) {
|
|
type fields struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
Action isClientActionPB_Action
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
fields fields
|
|
want Client
|
|
wantErr bool
|
|
}{
|
|
// TODO: Add test cases.
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
x := &ClientActionPB{
|
|
state: tt.fields.state,
|
|
sizeCache: tt.fields.sizeCache,
|
|
unknownFields: tt.fields.unknownFields,
|
|
Action: tt.fields.Action,
|
|
}
|
|
got, err := x.ToGo()
|
|
if (err != nil) != tt.wantErr {
|
|
t.Errorf("ToGo() error = %v, wantErr %v", err, tt.wantErr)
|
|
return
|
|
}
|
|
if !reflect.DeepEqual(got, tt.want) {
|
|
t.Errorf("ToGo() got = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
func TestServerActionPB_ToGo(t *testing.T) {
|
|
type fields struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
Action isServerActionPB_Action
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
fields fields
|
|
want Server
|
|
wantErr bool
|
|
}{
|
|
// TODO: Add test cases.
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
x := &ServerActionPB{
|
|
state: tt.fields.state,
|
|
sizeCache: tt.fields.sizeCache,
|
|
unknownFields: tt.fields.unknownFields,
|
|
Action: tt.fields.Action,
|
|
}
|
|
got, err := x.ToGo()
|
|
if (err != nil) != tt.wantErr {
|
|
t.Errorf("ToGo() error = %v, wantErr %v", err, tt.wantErr)
|
|
return
|
|
}
|
|
if !reflect.DeepEqual(got, tt.want) {
|
|
t.Errorf("ToGo() got = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
func TestUserActiveColor_ToClientPB(t *testing.T) {
|
|
type fields struct {
|
|
Color state.Color
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
fields fields
|
|
want *ClientActionPB
|
|
}{
|
|
// TODO: Add test cases.
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
c := UserActiveColor{
|
|
Color: tt.fields.Color,
|
|
}
|
|
if got := c.ToClientPB(); !reflect.DeepEqual(got, tt.want) {
|
|
t.Errorf("ToClientPB() = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
func TestUserActiveColor_ToServerPB(t *testing.T) {
|
|
type fields struct {
|
|
Color state.Color
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
fields fields
|
|
want *ServerActionPB
|
|
}{
|
|
// TODO: Add test cases.
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
c := UserActiveColor{
|
|
Color: tt.fields.Color,
|
|
}
|
|
if got := c.ToServerPB(); !reflect.DeepEqual(got, tt.want) {
|
|
t.Errorf("ToServerPB() = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
func TestUserSetActiveColorPB_ToGo(t *testing.T) {
|
|
type fields struct {
|
|
state protoimpl.MessageState
|
|
sizeCache protoimpl.SizeCache
|
|
unknownFields protoimpl.UnknownFields
|
|
Color uint32
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
fields fields
|
|
want *UserActiveColor
|
|
}{
|
|
// TODO: Add test cases.
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
x := &UserSetActiveColorPB{
|
|
state: tt.fields.state,
|
|
sizeCache: tt.fields.sizeCache,
|
|
unknownFields: tt.fields.unknownFields,
|
|
Color: tt.fields.Color,
|
|
}
|
|
if got := x.ToGo(); !reflect.DeepEqual(got, tt.want) {
|
|
t.Errorf("ToGo() = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|