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

Inheritance: Microsoft.Protocols.TestTools.TestClassBase
Show file Open project: OfficeDev/Interop-TestSuites Class Usage Examples

Private Properties

Property Type Description
ClassCleanup void
ClassInitialize void
DeleteCollectedFiles void
GetUniqueResourceName string
MSWOPITestCaseInitialize void
TryVerifyFileUrl bool
VerifyFileUrl void

Protected Methods

Method Description
AddFileToSUT ( bool isMultipleResourcesPerCase = false ) : string

A method is used to add a file with unique file name into the specified document library list, and record the file URL into the AddedFilesRecorder.

CollectNewAddedFileForPutRelativeFile ( string normaUrlOfRelatedFile, string newAddedFileName ) : void

A method is used to collect added file absolute path by specified file name. After collecting the file path, the test suite will remove the collected file in test suite clean up process.

ExcludeFileFromTheCleanUpProcess ( string fileUrl ) : void

A method is used to exclude a new added file's URL from the clean up process. Any files added by "AddFileToSUT" method will be deleted automatically in clean up process. This method will exclude a file from the clean up process.

GetErrorResponseFromWebException ( WebException webException ) : HttpWebResponse

A method is used to get the headers value from a web exception's http response.

GetStatusCodeFromHTTPResponse ( HttpWebResponse response ) : int

This method is used to get the status code value from web exception in an error Http response.

GetUniqueFileName ( bool isMultipleResourcesPerCase = false ) : string

A method is used to get a unique file name for per test cases.

GetUniqueFileNameForPutRelatived ( ) : string

A method is used to get a unique file name for "PutRelativeFile" usage.

InitializeCounterForPerTestCase ( ) : void

A method is used to initialize the resource's counters for per test case.

Private Methods

Method Description
ClassCleanup ( ) : void
ClassInitialize ( Microsoft.VisualStudio.TestTools.UnitTesting.TestContext testContext ) : void
DeleteCollectedFiles ( List collectedFiles ) : void

A method used to delete collected files. If a collected file URL is not a valid file URL, this method will ignore it. If not all the valid file URLs are processed successfully, this method will raise an InvalidOperationException.

GetUniqueResourceName ( string resourceName, bool isMultipleResourcesPerCase = false ) : string

A method used to get unique resource name by specified value.

MSWOPITestCaseInitialize ( ) : void
TryVerifyFileUrl ( string fileUrl, string &errorForInvalidUrl ) : bool

A method used to verify a file URL whether is a valid file URL.

VerifyFileUrl ( string fileUrl ) : void

A method used to check a file URL whether is a valid file URL. If the URL is not a valid file URL, this method will raise a UriFormatException.

Method Details

AddFileToSUT() protected method

A method is used to add a file with unique file name into the specified document library list, and record the file URL into the AddedFilesRecorder.
protected AddFileToSUT ( bool isMultipleResourcesPerCase = false ) : string
isMultipleResourcesPerCase bool A parameter represents bool value indicating this method is used for scenario "multiple resources per case". The default value is false.
return string

CollectNewAddedFileForPutRelativeFile() protected method

A method is used to collect added file absolute path by specified file name. After collecting the file path, the test suite will remove the collected file in test suite clean up process.
protected CollectNewAddedFileForPutRelativeFile ( string normaUrlOfRelatedFile, string newAddedFileName ) : void
normaUrlOfRelatedFile string A parameter represents the related file URL, which is used to locate the new added file's absolute path. The related file must be in same level location of the new added file.
newAddedFileName string A return value represents the file name of the new added file.
return void

ExcludeFileFromTheCleanUpProcess() protected method

A method is used to exclude a new added file's URL from the clean up process. Any files added by "AddFileToSUT" method will be deleted automatically in clean up process. This method will exclude a file from the clean up process.
protected ExcludeFileFromTheCleanUpProcess ( string fileUrl ) : void
fileUrl string A parameter represents the file URL, which is excluded from the clean up process.
return void

GetErrorResponseFromWebException() protected method

A method is used to get the headers value from a web exception's http response.
protected GetErrorResponseFromWebException ( WebException webException ) : HttpWebResponse
webException System.Net.WebException A parameter represents the web exception instance.
return System.Net.HttpWebResponse

GetStatusCodeFromHTTPResponse() protected method

This method is used to get the status code value from web exception in an error Http response.
protected GetStatusCodeFromHTTPResponse ( HttpWebResponse response ) : int
response System.Net.HttpWebResponse A parameter represents the error HTTP response.
return int

GetUniqueFileName() protected method

A method is used to get a unique file name for per test cases.
protected GetUniqueFileName ( bool isMultipleResourcesPerCase = false ) : string
isMultipleResourcesPerCase bool A parameter represents bool value indicating this method is used for scenario "multiple resources per case". The default value is false.
return string

GetUniqueFileNameForPutRelatived() protected method

A method is used to get a unique file name for "PutRelativeFile" usage.
protected GetUniqueFileNameForPutRelatived ( ) : string
return string

InitializeCounterForPerTestCase() protected method

A method is used to initialize the resource's counters for per test case.
protected InitializeCounterForPerTestCase ( ) : void
return void