LoadBalancerPoolCloudflareServer_test.go 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. package server
  2. import (
  3. "cfTest/cloudflareApi/loadBalancerPool"
  4. "context"
  5. "reflect"
  6. "testing"
  7. )
  8. func TestLoadBalancerPoolServer_Create(t *testing.T) {
  9. type fields struct {
  10. UnimplementedLoadBalancerPoolCloudflareServer loadBalancerPool.UnimplementedLoadBalancerPoolCloudflareServer
  11. }
  12. type args struct {
  13. ctx context.Context
  14. request *loadBalancerPool.LoadBalancerPoolRequest
  15. }
  16. tests := []struct {
  17. name string
  18. fields fields
  19. args args
  20. want *loadBalancerPool.LoadBalancerPool
  21. wantErr bool
  22. }{
  23. // TODO: Add test cases.
  24. }
  25. for _, tt := range tests {
  26. t.Run(tt.name, func(t *testing.T) {
  27. d := LoadBalancerPoolServer{
  28. UnimplementedLoadBalancerPoolCloudflareServer: tt.fields.UnimplementedLoadBalancerPoolCloudflareServer,
  29. }
  30. got, err := d.Create(tt.args.ctx, tt.args.request)
  31. if (err != nil) != tt.wantErr {
  32. t.Errorf("Create() error = %v, wantErr %v", err, tt.wantErr)
  33. return
  34. }
  35. if !reflect.DeepEqual(got, tt.want) {
  36. t.Errorf("Create() got = %v, want %v", got, tt.want)
  37. }
  38. })
  39. }
  40. }
  41. func TestLoadBalancerPoolServer_Delete(t *testing.T) {
  42. type fields struct {
  43. UnimplementedLoadBalancerPoolCloudflareServer loadBalancerPool.UnimplementedLoadBalancerPoolCloudflareServer
  44. }
  45. type args struct {
  46. ctx context.Context
  47. request *loadBalancerPool.IdRequest
  48. }
  49. tests := []struct {
  50. name string
  51. fields fields
  52. args args
  53. want *loadBalancerPool.Empty
  54. wantErr bool
  55. }{
  56. // TODO: Add test cases.
  57. }
  58. for _, tt := range tests {
  59. t.Run(tt.name, func(t *testing.T) {
  60. d := LoadBalancerPoolServer{
  61. UnimplementedLoadBalancerPoolCloudflareServer: tt.fields.UnimplementedLoadBalancerPoolCloudflareServer,
  62. }
  63. got, err := d.Delete(tt.args.ctx, tt.args.request)
  64. if (err != nil) != tt.wantErr {
  65. t.Errorf("Delete() error = %v, wantErr %v", err, tt.wantErr)
  66. return
  67. }
  68. if !reflect.DeepEqual(got, tt.want) {
  69. t.Errorf("Delete() got = %v, want %v", got, tt.want)
  70. }
  71. })
  72. }
  73. }
  74. func TestLoadBalancerPoolServer_List(t *testing.T) {
  75. type fields struct {
  76. UnimplementedLoadBalancerPoolCloudflareServer loadBalancerPool.UnimplementedLoadBalancerPoolCloudflareServer
  77. }
  78. type args struct {
  79. ctx context.Context
  80. request *loadBalancerPool.ListRequest
  81. }
  82. tests := []struct {
  83. name string
  84. fields fields
  85. args args
  86. want *loadBalancerPool.LoadBalancerPoolList
  87. wantErr bool
  88. }{
  89. {
  90. name: "1",
  91. fields: fields{},
  92. args: args{
  93. ctx: nil,
  94. request: &loadBalancerPool.ListRequest{
  95. ApiKey: "2cc87f6213a4c40e5a90c8dced3c9c577eda5",
  96. ApiEmail: "ll@centcloud.net",
  97. },
  98. },
  99. want: nil,
  100. wantErr: false,
  101. },
  102. // TODO: Add test cases.
  103. }
  104. for _, tt := range tests {
  105. t.Run(tt.name, func(t *testing.T) {
  106. d := LoadBalancerPoolServer{
  107. UnimplementedLoadBalancerPoolCloudflareServer: tt.fields.UnimplementedLoadBalancerPoolCloudflareServer,
  108. }
  109. got, err := d.List(tt.args.ctx, tt.args.request)
  110. if (err != nil) != tt.wantErr {
  111. t.Errorf("List() error = %v, wantErr %v", err, tt.wantErr)
  112. return
  113. }
  114. if !reflect.DeepEqual(got, tt.want) {
  115. t.Errorf("List() got = %v, want %v", got, tt.want)
  116. }
  117. })
  118. }
  119. }
  120. func TestLoadBalancerPoolServer_Update(t *testing.T) {
  121. type fields struct {
  122. UnimplementedLoadBalancerPoolCloudflareServer loadBalancerPool.UnimplementedLoadBalancerPoolCloudflareServer
  123. }
  124. type args struct {
  125. ctx context.Context
  126. request *loadBalancerPool.LoadBalancerPoolRequest
  127. }
  128. tests := []struct {
  129. name string
  130. fields fields
  131. args args
  132. want *loadBalancerPool.LoadBalancerPool
  133. wantErr bool
  134. }{
  135. // TODO: Add test cases.
  136. }
  137. for _, tt := range tests {
  138. t.Run(tt.name, func(t *testing.T) {
  139. d := LoadBalancerPoolServer{
  140. UnimplementedLoadBalancerPoolCloudflareServer: tt.fields.UnimplementedLoadBalancerPoolCloudflareServer,
  141. }
  142. got, err := d.Update(tt.args.ctx, tt.args.request)
  143. if (err != nil) != tt.wantErr {
  144. t.Errorf("Update() error = %v, wantErr %v", err, tt.wantErr)
  145. return
  146. }
  147. if !reflect.DeepEqual(got, tt.want) {
  148. t.Errorf("Update() got = %v, want %v", got, tt.want)
  149. }
  150. })
  151. }
  152. }
  153. func TestLoadBalancerPoolServer_Get(t *testing.T) {
  154. type fields struct {
  155. UnimplementedLoadBalancerPoolCloudflareServer loadBalancerPool.UnimplementedLoadBalancerPoolCloudflareServer
  156. }
  157. type args struct {
  158. ctx context.Context
  159. request *loadBalancerPool.IdRequest
  160. }
  161. tests := []struct {
  162. name string
  163. fields fields
  164. args args
  165. want *loadBalancerPool.LoadBalancerPool
  166. wantErr bool
  167. }{
  168. {
  169. name: "1",
  170. fields: fields{},
  171. args: args{
  172. ctx: nil,
  173. request: &loadBalancerPool.IdRequest{
  174. ApiKey: "2cc87f6213a4c40e5a90c8dced3c9c577eda5",
  175. ApiEmail: "ll@centcloud.net",
  176. Id: "6c946466b3d38323661808d5655f3423",
  177. },
  178. },
  179. want: nil,
  180. wantErr: false,
  181. },
  182. // TODO: Add test cases.
  183. }
  184. for _, tt := range tests {
  185. t.Run(tt.name, func(t *testing.T) {
  186. d := LoadBalancerPoolServer{
  187. UnimplementedLoadBalancerPoolCloudflareServer: tt.fields.UnimplementedLoadBalancerPoolCloudflareServer,
  188. }
  189. got, err := d.Get(tt.args.ctx, tt.args.request)
  190. if (err != nil) != tt.wantErr {
  191. t.Errorf("Get() error = %v, wantErr %v", err, tt.wantErr)
  192. return
  193. }
  194. if !reflect.DeepEqual(got, tt.want) {
  195. t.Errorf("Get() got = %v, want %v", got, tt.want)
  196. }
  197. })
  198. }
  199. }