public void TestCase_S09_TC02_GetVersions_Success_Results_ListId() { // Initialize the service this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain); // Get the GUID of expected list using SUT control Adapter method. string listName = Common.GetConfigurationPropertyValue("MSFSSHTTPFSSHTTPBLibraryName", this.Site); string expectedListGuid = SutPowerShellAdapter.GetListGuidByName(listName); // Invoke "GetVersions"sub-request with correct input parameters. GetVersionsSubRequestType getVersionsSubRequest = SharedTestSuiteHelper.CreateGetVersionsSubRequest(SequenceNumberGenerator.GetCurrentToken()); CellStorageResponse cellStoreageResponse = Adapter.CellStorageRequest( this.DefaultFileUrl, new SubRequestType[] { getVersionsSubRequest }, "1", 2, 2, null, null, null, null, null, null, false); GetVersionsSubResponseType getVersionsSubResponse = SharedTestSuiteHelper.ExtractSubResponse <GetVersionsSubResponseType>(cellStoreageResponse, 0, 0, this.Site); this.Site.Assert.IsNotNull(getVersionsSubResponse, "The object 'getVersionsSubResponse' should not be null."); this.Site.Assert.IsNotNull(getVersionsSubResponse.ErrorCode, "The object 'getVersionsSubResponse.ErrorCode' should not be null."); if (SharedContext.Current.IsMsFsshttpRequirementsCaptured) { // Make sure the error code value in the response equals "Success" Site.Assert.AreEqual <ErrorCodeType>( ErrorCodeType.Success, SharedTestSuiteHelper.ConvertToErrorCodeType(getVersionsSubResponse.ErrorCode, this.Site), @"The response of the ""getVersions"" sub-request on the file {0} should succeed.", this.DefaultFileUrl); // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2302 Site.CaptureRequirementIfAreEqual <System.Guid>( new System.Guid(expectedListGuid), new System.Guid(getVersionsSubResponse.GetVersionsResponse.GetVersionsResult.results.list.id), "MS-FSSHTTP", 2302, @"[In GetVersionsSubResponseType][Results complex type] list.id: Specifies the GUID of the document library in which the file resides."); VersionType version = cellStoreageResponse.ResponseVersion as VersionType; // MinorVersion 3 indicates the protocol server is capable of performing ResourceID specific behavior. if (Common.IsRequirementEnabled(11276, this.Site) && version.MinorVersion == 3) { // Capture the requirement MS-FSSHTTP_R11276 Site.CaptureRequirementIfIsNull( cellStoreageResponse.ResponseCollection.Response[0].ResourceID, "MS-FSSHTTP", 11276, @"[In Appendix B: Product Behavior] The ResourceID attribute [MAY be present when the UseResourceID attribute is set to true in the corresponding Request element, and] is not present otherwise[when the UseResourceID attribute is set to false in the corresponding Request element]. (Microsoft SharePoint Foundation 2010/Microsoft SharePoint Server 2010 and above follow this behavior.)"); } } else { Site.Assert.AreEqual <System.Guid>( new System.Guid(expectedListGuid), new System.Guid(getVersionsSubResponse.GetVersionsResponse.GetVersionsResult.results.list.id), @"[In GetVersionsSubResponseType][Results complex type] list.id: Specifies the GUID of the document library in which the file resides."); } }
public void TestCase_S09_TC02_GetVersions_Success_Results_ListId() { // Initialize the service this.InitializeContext(this.DefaultFileUrl, this.UserName01, this.Password01, this.Domain); // Get the GUID of expected list using SUT control Adapter method. string listName = Common.GetConfigurationPropertyValue("MSFSSHTTPFSSHTTPBLibraryName", this.Site); string expectedListGuid = SutPowerShellAdapter.GetListGuidByName(listName); // Invoke "GetVersions"sub-request with correct input parameters. GetVersionsSubRequestType getVersionsSubRequest = SharedTestSuiteHelper.CreateGetVersionsSubRequest(SequenceNumberGenerator.GetCurrentToken()); CellStorageResponse cellStoreageResponse = Adapter.CellStorageRequest(this.DefaultFileUrl, new SubRequestType[] { getVersionsSubRequest }); GetVersionsSubResponseType getVersionsSubResponse = SharedTestSuiteHelper.ExtractSubResponse <GetVersionsSubResponseType>(cellStoreageResponse, 0, 0, this.Site); this.Site.Assert.IsNotNull(getVersionsSubResponse, "The object 'getVersionsSubResponse' should not be null."); this.Site.Assert.IsNotNull(getVersionsSubResponse.ErrorCode, "The object 'getVersionsSubResponse.ErrorCode' should not be null."); if (SharedContext.Current.IsMsFsshttpRequirementsCaptured) { // Make sure the error code value in the response equals "Success" Site.Assert.AreEqual <ErrorCodeType>( ErrorCodeType.Success, SharedTestSuiteHelper.ConvertToErrorCodeType(getVersionsSubResponse.ErrorCode, this.Site), @"The response of the ""getVersions"" sub-request on the file {0} should succeed.", this.DefaultFileUrl); // Verify MS-FSSHTTP requirement: MS-FSSHTTP_R2302 Site.CaptureRequirementIfAreEqual <System.Guid>( new System.Guid(expectedListGuid), new System.Guid(getVersionsSubResponse.GetVersionsResponse.GetVersionsResult.results.list.id), "MS-FSSHTTP", 2302, @"[In GetVersionsSubResponseType][Results complex type] list.id: Specifies the GUID of the document library in which the file resides."); } else { Site.Assert.AreEqual <System.Guid>( new System.Guid(expectedListGuid), new System.Guid(getVersionsSubResponse.GetVersionsResponse.GetVersionsResult.results.list.id), @"[In GetVersionsSubResponseType][Results complex type] list.id: Specifies the GUID of the document library in which the file resides."); } }