feat: generating code
This commit is contained in:
parent
c329d58970
commit
51663cd8d0
1221 changed files with 271709 additions and 2444 deletions
60
pkg/iaasbeta/model_create_protocol_test.go
Normal file
60
pkg/iaasbeta/model_create_protocol_test.go
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
STACKIT IaaS API
|
||||
|
||||
This API allows you to create and modify IaaS resources.
|
||||
|
||||
API version: 2beta1
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package iaasbeta
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// isOneOf
|
||||
|
||||
func TestCreateProtocol_UnmarshalJSON(t *testing.T) {
|
||||
type args struct {
|
||||
src []byte
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
wantErr bool
|
||||
}{
|
||||
|
||||
{
|
||||
name: "success - int64 1",
|
||||
args: args{
|
||||
src: []byte(`"1"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
|
||||
{
|
||||
name: "success - string null",
|
||||
args: args{
|
||||
src: []byte(`"null"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
v := &CreateProtocol{}
|
||||
if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr {
|
||||
t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
|
||||
}
|
||||
marshalJson, err := v.MarshalJSON()
|
||||
if err != nil {
|
||||
t.Fatalf("failed marshalling CreateProtocol: %v", err)
|
||||
}
|
||||
if string(marshalJson) != string(tt.args.src) {
|
||||
t.Fatalf("wanted %s, get %s", tt.args.src, marshalJson)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue