C# Class Microsoft.Protocols.TestSuites.Common.Common

A class that contains the common methods used by test suites.
Datei anzeigen Open project: OfficeDev/Interop-TestSuites

Public Methods

Method Description
AddInt16LengthBeforeBinaryArray ( byte bytes ) : byte[]

Add bytes length to the first two bytes of the new array, and append bytes to the new array

CompareByteArray ( byte bytes1, byte bytes2 ) : bool

Compare two byte arrays

CompressAndObfuscateRequest ( byte inputStream, ITestSite site ) : byte[]

Compresses stream using LZ77 algorithm if CompressRpcRequest is set to true in configuration, and obfuscates stream if XorRpcRequest is set to true in configuration. If none of the properties is true, the original stream is returned.

CompressStream ( byte inputStream ) : byte[]

Compresses payload in the stream with LZ77 algorithm and updates the header.

ConvertActiveSyncProtocolVersion ( string originalVersion, ITestSite site ) : string

Convert the ActiveSyncProtocolVersion gotten from ptfconfig file to the string could be used in ActiveSyncClient.

ConvertByteArrayToUint ( byte bytes ) : uint

Convert a byte array to an unsigned integer. If the length of byte array is greater than 4, just convert the first 4 bytes.

CreateAutodiscoverRequest ( string emailAddress, string acceptableResponseSchema ) : AutodiscoverRequest

Creates an Autodiscover request

CreateFolderCreateRequest ( ) : FolderCreateRequest

Creates an empty FolderCreateRequest instance

CreateFolderCreateRequest ( string syncKey, byte type, string displayName, string parentId ) : FolderCreateRequest

Creates a FolderCreateRequest instance using the specified information

CreateFolderDeleteRequest ( ) : FolderDeleteRequest

Creates an empty FolderDeleteRequest instance

CreateFolderDeleteRequest ( string syncKey, string serverId ) : FolderDeleteRequest

Creates a FolderDeleteRequest instance using the specified information

CreateFolderSyncRequest ( string syncKey ) : FolderSyncRequest

Creates a folder Sync request using specified syncKey

CreateFolderUpdateRequest ( ) : FolderUpdateRequest

Creates an empty FolderUpdateRequest instance

CreateFolderUpdateRequest ( string syncKey, string serverId, string displayName, string parentId ) : FolderUpdateRequest

Creates an empty FolderUpdateRequest instance

CreateGetAttachmentRequest ( ) : GetAttachmentRequest

Create GetAttachmentRequest instance, because there is XML body for the GetAttachment command, then the RequestData always will be null

CreateGetItemEstimateRequest ( ) : GetItemEstimateRequest

Creates an empty GetItemEstimateRequest instance

CreateGetItemEstimateRequest ( Request collections ) : GetItemEstimateRequest

Creates a GetItemEstimateRequest using the specified GetItemEstimateCollection array

CreateInitialSyncRequest ( string collectionId ) : SyncRequest

Create an initial Sync request.

CreateItemOperationsRequest ( ) : ItemOperationsRequest

Creates an empty ItemOperationsRequest instance

CreateItemOperationsRequest ( object items ) : ItemOperationsRequest

Creates an ItemOperationsRequest instance using specified items

CreateMeetingRequestMime ( string from, string to, string subject, string body, string icalendarContent ) : string

Create a meeting request mime

CreateMeetingResponseRequest ( ) : MeetingResponseRequest

Create an empty MeetingResponseRequest instance

CreateMeetingResponseRequest ( Request requests ) : MeetingResponseRequest

Create a MeetingResponseRequest instance using specified MeetingResponseRequest array

CreateMoveItemsRequest ( ) : MoveItemsRequest

Create an empty MoveItemsRequest instance

CreateMoveItemsRequest ( Request items ) : MoveItemsRequest

Create a MoveItemsRequest instance using specified MoveItemsMove array

CreatePingRequest ( ) : PingRequest

Create an empty PingRequest instance

CreatePingRequest ( Request folders, string heartbeatInterval ) : PingRequest

Create a PingRequest instance using specified PingFolder array and heartbeatInterval

CreatePlainTextMime ( string from, string to, string cc, string bcc, string subject, string body, string sender = null, string replyTo = null ) : string

Create a sample plain text mime

CreateProvisionRequest ( ) : ProvisionRequest

Create an empty ProvisionRequest instance

CreateProvisionRequest ( Request deviceInformation, Request policies, Request remoteWipe ) : ProvisionRequest

Create a ProvisionRequest instance using specified information

CreateResolveRecipientsRequest ( ) : ResolveRecipientsRequest

Create an empty ResolveRecipientsRequest instance

