C# Class Microsoft.Protocols.TestSuites.MS_COPYS.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
CollectFileToRecorder void
FindOutTheField FieldInformation
TestCaseInitialize void

Protected Methods

Method Description
CollectFileByUrl ( string fileUrl ) : void

A method used to collect a file by specified file URL. The test suite will try to delete all collect files.

GenerateInvalidFileUrl ( string originalFilePath ) : string

A method used to generate invalid file URL by construct a not-existing file name.

GenerateInvalidFolderPathForFileUrl ( string originalFilePath ) : string

A method used to generate invalid file URL by confusing the folder path. The method will confuse the path part which is nearest to the file name part.

GetDestinationFileUrl ( DestinationFileUrlType destinationType ) : string

A method is used to generate the destination URL. The file name in the URL is unique.

GetSourceFileUrl ( SourceFileUrlType sourceFileType ) : string

A method used to get source file URL. The URL's file name is unique.

GetUniqueFileName ( ) : string

A method is used to get a unique name of file which is used to upload into document library list.

SelectFieldBySpecifiedAtrribute ( FieldInformation fields, string expectedAttributeValue, FieldAttributeType usedAttribute ) : FieldInformation

A method used to select a field by specified field attribute value. The "DisplayName" is not a unique identifier for a field, so the method return the first match item when using "DisplayName" attribute value. If there are no any fields are found, this method will raise an InvalidOperationException.

UploadTxtFileByFileUrl ( string fileUrl ) : void

A method used to upload a txt file to the destination SUT.

VerifyAllCopyResultsSuccess ( CopyResult copyResults, bool raiseAssertEx = true ) : bool

A method used to verify whether all copy results are successful. If there is any non-success copy result, it raise an exception.

Private Methods

Method Description
ClassCleanup ( ) : void
ClassInitialize ( Microsoft.VisualStudio.TestTools.UnitTesting.TestContext testContext ) : void
CollectFileToRecorder ( string fileUrl ) : void

A method used to collect a file by specified file URL.

FindOutTheField ( FieldInformation fields, string expectedAttributeValue, FieldAttributeType usedAttribute ) : FieldInformation

A method used to find out a field by specified field attribute value. The "DisplayName" is not a unique identifier for a field, so the method return the first match item when using "DisplayName" attribute value.

TestCaseInitialize ( ) : void

Method Details

CollectFileByUrl() protected method

A method used to collect a file by specified file URL. The test suite will try to delete all collect files.
protected CollectFileByUrl ( string fileUrl ) : void
fileUrl string A parameter represents the URL of a file which will be collected to delete. The file must be stored in the destination SUT which is indicated by "SutComputerName" property in "SharePointCommonConfiguration.deployment.ptfconfig" file.
return void

GenerateInvalidFileUrl() protected method

A method used to generate invalid file URL by construct a not-existing file name.
protected GenerateInvalidFileUrl ( string originalFilePath ) : string
originalFilePath string A parameter represents the original file path, it must be a valid URL.
return string

GenerateInvalidFolderPathForFileUrl() protected method

A method used to generate invalid file URL by confusing the folder path. The method will confuse the path part which is nearest to the file name part.
protected GenerateInvalidFolderPathForFileUrl ( string originalFilePath ) : string
originalFilePath string A parameter represents the original file path.
return string

GetDestinationFileUrl() protected method

A method is used to generate the destination URL. The file name in the URL is unique.
protected GetDestinationFileUrl ( DestinationFileUrlType destinationType ) : string
destinationType DestinationFileUrlType A parameter represents the destination URL type.
return string

GetSourceFileUrl() protected method

A method used to get source file URL. The URL's file name is unique.
protected GetSourceFileUrl ( SourceFileUrlType sourceFileType ) : string
sourceFileType SourceFileUrlType A parameter represents the source URL type.
return string

GetUniqueFileName() protected method

A method is used to get a unique name of file which is used to upload into document library list.
protected GetUniqueFileName ( ) : string
return string

SelectFieldBySpecifiedAtrribute() protected method

A method used to select a field by specified field attribute value. The "DisplayName" is not a unique identifier for a field, so the method return the first match item when using "DisplayName" attribute value. If there are no any fields are found, this method will raise an InvalidOperationException.
protected SelectFieldBySpecifiedAtrribute ( FieldInformation fields, string expectedAttributeValue, FieldAttributeType usedAttribute ) : FieldInformation
fields FieldInformation A parameter represents the fields array.
expectedAttributeValue string A parameter represents the expected attribute value which is used to match field item.
usedAttribute FieldAttributeType A parameter represents the attribute type which is used to compare with the expected attribute value.
return FieldInformation

UploadTxtFileByFileUrl() protected method

A method used to upload a txt file to the destination SUT.
protected UploadTxtFileByFileUrl ( string fileUrl ) : void
fileUrl string A parameter represents the expected URL of a file which will be uploaded into the destination SUT. The file URL must point to the destination SUT which is indicated by "SutComputerName" property in "SharePointCommonConfiguration.deployment.ptfconfig" file.
return void

VerifyAllCopyResultsSuccess() protected method

A method used to verify whether all copy results are successful. If there is any non-success copy result, it raise an exception.
protected VerifyAllCopyResultsSuccess ( CopyResult copyResults, bool raiseAssertEx = true ) : bool
copyResults CopyResult A parameter represents the copy results collection.
raiseAssertEx bool A parameter indicates the method whether raise an assert exception, if not all the copy result are successful. The 'true' means raise an exception.
return bool