github.com/mdaxf/iac@v0.0.0-20240519030858-58a061660378/controllers/trans/trans_test.go (about)

     1  package trans
     2  
     3  import (
     4  	"reflect"
     5  	"testing"
     6  
     7  	"github.com/gin-gonic/gin"
     8  	"github.com/mdaxf/iac/engine/types"
     9  )
    10  
    11  func TestTranCodeController_ExecuteTranCode(t *testing.T) {
    12  	type args struct {
    13  		ctx *gin.Context
    14  	}
    15  	tests := []struct {
    16  		name string
    17  		e    *TranCodeController
    18  		args args
    19  	}{
    20  		// TODO: Add test cases.
    21  	}
    22  	for _, tt := range tests {
    23  		t.Run(tt.name, func(t *testing.T) {
    24  			tt.e.ExecuteTranCode(tt.args.ctx)
    25  		})
    26  	}
    27  }
    28  
    29  func TestTranCodeController_Execute(t *testing.T) {
    30  	type args struct {
    31  		Code           string
    32  		externalinputs map[string]interface{}
    33  		user           string
    34  		clientid       string
    35  	}
    36  	tests := []struct {
    37  		name    string
    38  		e       *TranCodeController
    39  		args    args
    40  		want    map[string]interface{}
    41  		wantErr bool
    42  	}{
    43  		// TODO: Add test cases.
    44  	}
    45  	for _, tt := range tests {
    46  		t.Run(tt.name, func(t *testing.T) {
    47  			got, err := tt.e.Execute(tt.args.Code, tt.args.externalinputs, tt.args.user, tt.args.clientid)
    48  			if (err != nil) != tt.wantErr {
    49  				t.Errorf("TranCodeController.Execute() error = %v, wantErr %v", err, tt.wantErr)
    50  				return
    51  			}
    52  			if !reflect.DeepEqual(got, tt.want) {
    53  				t.Errorf("TranCodeController.Execute() = %v, want %v", got, tt.want)
    54  			}
    55  		})
    56  	}
    57  }
    58  
    59  func TestTranCodeController_getTransCode(t *testing.T) {
    60  	type args struct {
    61  		name     string
    62  		user     string
    63  		clientid string
    64  	}
    65  	tests := []struct {
    66  		name    string
    67  		e       *TranCodeController
    68  		args    args
    69  		want    types.TranCode
    70  		wantErr bool
    71  	}{
    72  		// TODO: Add test cases.
    73  	}
    74  	for _, tt := range tests {
    75  		t.Run(tt.name, func(t *testing.T) {
    76  			got, err := tt.e.getTransCode(tt.args.name, tt.args.user, tt.args.clientid)
    77  			if (err != nil) != tt.wantErr {
    78  				t.Errorf("TranCodeController.getTransCode() error = %v, wantErr %v", err, tt.wantErr)
    79  				return
    80  			}
    81  			if !reflect.DeepEqual(got, tt.want) {
    82  				t.Errorf("TranCodeController.getTransCode() = %v, want %v", got, tt.want)
    83  			}
    84  		})
    85  	}
    86  }
    87  
    88  func TestTranCodeController_GetTranCodeListFromRespository(t *testing.T) {
    89  	type args struct {
    90  		ctx *gin.Context
    91  	}
    92  	tests := []struct {
    93  		name string
    94  		e    *TranCodeController
    95  		args args
    96  	}{
    97  		// TODO: Add test cases.
    98  	}
    99  	for _, tt := range tests {
   100  		t.Run(tt.name, func(t *testing.T) {
   101  			tt.e.GetTranCodeListFromRespository(tt.args.ctx)
   102  		})
   103  	}
   104  }
   105  
   106  func TestTranCodeController_GetTranCodeDetailFromRespository(t *testing.T) {
   107  	type args struct {
   108  		ctx *gin.Context
   109  	}
   110  	tests := []struct {
   111  		name string
   112  		e    *TranCodeController
   113  		args args
   114  	}{
   115  		// TODO: Add test cases.
   116  	}
   117  	for _, tt := range tests {
   118  		t.Run(tt.name, func(t *testing.T) {
   119  			tt.e.GetTranCodeDetailFromRespository(tt.args.ctx)
   120  		})
   121  	}
   122  }
   123  
   124  func Test_getDataFromRequest(t *testing.T) {
   125  	type args struct {
   126  		ctx *gin.Context
   127  	}
   128  	tests := []struct {
   129  		name    string
   130  		args    args
   131  		want    TranCodeData
   132  		wantErr bool
   133  	}{
   134  		// TODO: Add test cases.
   135  	}
   136  	for _, tt := range tests {
   137  		t.Run(tt.name, func(t *testing.T) {
   138  			got, err := getDataFromRequest(tt.args.ctx)
   139  			if (err != nil) != tt.wantErr {
   140  				t.Errorf("getDataFromRequest() error = %v, wantErr %v", err, tt.wantErr)
   141  				return
   142  			}
   143  			if !reflect.DeepEqual(got, tt.want) {
   144  				t.Errorf("getDataFromRequest() = %v, want %v", got, tt.want)
   145  			}
   146  		})
   147  	}
   148  }