package server import ( "cfTest/cloudflareApi/loadBalancer" "context" "reflect" "testing" ) func TestLoadBalancerServer_Create(t *testing.T) { type fields struct { UnimplementedLoadBalancerCloudflareServer loadBalancer.UnimplementedLoadBalancerCloudflareServer } type args struct { ctx context.Context request *loadBalancer.LoadBalancerRequest } tests := []struct { name string fields fields args args want *loadBalancer.LoadBalancer wantErr bool }{ { name: "1", fields: fields{}, args: args{ ctx: nil, request: &loadBalancer.LoadBalancerRequest{ ApiKey: "2cc87f6213a4c40e5a90c8dced3c9c577eda5", ApiEmail: "ll@centcloud.net", ZoneId: "a6383cfb80012436f261793522e811e8", LoadBalancer: &loadBalancer.LoadBalancer{ Id: "", Name: "test.test1121.com.cdn.sensordb.site", DefaultPools: []string{"6c946466b3d38323661808d5655f3423"}, FallbackPool: "6c946466b3d38323661808d5655f3423", Proxied: true, }, }, }, want: nil, wantErr: false, }, // TODO: Add test cases. } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { d := LoadBalancerServer{ UnimplementedLoadBalancerCloudflareServer: tt.fields.UnimplementedLoadBalancerCloudflareServer, } got, err := d.Create(tt.args.ctx, tt.args.request) if (err != nil) != tt.wantErr { t.Errorf("Create() error = %v, wantErr %v", err, tt.wantErr) return } if !reflect.DeepEqual(got, tt.want) { t.Errorf("Create() got = %v, want %v", got, tt.want) } }) } } func TestLoadBalancerServer_Delete(t *testing.T) { type fields struct { UnimplementedLoadBalancerCloudflareServer loadBalancer.UnimplementedLoadBalancerCloudflareServer } type args struct { ctx context.Context request *loadBalancer.DeleteRequest } tests := []struct { name string fields fields args args want *loadBalancer.Empty wantErr bool }{ { name: "1", fields: fields{}, args: args{ ctx: nil, request: &loadBalancer.DeleteRequest{ ApiKey: "2cc87f6213a4c40e5a90c8dced3c9c577eda5", ApiEmail: "ll@centcloud.net", ZoneId: "a6383cfb80012436f261793522e811e8", Id: "0fb7f62b06de8b085e0b29183a0b365c", }, }, want: nil, wantErr: false, }, // TODO: Add test cases. } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { d := LoadBalancerServer{ UnimplementedLoadBalancerCloudflareServer: tt.fields.UnimplementedLoadBalancerCloudflareServer, } got, err := d.Delete(tt.args.ctx, tt.args.request) if (err != nil) != tt.wantErr { t.Errorf("Delete() error = %v, wantErr %v", err, tt.wantErr) return } if !reflect.DeepEqual(got, tt.want) { t.Errorf("Delete() got = %v, want %v", got, tt.want) } }) } } func TestLoadBalancerServer_List(t *testing.T) { type fields struct { UnimplementedLoadBalancerCloudflareServer loadBalancer.UnimplementedLoadBalancerCloudflareServer } type args struct { ctx context.Context request *loadBalancer.ListRequest } tests := []struct { name string fields fields args args want *loadBalancer.LoadBalancerList wantErr bool }{ { name: "1", fields: fields{}, args: args{ ctx: nil, request: &loadBalancer.ListRequest{ ApiKey: "2cc87f6213a4c40e5a90c8dced3c9c577eda5", ApiEmail: "ll@centcloud.net", ZoneId: "a6383cfb80012436f261793522e811e8", }, }, want: nil, wantErr: false, }, // TODO: Add test cases. } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { d := LoadBalancerServer{ UnimplementedLoadBalancerCloudflareServer: tt.fields.UnimplementedLoadBalancerCloudflareServer, } got, err := d.List(tt.args.ctx, tt.args.request) if (err != nil) != tt.wantErr { t.Errorf("List() error = %v, wantErr %v", err, tt.wantErr) return } if !reflect.DeepEqual(got, tt.want) { t.Errorf("List() got = %v, want %v", got, tt.want) } }) } } func TestLoadBalancerServer_Update(t *testing.T) { type fields struct { UnimplementedLoadBalancerCloudflareServer loadBalancer.UnimplementedLoadBalancerCloudflareServer } type args struct { ctx context.Context request *loadBalancer.LoadBalancerRequest } tests := []struct { name string fields fields args args want *loadBalancer.LoadBalancer wantErr bool }{ { name: "1", fields: fields{}, args: args{ ctx: nil, request: &loadBalancer.LoadBalancerRequest{ ApiKey: "2cc87f6213a4c40e5a90c8dced3c9c577eda5", ApiEmail: "ll@centcloud.net", ZoneId: "a6383cfb80012436f261793522e811e8", LoadBalancer: &loadBalancer.LoadBalancer{ Id: "0fb7f62b06de8b085e0b29183a0b365c", Name: "test2.test1121.com.cdn.sensordb.site", DefaultPools: []string{ "6c946466b3d38323661808d5655f3423", }, FallbackPool: "6c946466b3d38323661808d5655f3423", Proxied: true, }, }, }, want: nil, wantErr: false, }, // TODO: Add test cases. } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { d := LoadBalancerServer{ UnimplementedLoadBalancerCloudflareServer: tt.fields.UnimplementedLoadBalancerCloudflareServer, } got, err := d.Update(tt.args.ctx, tt.args.request) if (err != nil) != tt.wantErr { t.Errorf("Update() error = %v, wantErr %v", err, tt.wantErr) return } if !reflect.DeepEqual(got, tt.want) { t.Errorf("Update() got = %v, want %v", got, tt.want) } }) } }