CreateResolveRecipientsRequest ( object items ) : ResolveRecipientsRequest

Create a ResolveRecipientsRequest instance using specified information

CreateSearchRequest ( ) : SearchRequest

Create an empty SearchRequest instance

CreateSearchRequest ( Request searchStores ) : SearchRequest

Create a SearchRequest using specified information

CreateSearchRequest ( string keyword, string folderCollectionId ) : SearchRequest

Create a Search request using the specified keyword and folder collection ID

CreateSendMailRequest ( ) : SendMailRequest

Create an empty SendMailRequest instance

CreateSendMailRequest ( string clientId, bool copyToSentItems, string mime ) : SendMailRequest

Builds a SendMail request by using the specified client Id, copyToSentItems option and mail mime content.

CreateSendMailRequest ( string accountId, string clientId, string mime ) : SendMailRequest

Create a SendMailRequest instance using specified information

CreateSettingsRequest ( ) : SettingsRequest

Create an empty SettingsRequest instance

CreateSmartForwardRequest ( ) : SmartForwardRequest

Create an empty SmartForwardRequest instance

CreateSmartForwardRequest ( string accountId, string clientId, string mime, Request source ) : SmartForwardRequest

Create a SmartForwardRequest instance using specified information

CreateSmartReplyRequest ( ) : SmartReplyRequest

Create an empty SmartReplyRequest instance

CreateSmartReplyRequest ( string accountId, string clientId, string mime, Request source ) : SmartReplyRequest

Create a SmartReplyRequest instance using specified information

CreateSyncRequest ( ) : SyncRequest

Creates an empty Sync request

CreateSyncRequest ( Request syncCollections ) : SyncRequest

Creates a Sync request using the specified SyncCollection array

CreateValidateCertRequest ( ) : ValidateCertRequest

Create an empty ValidateCertRequest instance

CreateValidateCertRequest ( byte certificates ) : ValidateCertRequest

Create a ValidateCertRequest by specified the certificates in the byte[][] format

DecompressStream ( byte inputStream ) : byte[]

Decompresses payload in the stream with LZ77 algorithm and updates the header.

FormatBinaryDate ( byte content, int line = 16, int column = 16 ) : string

Format the raw data of Rop request and response.

FormatString ( string format ) : string

Extension of string.Format to use the string as the object to be formatted. When the string argument is null, this extension will treat it as string.Empty

GeneratePrefixOfResourceName ( ITestSite site ) : string

A method used to generate the prefix of a resource name based on the current test case name. For example, if the current test case name is "MSOXCRPC_S01_TC01_TestEcDoConnectEx", the prefix will be "MSOXCRPC_S01_TC01".

GenerateResourceName ( ITestSite site, string resourceName ) : string

A method used to generate a unique name with protocol short name (without dash "-"), resource name and time stamp.

GenerateResourceName ( ITestSite site, string resourceName, uint index ) : string

A method used to generate a unique name with protocol short name (without dash "-"), resource name, index and time stamp when creating multiple resources of the same type.

GetBytesFromBinaryHexString ( string str ) : byte[]

Convert a hex16 string to byte array

GetBytesFromMutiUnicodeString ( string strs ) : byte[]

Convert a string array to byte array

GetBytesFromUnicodeString ( string str ) : byte[]

Convert a string to byte array.

GetCodePageName ( string combinedString ) : string

Get the CodePageName from the CombinedString

GetConfigurationPropertyValue ( string propertyName, ITestSite site ) : string

Get a specified property value from ptfconfig file.

GetContentTypeHeader ( string headerValue ) : string

Get the Content-Type header.

GetDefaultFolderServerId ( FolderSyncResponse folderSyncResponse, FolderType folderType, ITestSite site ) : string

Get the server ID for the given default folder type in the actual FolderSyncResponse.

GetErrorCodeFromException ( WebException webException ) : string

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

GetMailAddress ( string userName, string domain ) : string

Get mailbox by user name and domain.

GetNoSeparatorDateTime ( string time ) : System.DateTime

Try to parse the no separator time string to DateTime

GetSearchStatusCode ( SendStringResponse response ) : string

Get search response status which returned by the SendStringRequest operation.

GetStringFromBinary ( byte bytes, bool isFirstTwoByteStoreLength ) : string

Get string from the byte array. If the byte array contains length, remove the first four byte

GetSutVersion ( ITestSite site ) : SutVersion

Get SUT version.

GetTagName ( string combinedTagAndToken, byte &matchedToken ) : string

Get tag name and token.

GetTimeZone ( string name, int bias ) : string

Get the TimeZone string which is base64 encoded according the specified name and bias. For detailed algorithm refer to [MS-ASDTYPE] 2.6.4 TimeZone

IsDNMatchABNF ( string dn, DNFormat format ) : bool

To determine whether the DN matches regular expression or not. The regular expression is generated according to the ABNF in [MS-OXOABK] section 2.2.1.1.

IsGUID ( byte bytes ) : bool

Check whether the byte array is GUID or not

IsNullTerminatedASCIIStr ( byte bytes ) : bool

Check whether the byte array is null terminated ASCII string.

IsOutputHandleInRopRequest ( ISerializable ropRequest ) : bool

Identify whether the Rop request contains more than one server object handle. Refers to [MS-OXCROPS] for more details.

IsRequirementEnabled ( int requirementId, ITestSite site ) : bool

Check whether the specified requirement is enabled to run or not.

IsStringBase64Encoded ( string stringData ) : bool

This method is used to verify whether the data element is Base64Encoding

IsUtf16LEString ( byte bytes ) : bool

Check whether a byte array is a valid utf16 encoding or not

LoadAddElements ( Response collectionCommands, Collection addElements ) : void

Load sync collection Add elements which are not sync until this sync

LoadChangeElements ( Response collectionCommands, Collection changeElements ) : void

Load Change elements in Sync response

LoadDeleteElements ( Response collectionCommands, Collection deleteElements ) : void

Load Delete elements in Sync response

LoadItemOperationsResponse ( ItemOperationsResponse itemOperations ) : ItemOperationsStore

Convert the ItemOperationsResponse to ItemOperationsStore

LoadSearchResponse ( SearchResponse search ) : SearchStore

Load the SearchStore from the SearchResponse

LoadSyncResponse ( SyncResponse response ) : SyncStore

Load SyncResponse to SyncStore.

MergeConfiguration ( ITestSite site ) : void

Merge common configuration and SHOULD/MAY configuration files.

MergeConfigurationFile ( string configFilename, ITestSite site ) : void

Merge the properties from the specified ptfconfig file.

MergeGlobalConfig ( string globalConfigFilename, ITestSite site ) : void

Merge the properties from the global ptfconfig file.

MergeSHOULDMAYConfig ( ITestSite site ) : void

Merge the properties from the SHOULD/MAY ptfconfig file.

RecordCreatedItem ( string collectionId, string itemSubject ) : CreatedItems

Record items impacted by current test case.

SetSpecifiedPropertyValueByName ( object targetObject, string propertyName, object value ) : void

Set a value in the target object using the specified property name

ToArray ( this nodes ) : XmlNode[]

Extend XmlNodeList can convert to an XmlNode array

ValidateServerCertificate ( object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors ) : bool

Verify the remote Secure Sockets Layer (SSL) certificate used for authentication.

VerifyActualValues ( string elementName, string expectedValues, string actualValue, ITestSite site ) : void

Get all the valid values of one element

XOR ( byte inputStream ) : byte[]

Obfuscates or reverts payload in the stream by applying XOR to each byte of the data with the value 0xA5 and updates the header.

Private Methods

Method Description
FormatCurrentDateTime ( ) : string

Format the current timestamp to this format "HHmmss_fff".

LZ77Compress ( byte inputStream ) : byte[]

Compresses stream using LZ77 algorithm and encodes using Direct2 algorithm.

LZ77Decompress ( byte inputStream, int actualSize ) : byte[]

Decodes stream using Direct2 algorithm and decompresses using LZ77 algorithm.

Method Details

AddInt16LengthBeforeBinaryArray() public static method

Add bytes length to the first two bytes of the new array, and append bytes to the new array
public static AddInt16LengthBeforeBinaryArray ( byte bytes ) : byte[]
bytes byte Original byte array
return byte[]

CompareByteArray() public static method

Compare two byte arrays
public static CompareByteArray ( byte bytes1, byte bytes2 ) : bool
bytes1 byte The first byte array
bytes2 byte The second byte array
return bool

CompressAndObfuscateRequest() public static method

Compresses stream using LZ77 algorithm if CompressRpcRequest is set to true in configuration, and obfuscates stream if XorRpcRequest is set to true in configuration. If none of the properties is true, the original stream is returned.
public static CompressAndObfuscateRequest ( byte inputStream, ITestSite site ) : byte[]
inputStream byte The stream to be compressed and obfuscated. The stream should contain header and payload.
site ITestSite An instance of interface ITestSite which provides logging, assertions, and adapters for test code onto its execution context.
return byte[]

CompressStream() public static method

Compresses payload in the stream with LZ77 algorithm and updates the header.
public static CompressStream ( byte inputStream ) : byte[]
inputStream byte The stream to be compressed. The stream should contain header and payload.
return byte[]

ConvertActiveSyncProtocolVersion() public static method

Convert the ActiveSyncProtocolVersion gotten from ptfconfig file to the string could be used in ActiveSyncClient.
public static ConvertActiveSyncProtocolVersion ( string originalVersion, ITestSite site ) : string
originalVersion string The original ActiveSyncProtocolVersion gotten from ptfconfig file.
site ITestSite An instance of interface ITestSite which provides logging, assertions, and adapters for test code onto its execution context.
return string

ConvertByteArrayToUint() public static method

Convert a byte array to an unsigned integer. If the length of byte array is greater than 4, just convert the first 4 bytes.
public static ConvertByteArrayToUint ( byte bytes ) : uint
bytes byte The byte array to be converted
return uint

CreateAutodiscoverRequest() public static method

Creates an Autodiscover request
public static CreateAutodiscoverRequest ( string emailAddress, string acceptableResponseSchema ) : AutodiscoverRequest
emailAddress string An email address
acceptableResponseSchema string Acceptable response schema
return AutodiscoverRequest

CreateFolderCreateRequest() public static method

Creates an empty FolderCreateRequest instance
public static CreateFolderCreateRequest ( ) : FolderCreateRequest
return FolderCreateRequest

CreateFolderCreateRequest() public static method

Creates a FolderCreateRequest instance using the specified information
public static CreateFolderCreateRequest ( string syncKey, byte type, string displayName, string parentId ) : FolderCreateRequest
syncKey string The syncKey of this request
type byte The type of created folder
displayName string The display name of the folder
parentId string The parentId of the created folder
return FolderCreateRequest

CreateFolderDeleteRequest() public static method

Creates an empty FolderDeleteRequest instance
public static CreateFolderDeleteRequest ( ) : FolderDeleteRequest
return FolderDeleteRequest

CreateFolderDeleteRequest() public static method

Creates a FolderDeleteRequest instance using the specified information
public static CreateFolderDeleteRequest ( string syncKey, string serverId ) : FolderDeleteRequest
syncKey string The syncKey of this request
serverId string Specified the deleted folder's server id
return FolderDeleteRequest

CreateFolderSyncRequest() public static method

Creates a folder Sync request using specified syncKey
public static CreateFolderSyncRequest ( string syncKey ) : FolderSyncRequest
syncKey string Specified sync key
return FolderSyncRequest

CreateFolderUpdateRequest() public static method

Creates an empty FolderUpdateRequest instance
public static CreateFolderUpdateRequest ( ) : FolderUpdateRequest
return FolderUpdateRequest

CreateFolderUpdateRequest() public static method

Creates an empty FolderUpdateRequest instance
public static CreateFolderUpdateRequest ( string syncKey, string serverId, string displayName, string parentId ) : FolderUpdateRequest
syncKey string The syncKey of this request
serverId string Specified the updated folder's server id
displayName string Specified new display name of the folder
parentId string Specified new parentId of the created folder
return FolderUpdateRequest

CreateGetAttachmentRequest() public static method

Create GetAttachmentRequest instance, because there is XML body for the GetAttachment command, then the RequestData always will be null
public static CreateGetAttachmentRequest ( ) : GetAttachmentRequest
return GetAttachmentRequest

CreateGetItemEstimateRequest() public static method

Creates an empty GetItemEstimateRequest instance
public static CreateGetItemEstimateRequest ( ) : GetItemEstimateRequest
return GetItemEstimateRequest

CreateGetItemEstimateRequest() public static method

Creates a GetItemEstimateRequest using the specified GetItemEstimateCollection array
public static CreateGetItemEstimateRequest ( Request collections ) : GetItemEstimateRequest
collections Request Specified GetItemEstimateCollection array
return GetItemEstimateRequest

CreateInitialSyncRequest() public static method

Create an initial Sync request.
public static CreateInitialSyncRequest ( string collectionId ) : SyncRequest
collectionId string The server id of the folder to be synchronized.
return SyncRequest

CreateItemOperationsRequest() public static method

Creates an empty ItemOperationsRequest instance
public static CreateItemOperationsRequest ( ) : ItemOperationsRequest
return ItemOperationsRequest

CreateItemOperationsRequest() public static method

Creates an ItemOperationsRequest instance using specified items
public static CreateItemOperationsRequest ( object items ) : ItemOperationsRequest
items object Specified object items array
return ItemOperationsRequest

CreateMeetingRequestMime() public static method

Create a meeting request mime
public static CreateMeetingRequestMime ( string from, string to, string subject, string body, string icalendarContent ) : string
from string The from address of mail
to string The to address of the mail
subject string The subject of the mail
body string The body content of the mail
icalendarContent string The content of iCalendar required by this meeting
return string

CreateMeetingResponseRequest() public static method

Create an empty MeetingResponseRequest instance
public static CreateMeetingResponseRequest ( ) : MeetingResponseRequest
return MeetingResponseRequest

CreateMeetingResponseRequest() public static method

Create a MeetingResponseRequest instance using specified MeetingResponseRequest array
public static CreateMeetingResponseRequest ( Request requests ) : MeetingResponseRequest
requests Request Specified the MeetingResponseRequest array
return MeetingResponseRequest

CreateMoveItemsRequest() public static method

Create an empty MoveItemsRequest instance
public static CreateMoveItemsRequest ( ) : MoveItemsRequest
return MoveItemsRequest

CreateMoveItemsRequest() public static method

Create a MoveItemsRequest instance using specified MoveItemsMove array
public static CreateMoveItemsRequest ( Request items ) : MoveItemsRequest
items Request Specified the MoveItemsMove array
return MoveItemsRequest

CreatePingRequest() public static method

Create an empty PingRequest instance
public static CreatePingRequest ( ) : PingRequest
return PingRequest

CreatePingRequest() public static method

Create a PingRequest instance using specified PingFolder array and heartbeatInterval
public static CreatePingRequest ( Request folders, string heartbeatInterval ) : PingRequest
folders Request Specified PingFolder array
heartbeatInterval string Specified heartbeatInterval
return PingRequest

CreatePlainTextMime() public static method

Create a sample plain text mime
public static CreatePlainTextMime ( string from, string to, string cc, string bcc, string subject, string body, string sender = null, string replyTo = null ) : string
from string The from address of mail
to string The to address of the mail
cc string The cc address of the mail
bcc string The bcc address of the mail
subject string The subject of the mail
body string The body content of the mail
sender string The sender of the mail
replyTo string The replyTo of the mail
return string

CreateProvisionRequest() public static method

Create an empty ProvisionRequest instance
public static CreateProvisionRequest ( ) : ProvisionRequest
return ProvisionRequest

CreateProvisionRequest() public static method

Create a ProvisionRequest instance using specified information
public static CreateProvisionRequest ( Request deviceInformation, Request policies, Request remoteWipe ) : ProvisionRequest
deviceInformation Request Specified the device information
policies Request Specified the policies
remoteWipe Request Specified the remoteWipe
return ProvisionRequest

CreateResolveRecipientsRequest() public static method

Create an empty ResolveRecipientsRequest instance
public static CreateResolveRecipientsRequest ( ) : ResolveRecipientsRequest
return ResolveRecipientsRequest

CreateResolveRecipientsRequest() public static method

Create a ResolveRecipientsRequest instance using specified information
public static CreateResolveRecipientsRequest ( object items ) : ResolveRecipientsRequest
items object Specified the resolve recipients items
return ResolveRecipientsRequest

CreateSearchRequest() public static method

Create an empty SearchRequest instance
public static CreateSearchRequest ( ) : SearchRequest
return SearchRequest

CreateSearchRequest() public static method

Create a SearchRequest using specified information
public static CreateSearchRequest ( Request searchStores ) : SearchRequest
searchStores Request Specified SearchStore arrays
return SearchRequest

CreateSearchRequest() public static method

Create a Search request using the specified keyword and folder collection ID
public static CreateSearchRequest ( string keyword, string folderCollectionId ) : SearchRequest
keyword string Specify a string value for which to search.
folderCollectionId string Specify the folder in which to search.
return SearchRequest

CreateSendMailRequest() public static method

Create an empty SendMailRequest instance
public static CreateSendMailRequest ( ) : SendMailRequest
return SendMailRequest

CreateSendMailRequest() public static method

Builds a SendMail request by using the specified client Id, copyToSentItems option and mail mime content.
public static CreateSendMailRequest ( string clientId, bool copyToSentItems, string mime ) : SendMailRequest
clientId string Specify the client Id
copyToSentItems bool Specify whether needs to store a mail copy to sent items
mime string Specify the mail mime
return SendMailRequest

CreateSendMailRequest() public static method

Create a SendMailRequest instance using specified information
public static CreateSendMailRequest ( string accountId, string clientId, string mime ) : SendMailRequest
accountId string Specified the account Id
clientId string Specified the client Id
mime string Specified the mime
return SendMailRequest

CreateSettingsRequest() public static method

Create an empty SettingsRequest instance
public static CreateSettingsRequest ( ) : SettingsRequest
return SettingsRequest

CreateSmartForwardRequest() public static method

Create an empty SmartForwardRequest instance
public static CreateSmartForwardRequest ( ) : SmartForwardRequest
return SmartForwardRequest

CreateSmartForwardRequest() public static method

Create a SmartForwardRequest instance using specified information
public static CreateSmartForwardRequest ( string accountId, string clientId, string mime, Request source ) : SmartForwardRequest
accountId string Specified the account Id
clientId string Specified the client Id
mime string Specified the mime
source Request Specified the SmartForwardSource
return SmartForwardRequest

CreateSmartReplyRequest() public static method

Create an empty SmartReplyRequest instance
public static CreateSmartReplyRequest ( ) : SmartReplyRequest
return SmartReplyRequest

CreateSmartReplyRequest() public static method

Create a SmartReplyRequest instance using specified information
public static CreateSmartReplyRequest ( string accountId, string clientId, string mime, Request source ) : SmartReplyRequest
accountId string Specified the account Id
clientId string Specified the client Id
mime string Specified the mime
source Request Specified the SmartReplySource
return SmartReplyRequest

CreateSyncRequest() public static method

Creates an empty Sync request
public static CreateSyncRequest ( ) : SyncRequest
return SyncRequest

CreateSyncRequest() public static method

Creates a Sync request using the specified SyncCollection array
public static CreateSyncRequest ( Request syncCollections ) : SyncRequest
syncCollections Request Specified SyncCollection array
return SyncRequest

CreateValidateCertRequest() public static method

Create an empty ValidateCertRequest instance
public static CreateValidateCertRequest ( ) : ValidateCertRequest
return ValidateCertRequest

CreateValidateCertRequest() public static method

Create a ValidateCertRequest by specified the certificates in the byte[][] format
public static CreateValidateCertRequest ( byte certificates ) : ValidateCertRequest
certificates byte Specified the certificates
return ValidateCertRequest

DecompressStream() public static method

Decompresses payload in the stream with LZ77 algorithm and updates the header.
public static DecompressStream ( byte inputStream ) : byte[]
inputStream byte The stream to be decompressed. The stream should contain header and payload.
return byte[]

FormatBinaryDate() public static method

Format the raw data of Rop request and response.
public static FormatBinaryDate ( byte content, int line = 16, int column = 16 ) : string
content byte Raw data of Rops
line int The line of the data to be displayed.
column int The column of the data to be displayed.
return string

FormatString() public static method

Extension of string.Format to use the string as the object to be formatted. When the string argument is null, this extension will treat it as string.Empty
public static FormatString ( string format ) : string
format string A composite format string
return string

GeneratePrefixOfResourceName() public static method

A method used to generate the prefix of a resource name based on the current test case name. For example, if the current test case name is "MSOXCRPC_S01_TC01_TestEcDoConnectEx", the prefix will be "MSOXCRPC_S01_TC01".
public static GeneratePrefixOfResourceName ( ITestSite site ) : string
site ITestSite An instance of interface ITestSite which provides logging, assertions, /// and adapters for test code onto its execution context.
return string

GenerateResourceName() public static method

A method used to generate a unique name with protocol short name (without dash "-"), resource name and time stamp.
public static GenerateResourceName ( ITestSite site, string resourceName ) : string
site ITestSite An instance of interface ITestSite which provides logging, assertions, /// and adapters for test code onto its execution context.
resourceName string A parameter that represents the resource name which is used to combine the unique name
return string

GenerateResourceName() public static method

A method used to generate a unique name with protocol short name (without dash "-"), resource name, index and time stamp when creating multiple resources of the same type.
public static GenerateResourceName ( ITestSite site, string resourceName, uint index ) : string
site ITestSite An instance of interface ITestSite which provides logging, assertions, /// and adapters for test code onto its execution context.
resourceName string A parameter that represents the resource name which is used to combine the unique name
index uint A parameter that represents the index of the resources of the same type, which is used to combine the unique name
return string

GetBytesFromBinaryHexString() public static method

Convert a hex16 string to byte array
public static GetBytesFromBinaryHexString ( string str ) : byte[]
str string The original hex16 string
return byte[]

GetBytesFromMutiUnicodeString() public static method

Convert a string array to byte array
public static GetBytesFromMutiUnicodeString ( string strs ) : byte[]
strs string The string array to be converted
return byte[]

GetBytesFromUnicodeString() public static method

Convert a string to byte array.
public static GetBytesFromUnicodeString ( string str ) : byte[]
str string The string to be converted
return byte[]

GetCodePageName() public static method

Get the CodePageName from the CombinedString
public static GetCodePageName ( string combinedString ) : string
combinedString string a string contain tag name and matched token following the format"identifier|CodePageName|TagName|Token"
return string

GetConfigurationPropertyValue() public static method

Get a specified property value from ptfconfig file.
public static GetConfigurationPropertyValue ( string propertyName, ITestSite site ) : string
propertyName string The name of property.
site ITestSite An instance of interface ITestSite which provides logging, assertions, /// and adapters for test code onto its execution context.
return string

GetContentTypeHeader() public static method

Get the Content-Type header.
public static GetContentTypeHeader ( string headerValue ) : string
headerValue string The string included charset and type in the Content-Type header.
return string

GetDefaultFolderServerId() public static method

Get the server ID for the given default folder type in the actual FolderSyncResponse.
public static GetDefaultFolderServerId ( FolderSyncResponse folderSyncResponse, FolderType folderType, ITestSite site ) : string
folderSyncResponse FolderSyncResponse A FolderSyncResponse returned by previous ActiveSync FolderSync operation.
folderType FolderType Specify the default folder type.
site ITestSite An instance of interface ITestSite which provides logging, assertions, and adapters for test code onto its execution context.
return string

GetErrorCodeFromException() public static method

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

GetMailAddress() public static method

Get mailbox by user name and domain.
public static GetMailAddress ( string userName, string domain ) : string
userName string The user name.
domain string The domain in which the user is.
return string

GetNoSeparatorDateTime() public static method

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

GetSearchStatusCode() public static method

Get search response status which returned by the SendStringRequest operation.
public static GetSearchStatusCode ( SendStringResponse response ) : string
response SendStringResponse The SendStringResponse instance
return string

GetStringFromBinary() public static method

Get string from the byte array. If the byte array contains length, remove the first four byte
public static GetStringFromBinary ( byte bytes, bool isFirstTwoByteStoreLength ) : string
bytes byte The byte array contains string
isFirstTwoByteStoreLength bool Determine if the byte array contains length
return string

GetSutVersion() public static method

Get SUT version.
public static GetSutVersion ( ITestSite site ) : SutVersion
site ITestSite An instance of interface ITestSite which provides logging, assertions, and adapters for test code onto its execution context.
return SutVersion

GetTagName() public static method

Get tag name and token.
public static GetTagName ( string combinedTagAndToken, byte &matchedToken ) : string
combinedTagAndToken string A string contain tag name and matched token following the format"identifier|CodePageName|TagName|Token"
matchedToken byte Output the matched Token
return string

GetTimeZone() public static method

Get the TimeZone string which is base64 encoded according the specified name and bias. For detailed algorithm refer to [MS-ASDTYPE] 2.6.4 TimeZone
public static GetTimeZone ( string name, int bias ) : string
name string The StandardName or DaylightName for TimeZone
bias int The offset from UTC
return string

IsDNMatchABNF() public static method

To determine whether the DN matches regular expression or not. The regular expression is generated according to the ABNF in [MS-OXOABK] section 2.2.1.1.
public static IsDNMatchABNF ( string dn, DNFormat format ) : bool
dn string The distinguished name value to be matched.
format DNFormat The DN format needs to be matched.
return bool

IsGUID() public static method

Check whether the byte array is GUID or not
public static IsGUID ( byte bytes ) : bool
bytes byte The byte array to be checked
return bool

IsNullTerminatedASCIIStr() public static method

Check whether the byte array is null terminated ASCII string.
public static IsNullTerminatedASCIIStr ( byte bytes ) : bool
bytes byte The byte array to be checked
return bool

IsOutputHandleInRopRequest() public static method

Identify whether the Rop request contains more than one server object handle. Refers to [MS-OXCROPS] for more details.
public static IsOutputHandleInRopRequest ( ISerializable ropRequest ) : bool
ropRequest ISerializable ROP request objects.
return bool

IsRequirementEnabled() public static method

Check whether the specified requirement is enabled to run or not.
public static IsRequirementEnabled ( int requirementId, ITestSite site ) : bool
requirementId int The unique requirement number.
site ITestSite An instance of interface ITestSite which provides logging, assertions, /// and adapters for test code onto its execution context.
return bool

IsStringBase64Encoded() public static method

This method is used to verify whether the data element is Base64Encoding
public static IsStringBase64Encoded ( string stringData ) : bool
stringData string The data value
return bool

IsUtf16LEString() public static method

Check whether a byte array is a valid utf16 encoding or not
public static IsUtf16LEString ( byte bytes ) : bool
bytes byte The byte array to be checked
return bool

LoadAddElements() public static method

Load sync collection Add elements which are not sync until this sync
public static LoadAddElements ( Response collectionCommands, Collection addElements ) : void
collectionCommands Response The add operation response
addElements Collection The collection to be loaded in
return void

LoadChangeElements() public static method

Load Change elements in Sync response
public static LoadChangeElements ( Response collectionCommands, Collection changeElements ) : void
collectionCommands Response The change operation response
changeElements Collection The collection to be loaded in
return void

LoadDeleteElements() public static method

Load Delete elements in Sync response
public static LoadDeleteElements ( Response collectionCommands, Collection deleteElements ) : void
collectionCommands Response The delete operation response
deleteElements Collection The collection to be loaded in
return void

LoadItemOperationsResponse() public static method

Convert the ItemOperationsResponse to ItemOperationsStore
public static LoadItemOperationsResponse ( ItemOperationsResponse itemOperations ) : ItemOperationsStore
itemOperations Microsoft.Protocols.TestSuites.Common.Response.ItemOperationsResponse The returned ItemOperations response.
return Microsoft.Protocols.TestSuites.Common.DataStructures.ItemOperationsStore

LoadSearchResponse() public static method

Load the SearchStore from the SearchResponse
public static LoadSearchResponse ( SearchResponse search ) : SearchStore
search Microsoft.Protocols.TestSuites.Common.Response.SearchResponse The returned Search response.
return Microsoft.Protocols.TestSuites.Common.DataStructures.SearchStore

LoadSyncResponse() public static method

Load SyncResponse to SyncStore.
public static LoadSyncResponse ( SyncResponse response ) : SyncStore
response SyncResponse A SyncResponse instance.
return Microsoft.Protocols.TestSuites.Common.DataStructures.SyncStore

MergeConfiguration() public static method

Merge common configuration and SHOULD/MAY configuration files.
public static MergeConfiguration ( ITestSite site ) : void
site ITestSite An instance of interface ITestSite which provides logging, assertions, and adapters for test code onto its execution context.
return void

MergeConfigurationFile() public static method

Merge the properties from the specified ptfconfig file.
public static MergeConfigurationFile ( string configFilename, ITestSite site ) : void
configFilename string ptfconfig filename.
site ITestSite An instance of interface ITestSite which provides logging, assertions, /// and adapters for test code onto its execution context.
return void

MergeGlobalConfig() public static method

Merge the properties from the global ptfconfig file.
public static MergeGlobalConfig ( string globalConfigFilename, ITestSite site ) : void
globalConfigFilename string Global ptfconfig filename.
site ITestSite An instance of interface ITestSite which provides logging, assertions, /// and adapters for test code onto its execution context.
return void

MergeSHOULDMAYConfig() public static method

Merge the properties from the SHOULD/MAY ptfconfig file.
public static MergeSHOULDMAYConfig ( ITestSite site ) : void
site ITestSite An instance of interface ITestSite which provides logging, assertions, /// and adapters for test code onto its execution context.
return void

RecordCreatedItem() public static method

Record items impacted by current test case.
public static RecordCreatedItem ( string collectionId, string itemSubject ) : CreatedItems
collectionId string The CollectionId of the folder which the item is placed.
itemSubject string The subject of the item to delete.
return CreatedItems

SetSpecifiedPropertyValueByName() public static method

Set a value in the target object using the specified property name
public static SetSpecifiedPropertyValueByName ( object targetObject, string propertyName, object value ) : void
targetObject object The target object
propertyName string The property name
value object The property value
return void

ToArray() public static method

Extend XmlNodeList can convert to an XmlNode array
public static ToArray ( this nodes ) : XmlNode[]
nodes this The XmlNodeList array
return XmlNode[]

ValidateServerCertificate() public static method

Verify the remote Secure Sockets Layer (SSL) certificate used for authentication.
public static ValidateServerCertificate ( object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors ) : bool
sender object An object that contains state information for this validation.
certificate X509Certificate The certificate used to authenticate the remote party.
chain X509Chain The chain of certificate authorities associated with the remote certificate.
sslPolicyErrors SslPolicyErrors One or more errors associated with the remote certificate.
return bool

VerifyActualValues() public static method

Get all the valid values of one element
public static VerifyActualValues ( string elementName, string expectedValues, string actualValue, ITestSite site ) : void
elementName string The name of the element.
expectedValues string The array of all expected values.
actualValue string The actual value of one element.
site ITestSite An instance of interface ITestSite which provides logging, assertions, and adapters for test code onto its execution context.
return void

XOR() public static method

Obfuscates or reverts payload in the stream by applying XOR to each byte of the data with the value 0xA5 and updates the header.
public static XOR ( byte inputStream ) : byte[]
inputStream byte The stream to be obfuscated or reverted. The stream should contain header and payload.
return byte[]