C# Class Microsoft.Protocols.TestSuites.MS_ASHTTP.TestSuiteHelper

A class contains all helper methods used in test cases.
Exibir arquivo Open project: OfficeDev/Interop-TestSuites Class Usage Examples

Public Methods

Method Description
ConvertInstanceIdFormat ( string time ) : string

Try to parse the no separator time string to DateTime

ConvertSyncResponseFromSendString ( ActiveSyncResponseBase syncResponseString ) : SyncResponse

Convert the instance of SendStringResponse to SyncResponse.

CreateCalendarContent ( string fromAddress, string toAddress, string meetingRequestSubject, string occurrences ) : string

Get the calendar content string.

GetPolicyKeyFromSendString ( ActiveSyncResponseBase provisionResponseString ) : string

Get policy key from Provision string response.

GetServerIdFromSyncResponse ( SyncStore syncResponse, string subject ) : string

Get ServerId from Sync response.

GetStatusCodeFromException ( Exception webException ) : string

Get status code from web exception which will be returned by IIS.

GetSyncRequest ( string collectionId, string syncKey ) : SyncRequest

Get the request of Sync command.

IsRetryNeeded ( string shouldBeGotten ) : bool

Get whether retry is needed when get ServerId.

LoadAddCommands ( Response collectionCommands ) : Collection

Load add commands in sync response.

LoadSyncResponse ( ActiveSyncResponseBase response ) : SyncStore

Load sync response to sync store.

VerifySyncRequiredResponseHeaders ( string headers ) : bool

Verify whether X-MS-RP, MS-ASProtocolCommands and MS-ASProtocolVersions headers all exist in response headers.

Method Details

ConvertInstanceIdFormat() public static method

Try to parse the no separator time string to DateTime
public static ConvertInstanceIdFormat ( string time ) : string
time string The specified DateTime string
return string

ConvertSyncResponseFromSendString() public static method

Convert the instance of SendStringResponse to SyncResponse.
public static ConvertSyncResponseFromSendString ( ActiveSyncResponseBase syncResponseString ) : SyncResponse
syncResponseString ActiveSyncResponseBase The SendStringResponse instance to convert.
return SyncResponse

CreateCalendarContent() public static method

Get the calendar content string.
public static CreateCalendarContent ( string fromAddress, string toAddress, string meetingRequestSubject, string occurrences ) : string
fromAddress string The email address of the meeting request sender.
toAddress string The email address of the meeting request receiver.
meetingRequestSubject string The subject of the meeting request.
occurrences string The number of occurrences of the meeting request.
return string

GetPolicyKeyFromSendString() public static method

Get policy key from Provision string response.
public static GetPolicyKeyFromSendString ( ActiveSyncResponseBase provisionResponseString ) : string
provisionResponseString ActiveSyncResponseBase The SendStringResponse instance of Provision command.
return string

GetServerIdFromSyncResponse() public static method

Get ServerId from Sync response.
public static GetServerIdFromSyncResponse ( SyncStore syncResponse, string subject ) : string
syncResponse SyncStore The response of Sync command.
subject string The subject of the email to get.
return string

GetStatusCodeFromException() public static method

Get status code from web exception which will be returned by IIS.
public static GetStatusCodeFromException ( Exception webException ) : string
webException System.Exception Web exception
return string

GetSyncRequest() public static method

Get the request of Sync command.
public static GetSyncRequest ( string collectionId, string syncKey ) : SyncRequest
collectionId string The CollectionId of the folder to sync.
syncKey string The SyncKey of the latest sync.
return SyncRequest

IsRetryNeeded() public static method

Get whether retry is needed when get ServerId.
public static IsRetryNeeded ( string shouldBeGotten ) : bool
shouldBeGotten string Whether the item should be gotten.
return bool

LoadAddCommands() public static method

Load add commands in sync response.
public static LoadAddCommands ( Response collectionCommands ) : Collection
collectionCommands Microsoft.Protocols.TestSuites.Common.Response The add commands response.
return Collection

LoadSyncResponse() public static method

Load sync response to sync store.
public static LoadSyncResponse ( ActiveSyncResponseBase response ) : SyncStore
response ActiveSyncResponseBase The response of Sync command.
return SyncStore

VerifySyncRequiredResponseHeaders() public static method

Verify whether X-MS-RP, MS-ASProtocolCommands and MS-ASProtocolVersions headers all exist in response headers.
public static VerifySyncRequiredResponseHeaders ( string headers ) : bool
headers string The headers returned from response.
return bool