123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- package server
- import (
- "cfTest/cloudflareApi/loadBalancerPool"
- "context"
- "reflect"
- "testing"
- )
- func TestLoadBalancerPoolServer_Create(t *testing.T) {
- type fields struct {
- UnimplementedLoadBalancerPoolCloudflareServer loadBalancerPool.UnimplementedLoadBalancerPoolCloudflareServer
- }
- type args struct {
- ctx context.Context
- request *loadBalancerPool.LoadBalancerPoolRequest
- }
- tests := []struct {
- name string
- fields fields
- args args
- want *loadBalancerPool.LoadBalancerPool
- wantErr bool
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- d := LoadBalancerPoolServer{
- UnimplementedLoadBalancerPoolCloudflareServer: tt.fields.UnimplementedLoadBalancerPoolCloudflareServer,
- }
- 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 TestLoadBalancerPoolServer_Delete(t *testing.T) {
- type fields struct {
- UnimplementedLoadBalancerPoolCloudflareServer loadBalancerPool.UnimplementedLoadBalancerPoolCloudflareServer
- }
- type args struct {
- ctx context.Context
- request *loadBalancerPool.IdRequest
- }
- tests := []struct {
- name string
- fields fields
- args args
- want *loadBalancerPool.Empty
- wantErr bool
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- d := LoadBalancerPoolServer{
- UnimplementedLoadBalancerPoolCloudflareServer: tt.fields.UnimplementedLoadBalancerPoolCloudflareServer,
- }
- 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 TestLoadBalancerPoolServer_List(t *testing.T) {
- type fields struct {
- UnimplementedLoadBalancerPoolCloudflareServer loadBalancerPool.UnimplementedLoadBalancerPoolCloudflareServer
- }
- type args struct {
- ctx context.Context
- request *loadBalancerPool.ListRequest
- }
- tests := []struct {
- name string
- fields fields
- args args
- want *loadBalancerPool.LoadBalancerPoolList
- wantErr bool
- }{
- {
- name: "1",
- fields: fields{},
- args: args{
- ctx: nil,
- request: &loadBalancerPool.ListRequest{
- ApiKey: "2cc87f6213a4c40e5a90c8dced3c9c577eda5",
- ApiEmail: "ll@centcloud.net",
- },
- },
- want: nil,
- wantErr: false,
- },
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- d := LoadBalancerPoolServer{
- UnimplementedLoadBalancerPoolCloudflareServer: tt.fields.UnimplementedLoadBalancerPoolCloudflareServer,
- }
- 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 TestLoadBalancerPoolServer_Update(t *testing.T) {
- type fields struct {
- UnimplementedLoadBalancerPoolCloudflareServer loadBalancerPool.UnimplementedLoadBalancerPoolCloudflareServer
- }
- type args struct {
- ctx context.Context
- request *loadBalancerPool.LoadBalancerPoolRequest
- }
- tests := []struct {
- name string
- fields fields
- args args
- want *loadBalancerPool.LoadBalancerPool
- wantErr bool
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- d := LoadBalancerPoolServer{
- UnimplementedLoadBalancerPoolCloudflareServer: tt.fields.UnimplementedLoadBalancerPoolCloudflareServer,
- }
- 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)
- }
- })
- }
- }
- func TestLoadBalancerPoolServer_Get(t *testing.T) {
- type fields struct {
- UnimplementedLoadBalancerPoolCloudflareServer loadBalancerPool.UnimplementedLoadBalancerPoolCloudflareServer
- }
- type args struct {
- ctx context.Context
- request *loadBalancerPool.IdRequest
- }
- tests := []struct {
- name string
- fields fields
- args args
- want *loadBalancerPool.LoadBalancerPool
- wantErr bool
- }{
- {
- name: "1",
- fields: fields{},
- args: args{
- ctx: nil,
- request: &loadBalancerPool.IdRequest{
- ApiKey: "2cc87f6213a4c40e5a90c8dced3c9c577eda5",
- ApiEmail: "ll@centcloud.net",
- Id: "6c946466b3d38323661808d5655f3423",
- },
- },
- want: nil,
- wantErr: false,
- },
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- d := LoadBalancerPoolServer{
- UnimplementedLoadBalancerPoolCloudflareServer: tt.fields.UnimplementedLoadBalancerPoolCloudflareServer,
- }
- got, err := d.Get(tt.args.ctx, tt.args.request)
- if (err != nil) != tt.wantErr {
- t.Errorf("Get() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if !reflect.DeepEqual(got, tt.want) {
- t.Errorf("Get() got = %v, want %v", got, tt.want)
- }
- })
- }
- }
|