github.com/unionj-cloud/go-doudou@v1.3.8-0.20221011095552-0088008e5b31/cmd/internal/svc/codegen/httpclientproxy_test.go (about)

     1  package codegen
     2  
     3  import (
     4  	"github.com/unionj-cloud/go-doudou/cmd/internal/astutils"
     5  	"os"
     6  	"path/filepath"
     7  	"testing"
     8  )
     9  
    10  func TestGenGoClientProxy(t *testing.T) {
    11  	svcfile := filepath.Join(testDir, "svc.go")
    12  	ic := astutils.BuildInterfaceCollector(svcfile, astutils.ExprString)
    13  
    14  	type args struct {
    15  		dir string
    16  		ic  astutils.InterfaceCollector
    17  	}
    18  	tests := []struct {
    19  		name string
    20  		args args
    21  	}{
    22  		{
    23  			name: "",
    24  			args: args{
    25  				dir: testDir,
    26  				ic:  ic,
    27  			},
    28  		},
    29  	}
    30  	for _, tt := range tests {
    31  		t.Run(tt.name, func(t *testing.T) {
    32  			GenGoClientProxy(tt.args.dir, tt.args.ic)
    33  		})
    34  	}
    35  }
    36  
    37  func TestGenGoClientProxy1(t *testing.T) {
    38  	dir := testDir + "clientproxy"
    39  	InitSvc(dir)
    40  	defer os.RemoveAll(dir)
    41  	svcfile := filepath.Join(testDir, "svc.go")
    42  	ic := astutils.BuildInterfaceCollector(svcfile, astutils.ExprString)
    43  
    44  	type args struct {
    45  		dir string
    46  		ic  astutils.InterfaceCollector
    47  	}
    48  	tests := []struct {
    49  		name string
    50  		args args
    51  	}{
    52  		{
    53  			name: "",
    54  			args: args{
    55  				dir: dir,
    56  				ic:  ic,
    57  			},
    58  		},
    59  	}
    60  	for _, tt := range tests {
    61  		t.Run(tt.name, func(t *testing.T) {
    62  			GenGoClientProxy(tt.args.dir, tt.args.ic)
    63  		})
    64  	}
    65  }