mock

package
v0.0.0-...-1b842a1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NoAttachments = ""

	NoOriginalStartDate = ``

	NoRecurrence = `null`

	NoCancelledOccurrences = ""

	NoExceptionOccurrences = ""

	NoAttendees = `[]`
)

Functions

func ContactBytes

func ContactBytes(middleName string) []byte

ContactBytes returns bytes for Contactable item. When hydrated: contact.GetGivenName() shows differences

func ContactBytesWith

func ContactBytesWith(
	displayName, fileAsName,
	givenName, middleName, surname,
	phone string,
) []byte

func EventBytes

func EventBytes(subject string) []byte

EventBytes returns test byte array representative of full Eventable item.

func EventMessageRequest

func EventMessageRequest(subject string) []byte

EventMessageRequest returns byte representation of EventMessageRequest Special Mock to ensure that EventMessageRequests are transformed properly

func EventMessageResponse

func EventMessageResponse(subject string) []byte

EventMessageResponse returns byte representation of EventMessageResponse Special Mock to ensure that EventMessageResponse emails are transformed properly

func EventWith

func EventWith(
	organizer, subject, body, bodyPreview,
	originalStartDate, startDateTime, endDateTime, recurrence, attendees,
	attachments, cancelledOccurrences, exceptionOccurrences string,
) []byte

EventWith returns bytes for an Eventable item. start and end times should be in the format 2006-01-02T15:04:05.0000000Z. The timezone (Z) will be automatically stripped. A non-utc timezone may produce unexpected results. Body must contain a well-formatted string, consumable in a json payload. IE: no unescaped newlines.

func EventWithAttachment

func EventWithAttachment(subject string) []byte

func EventWithAttendeesBytes

func EventWithAttendeesBytes(subject string) []byte

func EventWithRecurrenceAndCancellationBytes

func EventWithRecurrenceAndCancellationBytes(subject string) []byte

func EventWithRecurrenceAndExceptionAndAttachmentBytes

func EventWithRecurrenceAndExceptionAndAttachmentBytes(subject string) []byte

func EventWithRecurrenceAndExceptionBytes

func EventWithRecurrenceAndExceptionBytes(subject string) []byte

func EventWithRecurrenceBytes

func EventWithRecurrenceBytes(subject, recurrenceTimeZone string) []byte

func EventWithRemovedFields

func EventWithRemovedFields(subject string) []byte

func EventWithSubjectBytes

func EventWithSubjectBytes(subject string) []byte

func MessageBytes

func MessageBytes(subject string) []byte

MessageBytes returns bytes for a Messageable item. Contents verified as working with sample data from kiota-serialization-json-go v0.5.5

func MessageWith

func MessageWith(
	to, from, sender,
	subject, body, preview,
	created, modified, sent, received string,
) []byte

MessageWith returns bytes for a Messageable item. Contents verified as working with sample data from kiota-serialization-json-go v0.5.5 created, modified, sent, and received should be in the format 2006-01-02T15:04:05Z Body must contain a well-formatted string, consumable in a json payload. IE: no unescaped newlines.

func MessageWithBodyBytes

func MessageWithBodyBytes(subject, body, preview string) []byte

MessageWithBodyBytes returns bytes for a Messageable item. Contents verified as working with sample data from kiota-serialization-json-go v0.5.5 Body must contain a well-formatted string, consumable in a json payload. IE: no unescaped newlines.

func MessageWithDirectAttachment

func MessageWithDirectAttachment(subject string) []byte

MessageWithDirectAttachment returns a message with inline attachment Serialized with: kiota-serialization-json-go v0.7.1

func MessageWithItemAttachmentEvent

func MessageWithItemAttachmentEvent(subject string) []byte

func MessageWithItemAttachmentMail

func MessageWithItemAttachmentMail(subject string) []byte

func MessageWithLargeAttachment

func MessageWithLargeAttachment(subject string) []byte

MessageWithDirectAttachment returns a message with a large attachment. This is derived from the message used in MessageWithDirectAttachment Serialized with: kiota-serialization-json-go v0.7.1

func MessageWithNestedItemAttachmentContact

func MessageWithNestedItemAttachmentContact(t *testing.T, nested []byte, subject string) []byte

func MessageWithNestedItemAttachmentEvent

func MessageWithNestedItemAttachmentEvent(subject string) []byte

func MessageWithNestedItemAttachmentMail

func MessageWithNestedItemAttachmentMail(t *testing.T, nested []byte, subject string) []byte

func MessageWithOneDriveAttachment

func MessageWithOneDriveAttachment(subject string) []byte

GetMessageWithOneDriveAttachment returns a message with an OneDrive attachment represented in bytes Serialized with: kiota-serialization-json-go v0.7.1

func MessageWithSizedAttachment

func MessageWithSizedAttachment(subject string, n int) []byte

MessageWithDirectAttachment returns a message an attachment that contains n MB of data. Max limit on N is 35 (imposed by exchange) . Serialized with: kiota-serialization-json-go v0.7.1

func MessageWithSpecialCharacters

func MessageWithSpecialCharacters(subject string) []byte

func MessageWithTwoAttachments

func MessageWithTwoAttachments(subject string) []byte

MessageWithTwoAttachments returns byte representation of message with two attachments Serialized with: kiota-serialization-json-go v0.7.1

func StubMailInfo

func StubMailInfo() details.ItemInfo

Types

type DataCollection

type DataCollection struct {
	LocPath path.Path

	Data         [][]byte
	Names        []string
	ModTimes     []time.Time
	ColState     data.CollectionState
	PrevPath     path.Path
	DeletedItems []bool
	DoNotMerge   bool
	// contains filtered or unexported fields
}

DataCollection represents a mock exchange mailbox

func NewCollection

func NewCollection(
	storagePath path.Path,
	locationPath path.Path,
	numMessagesToReturn int,
) *DataCollection

NewCollection creates an data collection that will return the specified number of mock messages when iterated. Exchange type mail

func NewContactCollection

func NewContactCollection(pathRepresentation path.Path, numMessagesToReturn int) *DataCollection

NewContactCollection creates an data collection that will return the specified number of mock messages when iterated. Exchange type mail

func (DataCollection) DoNotMergeItems

func (medc DataCollection) DoNotMergeItems() bool

func (DataCollection) FullPath

func (medc DataCollection) FullPath() path.Path

func (*DataCollection) Items

func (medc *DataCollection) Items(
	ctx context.Context,
	_ *fault.Bus,
) <-chan data.Item

Items returns a channel that has the next items in the collection. The channel is closed when there are no more items available.

func (DataCollection) LocationPath

func (medc DataCollection) LocationPath() *path.Builder

func (DataCollection) PreviousPath

func (medc DataCollection) PreviousPath() path.Path

func (DataCollection) State

func (medc DataCollection) State() data.CollectionState

Jump to

Keyboard shortcuts

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