C# Class Microsoft.Protocols.TestSuites.MS_WOPI.MS_WOPIManagedCodeSUTControlAdapter

The implementation of the IMS-WOPIManagedCodeSUTControlAdapter interface.
Inheritance: Microsoft.Protocols.TestTools.ManagedAdapterBase, IMS_WOPIManagedCodeSUTControlAdapter
Show file Open project: OfficeDev/Interop-TestSuites

Public Methods

Method Description
GetWOPIRootResourceUrl ( string absoluteUrlOfResource, WOPIRootResourceUrlType rootResourceType, string userName, string password, string domain ) : string

A method used to get the WOPI resource URL by specified user credentials.

Initialize ( ITestSite testSite ) : void

The Overridden Initialize method, it includes the initialization logic of this adapter.

Protected Methods

Method Description
GenerateRequestWOPIViewUrl ( string absoluteUrlOfResource, WOPIRootResourceUrlType rootResourceType ) : string

A method is used to generate request URL for viewing a normal resource in WOPI mode.

GetAbsoluteRequestUrlWithToken ( string wopiResourceUrl, string tokenValue ) : string

A method is used to get the absolute request URL with the token.

GetTokenByResponseOfRequestView ( string responseOfRequestViewResource ) : string

A method is used to get the token value from a html response which is returned by WOPI server when it receive a WOPI view request.

GetWOPISrcValueByResponseOfRequestViewFile ( string responseOfRequestViewFile ) : string

A method is used to get the WOPISrc URL parameter value from a html response which is returned by WOPI server when it receive a WOPI view request.

ReadHtmlContentFromResponse ( HttpWebResponse response ) : string

A method is used to read html contents from the http response. If could not read the html contents, it will throw an exception.

TriggerRequestViewByUrl ( string requestViewResourceUrl, string userName, string password, string domain ) : string

A method is used to send a WOPI view request to the WOPI server and get a html response.

Method Details

GenerateRequestWOPIViewUrl() protected method

A method is used to generate request URL for viewing a normal resource in WOPI mode.
protected GenerateRequestWOPIViewUrl ( string absoluteUrlOfResource, WOPIRootResourceUrlType rootResourceType ) : string
absoluteUrlOfResource string A parameter represents the absolute URL of a normal resource.
rootResourceType WOPIRootResourceUrlType A parameter indicating the WOPI root resource URL type.
return string

GetAbsoluteRequestUrlWithToken() protected method

A method is used to get the absolute request URL with the token.
protected GetAbsoluteRequestUrlWithToken ( string wopiResourceUrl, string tokenValue ) : string
wopiResourceUrl string The value of the WOPI request URL.
tokenValue string The value of the token.
return string

GetTokenByResponseOfRequestView() protected method

A method is used to get the token value from a html response which is returned by WOPI server when it receive a WOPI view request.
protected GetTokenByResponseOfRequestView ( string responseOfRequestViewResource ) : string
responseOfRequestViewResource string A parameter represents the html response which should contains token and WOPIsrc URL parameter.
return string

GetWOPIRootResourceUrl() public method

A method used to get the WOPI resource URL by specified user credentials.
public GetWOPIRootResourceUrl ( string absoluteUrlOfResource, WOPIRootResourceUrlType rootResourceType, string userName, string password, string domain ) : string
absoluteUrlOfResource string A parameter represents the absolute URL of normal resource which will be used to get a WOPI resource URL.
rootResourceType WOPIRootResourceUrlType A parameter indicating the WOPI root resource URL type will be return.
userName string A parameter represents the name of user whose associated token will be return in the WOPI resource URL.
password string A parameter represents the password of the user.
domain string A parameter represents the domain of the user.
return string

GetWOPISrcValueByResponseOfRequestViewFile() protected method

A method is used to get the WOPISrc URL parameter value from a html response which is returned by WOPI server when it receive a WOPI view request.
protected GetWOPISrcValueByResponseOfRequestViewFile ( string responseOfRequestViewFile ) : string
responseOfRequestViewFile string A parameter represents the html response which should contains token and WOPIsrc URL parameter.
return string

Initialize() public method

The Overridden Initialize method, it includes the initialization logic of this adapter.
public Initialize ( ITestSite testSite ) : void
testSite ITestSite The ITestSite member of ManagedAdapterBase
return void

ReadHtmlContentFromResponse() protected method

A method is used to read html contents from the http response. If could not read the html contents, it will throw an exception.
protected ReadHtmlContentFromResponse ( HttpWebResponse response ) : string
response System.Net.HttpWebResponse A parameter represents http response which should contain html contents.
return string

TriggerRequestViewByUrl() protected method

A method is used to send a WOPI view request to the WOPI server and get a html response.
protected TriggerRequestViewByUrl ( string requestViewResourceUrl, string userName, string password, string domain ) : string
requestViewResourceUrl string A parameter represents the request URL for viewing a resource by using WOPI mode.
userName string A parameter represents the name of user whose associated token will be return in the HTML content.
password string A parameter represents the password of the user.
domain string A parameter represents the domain of the user.
return string