test

package
v1.20.1-dexcom-api-val... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2017 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExpectFieldIsValid = func(object map[string]interface{}, field string, value interface{}) {
	checkErrorsFromParseValidateNormalize(object, field, value, []*service.Error{})
}
View Source
var ExpectFieldNotValid = func(object map[string]interface{}, field string, value interface{}, expectedErrors []*service.Error) {
	checkErrorsFromParseValidateNormalize(object, field, value, expectedErrors)
}
View Source
var ParseAndNormalize = func(object map[string]interface{}, field string, value interface{}) data.Datum {
	return checkErrorsFromParseValidateNormalize(object, field, value, []*service.Error{})
}

Functions

func ComposeError added in v1.5.0

func ComposeError(expectedError *service.Error, source string, meta interface{}) *service.Error

func RawBaseObject added in v1.5.0

func RawBaseObject() map[string]interface{}

Types

type AddDatasetDataInput added in v1.20.0

type AddDatasetDataInput struct {
	Context     context.Context
	DatasetData []data.Datum
}

type Datum

type Datum struct {
	*test.Mock
	InitInvocations                      int
	MetaInvocations                      int
	MetaOutputs                          []interface{}
	ParseInvocations                     int
	ParseInputs                          []data.ObjectParser
	ParseOutputs                         []error
	ValidateInvocations                  int
	ValidateInputs                       []data.Validator
	ValidateOutputs                      []error
	NormalizeInvocations                 int
	NormalizeInputs                      []data.Normalizer
	NormalizeOutputs                     []error
	IdentityFieldsInvocations            int
	IdentityFieldsOutputs                []IdentityFieldsOutput
	PayloadInvocations                   int
	PayloadOutputs                       []*map[string]interface{}
	SetUserIDInvocations                 int
	SetUserIDInputs                      []string
	SetDatasetIDInvocations              int
	SetDatasetIDInputs                   []string
	SetActiveInvocations                 int
	SetActiveInputs                      []bool
	SetDeviceIDInvocations               int
	SetDeviceIDInputs                    []*string
	SetCreatedTimeInvocations            int
	SetCreatedTimeInputs                 []string
	SetCreatedUserIDInvocations          int
	SetCreatedUserIDInputs               []string
	SetModifiedTimeInvocations           int
	SetModifiedTimeInputs                []string
	SetModifiedUserIDInvocations         int
	SetModifiedUserIDInputs              []string
	SetDeletedTimeInvocations            int
	SetDeletedTimeInputs                 []string
	SetDeletedUserIDInvocations          int
	SetDeletedUserIDInputs               []string
	DeduplicatorDescriptorValue          *data.DeduplicatorDescriptor
	DeduplicatorDescriptorInvocations    int
	SetDeduplicatorDescriptorInvocations int
}

func NewDatum

func NewDatum() *Datum

func (*Datum) DeduplicatorDescriptor

func (d *Datum) DeduplicatorDescriptor() *data.DeduplicatorDescriptor

func (*Datum) Expectations added in v1.20.0

func (d *Datum) Expectations()

func (*Datum) GetPayload added in v1.20.0

func (d *Datum) GetPayload() *map[string]interface{}

func (*Datum) IdentityFields

func (d *Datum) IdentityFields() ([]string, error)

func (*Datum) Init

func (d *Datum) Init()

func (*Datum) Meta

func (d *Datum) Meta() interface{}

func (*Datum) Normalize

func (d *Datum) Normalize(normalizer data.Normalizer) error

func (*Datum) Parse

func (d *Datum) Parse(parser data.ObjectParser) error

func (*Datum) SetActive

func (d *Datum) SetActive(active bool)

func (*Datum) SetCreatedTime

func (d *Datum) SetCreatedTime(createdTime string)

func (*Datum) SetCreatedUserID

func (d *Datum) SetCreatedUserID(createdUserID string)

func (*Datum) SetDatasetID

func (d *Datum) SetDatasetID(datasetID string)

func (*Datum) SetDeduplicatorDescriptor

func (d *Datum) SetDeduplicatorDescriptor(deduplicatorDescriptor *data.DeduplicatorDescriptor)

func (*Datum) SetDeletedTime

func (d *Datum) SetDeletedTime(deletedTime string)

func (*Datum) SetDeletedUserID

func (d *Datum) SetDeletedUserID(deletedUserID string)

func (*Datum) SetDeviceID added in v1.20.0

func (d *Datum) SetDeviceID(deviceID *string)

func (*Datum) SetModifiedTime

func (d *Datum) SetModifiedTime(modifiedTime string)

func (*Datum) SetModifiedUserID

func (d *Datum) SetModifiedUserID(modifiedUserID string)

func (*Datum) SetUserID

func (d *Datum) SetUserID(userID string)

func (*Datum) Validate

func (d *Datum) Validate(validator data.Validator) error

type Deduplicator

type Deduplicator struct {
	*test.Mock
	NameInvocations               int
	NameOutputs                   []string
	VersionInvocations            int
	VersionOutputs                []string
	RegisterDatasetInvocations    int
	RegisterDatasetInputs         []context.Context
	RegisterDatasetOutputs        []error
	AddDatasetDataInvocations     int
	AddDatasetDataInputs          []AddDatasetDataInput
	AddDatasetDataOutputs         []error
	DeduplicateDatasetInvocations int
	DeduplicateDatasetInputs      []context.Context
	DeduplicateDatasetOutputs     []error
	DeleteDatasetInvocations      int
	DeleteDatasetInputs           []context.Context
	DeleteDatasetOutputs          []error
}

func NewDeduplicator

func NewDeduplicator() *Deduplicator

func (*Deduplicator) AddDatasetData added in v1.5.0

func (d *Deduplicator) AddDatasetData(ctx context.Context, datasetData []data.Datum) error

func (*Deduplicator) DeduplicateDataset added in v1.5.0

func (d *Deduplicator) DeduplicateDataset(ctx context.Context) error

func (*Deduplicator) DeleteDataset added in v1.5.0

func (d *Deduplicator) DeleteDataset(ctx context.Context) error

func (*Deduplicator) Expectations added in v1.20.0

func (d *Deduplicator) Expectations()

func (*Deduplicator) Name added in v1.5.0

func (d *Deduplicator) Name() string

func (*Deduplicator) RegisterDataset added in v1.5.0

func (d *Deduplicator) RegisterDataset(ctx context.Context) error

func (*Deduplicator) Version added in v1.8.0

func (d *Deduplicator) Version() string

type IdentityFieldsOutput

type IdentityFieldsOutput struct {
	IdentityFields []string
	Error          error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL