C# Класс Microsoft.Protocols.TestSuites.Common.Common

A class that contains the common methods used by test suites.
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

AddInt16LengthBeforeBinaryArray() публичный статический Метод

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
Результат byte[]

CompareByteArray() публичный статический Метод

Compare two byte arrays
public static CompareByteArray ( byte bytes1, byte bytes2 ) : bool
bytes1 byte The first byte array
bytes2 byte The second byte array
Результат bool

CompressAndObfuscateRequest() публичный статический Метод

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.
Результат byte[]

CompressStream() публичный статический Метод

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.
Результат byte[]

ConvertActiveSyncProtocolVersion() публичный статический Метод

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.
Результат string

ConvertByteArrayToUint() публичный статический Метод

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
Результат uint

CreateAutodiscoverRequest() публичный статический Метод

Creates an Autodiscover request
public static CreateAutodiscoverRequest ( string emailAddress, string acceptableResponseSchema ) : AutodiscoverRequest
emailAddress string An email address
acceptableResponseSchema string Acceptable response schema
Результат AutodiscoverRequest

CreateFolderCreateRequest() публичный статический Метод

Creates an empty FolderCreateRequest instance
public static CreateFolderCreateRequest ( ) : FolderCreateRequest
Результат FolderCreateRequest

CreateFolderCreateRequest() публичный статический Метод

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
Результат FolderCreateRequest

CreateFolderDeleteRequest() публичный статический Метод

Creates an empty FolderDeleteRequest instance
public static CreateFolderDeleteRequest ( ) : FolderDeleteRequest
Результат FolderDeleteRequest

CreateFolderDeleteRequest() публичный статический Метод

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
Результат FolderDeleteRequest

CreateFolderSyncRequest() публичный статический Метод

Creates a folder Sync request using specified syncKey
public static CreateFolderSyncRequest ( string syncKey ) : FolderSyncRequest
syncKey string Specified sync key
Результат FolderSyncRequest

CreateFolderUpdateRequest() публичный статический Метод

Creates an empty FolderUpdateRequest instance
public static CreateFolderUpdateRequest ( ) : FolderUpdateRequest
Результат FolderUpdateRequest

CreateFolderUpdateRequest() публичный статический Метод

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
Результат FolderUpdateRequest

CreateGetAttachmentRequest() публичный статический Метод

Create GetAttachmentRequest instance, because there is XML body for the GetAttachment command, then the RequestData always will be null
public static CreateGetAttachmentRequest ( ) : GetAttachmentRequest
Результат GetAttachmentRequest

CreateGetItemEstimateRequest() публичный статический Метод

Creates an empty GetItemEstimateRequest instance
public static CreateGetItemEstimateRequest ( ) : GetItemEstimateRequest
Результат GetItemEstimateRequest

CreateGetItemEstimateRequest() публичный статический Метод

Creates a GetItemEstimateRequest using the specified GetItemEstimateCollection array
public static CreateGetItemEstimateRequest ( Request collections ) : GetItemEstimateRequest
collections Request Specified GetItemEstimateCollection array
Результат GetItemEstimateRequest

CreateInitialSyncRequest() публичный статический Метод

Create an initial Sync request.
public static CreateInitialSyncRequest ( string collectionId ) : SyncRequest
collectionId string The server id of the folder to be synchronized.
Результат SyncRequest

CreateItemOperationsRequest() публичный статический Метод

Creates an empty ItemOperationsRequest instance
public static CreateItemOperationsRequest ( ) : ItemOperationsRequest
Результат ItemOperationsRequest

CreateItemOperationsRequest() публичный статический Метод

Creates an ItemOperationsRequest instance using specified items
public static CreateItemOperationsRequest ( object items ) : ItemOperationsRequest
items object Specified object items array
Результат ItemOperationsRequest

CreateMeetingRequestMime() публичный статический Метод

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
Результат string

CreateMeetingResponseRequest() публичный статический Метод

Create an empty MeetingResponseRequest instance
public static CreateMeetingResponseRequest ( ) : MeetingResponseRequest
Результат MeetingResponseRequest

CreateMeetingResponseRequest() публичный статический Метод

Create a MeetingResponseRequest instance using specified MeetingResponseRequest array
public static CreateMeetingResponseRequest ( Request requests ) : MeetingResponseRequest
requests Request Specified the MeetingResponseRequest array
Результат MeetingResponseRequest

CreateMoveItemsRequest() публичный статический Метод

Create an empty MoveItemsRequest instance
public static CreateMoveItemsRequest ( ) : MoveItemsRequest
Результат MoveItemsRequest

CreateMoveItemsRequest() публичный статический Метод

Create a MoveItemsRequest instance using specified MoveItemsMove array
public static CreateMoveItemsRequest ( Request items ) : MoveItemsRequest
items Request Specified the MoveItemsMove array
Результат MoveItemsRequest

CreatePingRequest() публичный статический Метод

Create an empty PingRequest instance
public static CreatePingRequest ( ) : PingRequest
Результат PingRequest

CreatePingRequest() публичный статический Метод

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
Результат PingRequest

CreatePlainTextMime() публичный статический Метод

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
Результат string

CreateProvisionRequest() публичный статический Метод

Create an empty ProvisionRequest instance
public static CreateProvisionRequest ( ) : ProvisionRequest
Результат ProvisionRequest

CreateProvisionRequest() публичный статический Метод

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
Результат ProvisionRequest

CreateResolveRecipientsRequest() публичный статический Метод

Create an empty ResolveRecipientsRequest instance
public static CreateResolveRecipientsRequest ( ) : ResolveRecipientsRequest
Результат ResolveRecipientsRequest

CreateResolveRecipientsRequest() публичный статический Метод

Create a ResolveRecipientsRequest instance using specified information
public static CreateResolveRecipientsRequest ( object items ) : ResolveRecipientsRequest
items object Specified the resolve recipients items
Результат ResolveRecipientsRequest

CreateSearchRequest() публичный статический Метод

Create an empty SearchRequest instance
public static CreateSearchRequest ( ) : SearchRequest
Результат SearchRequest

CreateSearchRequest() публичный статический Метод

Create a SearchRequest using specified information
public static CreateSearchRequest ( Request searchStores ) : SearchRequest
searchStores Request Specified SearchStore arrays
Результат SearchRequest

CreateSearchRequest() публичный статический Метод

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.
Результат SearchRequest

CreateSendMailRequest() публичный статический Метод

Create an empty SendMailRequest instance
public static CreateSendMailRequest ( ) : SendMailRequest
Результат SendMailRequest

CreateSendMailRequest() публичный статический Метод

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
Результат SendMailRequest

CreateSendMailRequest() публичный статический Метод

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
Результат SendMailRequest

CreateSettingsRequest() публичный статический Метод

Create an empty SettingsRequest instance
public static CreateSettingsRequest ( ) : SettingsRequest
Результат SettingsRequest

CreateSmartForwardRequest() публичный статический Метод

Create an empty SmartForwardRequest instance
public static CreateSmartForwardRequest ( ) : SmartForwardRequest
Результат SmartForwardRequest

CreateSmartForwardRequest() публичный статический Метод

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
Результат SmartForwardRequest

CreateSmartReplyRequest() публичный статический Метод

Create an empty SmartReplyRequest instance
public static CreateSmartReplyRequest ( ) : SmartReplyRequest
Результат SmartReplyRequest

CreateSmartReplyRequest() публичный статический Метод

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
Результат SmartReplyRequest

CreateSyncRequest() публичный статический Метод

Creates an empty Sync request
public static CreateSyncRequest ( ) : SyncRequest
Результат SyncRequest

CreateSyncRequest() публичный статический Метод

Creates a Sync request using the specified SyncCollection array
public static CreateSyncRequest ( Request syncCollections ) : SyncRequest
syncCollections Request Specified SyncCollection array
Результат SyncRequest

CreateValidateCertRequest() публичный статический Метод

Create an empty ValidateCertRequest instance
public static CreateValidateCertRequest ( ) : ValidateCertRequest
Результат ValidateCertRequest

CreateValidateCertRequest() публичный статический Метод

Create a ValidateCertRequest by specified the certificates in the byte[][] format
public static CreateValidateCertRequest ( byte certificates ) : ValidateCertRequest
certificates byte Specified the certificates
Результат ValidateCertRequest

DecompressStream() публичный статический Метод

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.
Результат byte[]

FormatBinaryDate() публичный статический Метод

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.
Результат string

FormatString() публичный статический Метод

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
Результат string

GeneratePrefixOfResourceName() публичный статический Метод

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.
Результат string

GenerateResourceName() публичный статический Метод

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
Результат string

GenerateResourceName() публичный статический Метод

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
Результат string

GetBytesFromBinaryHexString() публичный статический Метод

Convert a hex16 string to byte array
public static GetBytesFromBinaryHexString ( string str ) : byte[]
str string The original hex16 string
Результат byte[]

GetBytesFromMutiUnicodeString() публичный статический Метод

Convert a string array to byte array
public static GetBytesFromMutiUnicodeString ( string strs ) : byte[]
strs string The string array to be converted
Результат byte[]

GetBytesFromUnicodeString() публичный статический Метод

Convert a string to byte array.
public static GetBytesFromUnicodeString ( string str ) : byte[]
str string The string to be converted
Результат byte[]

GetCodePageName() публичный статический Метод

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"
Результат string

GetConfigurationPropertyValue() публичный статический Метод

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.
Результат string

GetContentTypeHeader() публичный статический Метод

Get the Content-Type header.
public static GetContentTypeHeader ( string headerValue ) : string
headerValue string The string included charset and type in the Content-Type header.
Результат string

GetDefaultFolderServerId() публичный статический Метод

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.
Результат string

GetErrorCodeFromException() публичный статический Метод

Get status code from web exception which will be returned by IIS.
public static GetErrorCodeFromException ( WebException webException ) : string
webException System.Net.WebException Web exception
Результат string

GetMailAddress() публичный статический Метод

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.
Результат string

GetNoSeparatorDateTime() публичный статический Метод

Try to parse the no separator time string to DateTime
public static GetNoSeparatorDateTime ( string time ) : System.DateTime
time string The specified DateTime string
Результат System.DateTime

GetSearchStatusCode() публичный статический Метод

Get search response status which returned by the SendStringRequest operation.
public static GetSearchStatusCode ( SendStringResponse response ) : string
response SendStringResponse The SendStringResponse instance
Результат string

GetStringFromBinary() публичный статический Метод

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
Результат string

GetSutVersion() публичный статический Метод

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.
Результат SutVersion

GetTagName() публичный статический Метод

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
Результат string

GetTimeZone() публичный статический Метод

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
Результат string

IsDNMatchABNF() публичный статический Метод

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.
Результат bool

IsGUID() публичный статический Метод

Check whether the byte array is GUID or not
public static IsGUID ( byte bytes ) : bool
bytes byte The byte array to be checked
Результат bool

IsNullTerminatedASCIIStr() публичный статический Метод

Check whether the byte array is null terminated ASCII string.
public static IsNullTerminatedASCIIStr ( byte bytes ) : bool
bytes byte The byte array to be checked
Результат bool

IsOutputHandleInRopRequest() публичный статический Метод

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.
Результат bool

IsRequirementEnabled() публичный статический Метод

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.
Результат bool

IsStringBase64Encoded() публичный статический Метод

This method is used to verify whether the data element is Base64Encoding
public static IsStringBase64Encoded ( string stringData ) : bool
stringData string The data value
Результат bool

IsUtf16LEString() публичный статический Метод

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
Результат bool

LoadAddElements() публичный статический Метод

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
Результат void

LoadChangeElements() публичный статический Метод

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
Результат void

LoadDeleteElements() публичный статический Метод

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
Результат void

LoadItemOperationsResponse() публичный статический Метод

Convert the ItemOperationsResponse to ItemOperationsStore
public static LoadItemOperationsResponse ( ItemOperationsResponse itemOperations ) : ItemOperationsStore
itemOperations Microsoft.Protocols.TestSuites.Common.Response.ItemOperationsResponse The returned ItemOperations response.
Результат Microsoft.Protocols.TestSuites.Common.DataStructures.ItemOperationsStore

LoadSearchResponse() публичный статический Метод

Load the SearchStore from the SearchResponse
public static LoadSearchResponse ( SearchResponse search ) : SearchStore
search Microsoft.Protocols.TestSuites.Common.Response.SearchResponse The returned Search response.
Результат Microsoft.Protocols.TestSuites.Common.DataStructures.SearchStore

LoadSyncResponse() публичный статический Метод

Load SyncResponse to SyncStore.
public static LoadSyncResponse ( SyncResponse response ) : SyncStore
response SyncResponse A SyncResponse instance.
Результат Microsoft.Protocols.TestSuites.Common.DataStructures.SyncStore

MergeConfiguration() публичный статический Метод

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.
Результат void

MergeConfigurationFile() публичный статический Метод

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.
Результат void

MergeGlobalConfig() публичный статический Метод

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.
Результат void

MergeSHOULDMAYConfig() публичный статический Метод

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.
Результат void

RecordCreatedItem() публичный статический Метод

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.
Результат CreatedItems

SetSpecifiedPropertyValueByName() публичный статический Метод

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
Результат void

ToArray() публичный статический Метод

Extend XmlNodeList can convert to an XmlNode array
public static ToArray ( this nodes ) : XmlNode[]
nodes this The XmlNodeList array
Результат XmlNode[]

ValidateServerCertificate() публичный статический Метод

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.
Результат bool

VerifyActualValues() публичный статический Метод

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.
Результат void

XOR() публичный статический Метод

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.
Результат byte[]