1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- package server
- import (
- cert "cfTest/cloudflareApi/certificate"
- "context"
- "fmt"
- "reflect"
- "testing"
- )
- func TestCertificateServer_ListZoneCertificates(t *testing.T) {
- type fields struct {
- UnimplementedCertificateCloudflareServer cert.UnimplementedCertificateCloudflareServer
- }
- type args struct {
- ctx context.Context
- requestCloudflare *cert.ListZoneCertificatesRequestCloudflare
- }
- tests := []struct {
- name string
- fields fields
- args args
- want *cert.ListZoneCertificatesReplyCloudflare
- wantErr bool
- }{
- // TODO: Add test cases.
- {
- name: "测试用例1",
- fields: fields{
- UnimplementedCertificateCloudflareServer: cert.UnimplementedCertificateCloudflareServer{},
- },
- args: args{
- requestCloudflare: &cert.ListZoneCertificatesRequestCloudflare{
- ApiKey: "2046cc148e3d2cf6f7b715a7b62327f0f4189",
- ApiEmail: "support03@cengcloud.com",
- ZoneId: "e7d8af14a09356edfe8096617c3af187",
- },
- },
- wantErr: false,
- },
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- s := &CertificateServer{
- UnimplementedCertificateCloudflareServer: tt.fields.UnimplementedCertificateCloudflareServer,
- }
- got, err := s.ListZoneCertificates(tt.args.ctx, tt.args.requestCloudflare)
- fmt.Println(got)
- if (err != nil) != tt.wantErr {
- t.Errorf("ListZoneCertificates() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if !reflect.DeepEqual(got, tt.want) {
- t.Errorf("ListZoneCertificates() got = %v, want %v", got, tt.want)
- }
- })
- }
- }
|