/* 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) } }) } }