C# Class Microsoft.Protocols.TestSuites.MS_VERSS.AdapterHelper

The class provides the methods to assist MS-VERSSAdapter.
显示文件 Open project: OfficeDev/Interop-TestSuites

Public Methods

Method Description
AreVersionsResultEqual ( VersionData expect, VersionData actual ) : bool

Verify whether the expected versions from GetVersions operation are equal to the responses of other operations.

AreVersionsResultEqual ( string expect, VersionData actual ) : bool

Verify whether the expected versions from GetFileVersions are equal to the actual operation response.

ConstructDocFileFullUrl ( Uri requestUrl, string docLibName, string docName ) : Uri

Generate a doc full URL.

ExtractErrorStringFromSoapFault ( System.Web.Services.Protocols.SoapException exception ) : string

This method is used to extract error string from soap fault.

GetCurrentVersion ( VersionData versions ) : string

Get the current version.

GetPreviousVersion ( VersionData versions ) : string

Get the latest version that is less than the current version.

GetSchemaStringFromXsdFile ( string schemaFilePath ) : string

A method used to get the schema from XSD file. It is designed to read schema definition from XSD file.

Initialize ( ITestSite testSite ) : void

Initialize the AdapterHelper class.

IsCurrentVersionIncreased ( string oldVersion, string currentVersion ) : bool

Check whether the current version was increased.

IsExistElementInSoapBody ( string soapBody, string elementName ) : bool

Verify whether the specified element exists in SOAP body.

IsVersionExist ( VersionData versions, string version ) : bool

Verify whether the specified version exists in all the versions of the file.

ValidateAbsoluteUrlFormat ( Uri url ) : bool

This method is used to verify URL format.

Private Methods

Method Description
AreVersionNumberEqual ( Collection versionsA, Collection versionsB ) : bool

Verify whether the two version numbers are equal.

CompareVersionNumber ( string versionA, string versionB ) : int

Compare the version numbers.

ConvertVersionDataArrayToVersionNumberCollection ( VersionData versionDataArray ) : Collection

Convert an array of VersionData object to a version numbers collection.

ConvertVersionDataToString ( VersionData versionDataArray ) : string

Convert an array of VersionData to string.

Method Details

AreVersionsResultEqual() public static method

Verify whether the expected versions from GetVersions operation are equal to the responses of other operations.
public static AreVersionsResultEqual ( VersionData expect, VersionData actual ) : bool
expect VersionData The expected versions from GetVersions operation response.
actual VersionData The actual versions from other operations response.
return bool

AreVersionsResultEqual() public static method

Verify whether the expected versions from GetFileVersions are equal to the actual operation response.
public static AreVersionsResultEqual ( string expect, VersionData actual ) : bool
expect string The expected version from GetFileVersions method.
actual VersionData The actual version from operation response.
return bool

ConstructDocFileFullUrl() public static method

Generate a doc full URL.
public static ConstructDocFileFullUrl ( Uri requestUrl, string docLibName, string docName ) : Uri
requestUrl System.Uri A Uri indicates the absolute URL for the site collection.
docLibName string The name of library in which a document will be created.
docName string The name of document that will be created.
return System.Uri

ExtractErrorStringFromSoapFault() public static method

This method is used to extract error string from soap fault.
public static ExtractErrorStringFromSoapFault ( System.Web.Services.Protocols.SoapException exception ) : string
exception System.Web.Services.Protocols.SoapException The soap fault that returned from server.
return string

GetCurrentVersion() public static method

Get the current version.
public static GetCurrentVersion ( VersionData versions ) : string
versions VersionData All the versions of file.
return string

GetPreviousVersion() public static method

Get the latest version that is less than the current version.
public static GetPreviousVersion ( VersionData versions ) : string
versions VersionData The versions of specified file.
return string

GetSchemaStringFromXsdFile() public static method

A method used to get the schema from XSD file. It is designed to read schema definition from XSD file.
public static GetSchemaStringFromXsdFile ( string schemaFilePath ) : string
schemaFilePath string A parameter represents a XSD file path where the schema definitions should be loaded.
return string

Initialize() public static method

Initialize the AdapterHelper class.
public static Initialize ( ITestSite testSite ) : void
testSite ITestSite The instance of ITestSite.
return void

IsCurrentVersionIncreased() public static method

Check whether the current version was increased.
public static IsCurrentVersionIncreased ( string oldVersion, string currentVersion ) : bool
oldVersion string The old version.
currentVersion string The current version.
return bool

IsExistElementInSoapBody() public static method

Verify whether the specified element exists in SOAP body.
public static IsExistElementInSoapBody ( string soapBody, string elementName ) : bool
soapBody string A string value indicates the SOAP body.
elementName string A string value indicates the element name.
return bool

IsVersionExist() public static method

Verify whether the specified version exists in all the versions of the file.
public static IsVersionExist ( VersionData versions, string version ) : bool
versions VersionData All the versions of file.
version string The specified version number which will be checked.
return bool

ValidateAbsoluteUrlFormat() public static method

This method is used to verify URL format.
public static ValidateAbsoluteUrlFormat ( Uri url ) : bool
url System.Uri The URL to be verified
return bool