Skip to content

Commit

Permalink
Merge pull request #1 from tbaert-prest/tbaert-prest-patch-1
Browse files Browse the repository at this point in the history
Update object_type_attribute_impl_test.go
  • Loading branch information
tbaert-prest authored Feb 16, 2024
2 parents 0fee23c + a3aaa29 commit d516aea
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
54 changes: 27 additions & 27 deletions assets/internal/object_type_attribute_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,26 @@ import (
)

func Test_internalObjectTypeAttributeImpl_Create(t *testing.T) {
attributeType := 0
defaultTypeId := 0
var attributeType int
var defaultTypeID int
var minimumCardinality int
var maximumCardinality int
attributeType = 0
defaultTypeID = 0
minimumCardinality = 0
maximumCardinality = 0
payloadMocked := &model.ObjectTypeAttributePayloadScheme{
Name: "Geolocation",
Label: false,
Type: &attributeType,
Description: "",
DefaultTypeId: &defaultTypeId,
DefaultTypeId: &defaultTypeID,
TypeValue: "",
TypeValueMulti: nil,
AdditionalValue: "",
Summable: false,
MinimumCardinality: 0,
MaximumCardinality: 0,
MinimumCardinality: &minimumCardinality,
MaximumCardinality: &maximumCardinality,
Suffix: "",
Hidden: false,
IncludeChildObjectTypes: false,
Expand All @@ -43,7 +49,7 @@ func Test_internalObjectTypeAttributeImpl_Create(t *testing.T) {
type args struct {
ctx context.Context
workspaceID, objectTypeID string
payload *model.ObjectTypeAttributeScheme
payload *model.ObjectTypeAttributePayloadScheme
}

testCases := []struct {
Expand Down Expand Up @@ -166,40 +172,34 @@ func Test_internalObjectTypeAttributeImpl_Create(t *testing.T) {

func Test_internalObjectTypeAttributeImpl_Update(t *testing.T) {

var attributeType int
var defaultTypeID int
var minimumCardinality int
var maximumCardinality int
attributeType = 0
defaultTypeID = 0
minimumCardinality = 0
maximumCardinality = 0
payloadMocked := &model.ObjectTypeAttributePayloadScheme{
WorkspaceId: "g2778e1d-939d-581d-c8e2-9d5g59de456b",
GlobalId: "g2778e1d-939d-581d-c8e2-9d5g59de456b:1330",
ID: "1330",
ObjectType: nil,
Name: "Geolocation",
Label: false,
Type: 0,
Name: "Geolocation",
Label: false,
Type: &attributeType,
Description: "",
DefaultTypeId: 0,
DefaultTypeId: &defaultTypeID,
TypeValue: "",
TypeValueMulti: nil,
AdditionalValue: "",
ReferenceType: nil,
ReferenceObjectTypeId: "",
ReferenceObjectType: nil,
Editable: false,
System: false,
Indexed: false,
Sortable: false,
Summable: false,
MinimumCardinality: 0,
MaximumCardinality: 0,
MinimumCardinality: &minimumCardinality,
MaximumCardinality: &maximumCardinality,
Suffix: "",
Removable: false,
ObjectAttributeExists: false,
Hidden: false,
IncludeChildObjectTypes: false,
UniqueAttribute: false,
RegexValidation: "",
Iql: "",
QlQuery: "",
Options: "",
Position: 6,
}

type fields struct {
Expand All @@ -209,7 +209,7 @@ func Test_internalObjectTypeAttributeImpl_Update(t *testing.T) {
type args struct {
ctx context.Context
workspaceID, objectTypeID, attributeID string
payload *model.ObjectTypeAttributeScheme
payload *model.ObjectTypeAttributePayloadScheme
}

testCases := []struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/infra/models/assets_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ type ObjectTypeAttributePayloadScheme struct {
Label bool `json:"label,omitempty"`
Description string `json:"description,omitempty"`
Type *int `json:"type,omitempty"`
DefaultTypeId *int `json:defaultTypeId,omitempty"`
DefaultTypeId *int `json:"defaultTypeId,omitempty"`
TypeValue string `json:"typeValue,omitempty"`
TypeValueMulti []string `json:"typeValueMulti,omitempty"`
AdditionalValue string `json:"additionalValue,omitempty"`
Expand Down

0 comments on commit d516aea

Please sign in to comment.