/// <summary> /// Verify the requirements of the complex type ListItemChangeDefinition. /// </summary> /// <param name="change">The actual ListItemChangeDefinition complex type.</param> private void VerifyListItemChangeDefinition( ListItemChangeDefinition change) { // Verify R1433 // The response have been received successfully, then the following requirement can be captured. // If the response is not received and parsed successfully, the test case will fail before this requirement is captured Site.CaptureRequirement( 1433, @"[The schema of ListItemChangeDefinition is defined as:]" + @" <s:complexType name=""ListItemChangeDefinition"" mixed=""true"">" + @" <s:attribute name=""ChangeType"" type=""tns:ChangeTypeEnum"" />" + @" <s:attribute name=""AfterListId"" type=""core:UniqueIdentifierWithOrWithoutBraces"" />" + @" <s:attribute name=""AfterItemId"" type=""s:unsignedInt"" />" + @" <s:attribute name=""UniqueId"" type=""core:UniqueIdentifierWithOrWithoutBraces"" />" + @" <s:attribute name=""MetaInfo_vti_clientid"" type=""s:string"" />" + @" <s:attribute name=""ServerChangeUnit"" type=""s:string"" />" + @"</s:complexType>"); // Verify the requirements of the ChangeTypeEnum simple type. this.VerifyChangeTypeEnum(); Site.Assert.IsNotNull(change, "The ListItemChangeDefinition cannot be null"); // Verify MS-LISTSWS requirement: MS-LISTSWS_R1437 // If the AfterListId is not null only when the ChangeType is MoveAway, // then the following requirement can be captured. bool isVerifyR1437 = (change.ChangeType == ChangeTypeEnum.MoveAway) ^ (change.AfterListId == null); Site.CaptureRequirementIfIsTrue( isVerifyR1437, 1437, @"[AfterListId]This MUST be set only for a change type of ChangeTypeEnum.MoveAway."); // Verify MS-LISTSWS requirement: MS-LISTSWS_R1439 // If the AfterItemId is not 0 only when the ChangeType is MoveAway, // then the following requirement can be captured. bool isVerifyR1439 = (change.ChangeType == ChangeTypeEnum.MoveAway) ^ (change.AfterItemId == 0); Site.CaptureRequirementIfIsTrue( isVerifyR1439, 1439, @"[AfterItemId]This MUST be set only for a change type of ChangeTypeEnum.MoveAway."); if (Common.IsRequirementEnabled(2423, this.Site)) { // Verify R2423 Site.CaptureRequirementIfIsNull( change.UniqueId, 2423, @"Implementation does not return this attribute[ListItemChangeDefinition.UniqueId]. [In Appendix B: Product Behavior] <20> Section 2.2.4.13: This attribute is not returned in Windows SharePoint Services 3.0."); } if (Common.IsRequirementEnabled(2424, this.Site)) { // Verify R2424 Site.CaptureRequirementIfIsNull( change.MetaInfo_vti_clientid, 2424, @"Implementation does not return this attribute[ListItemChangeDefinition.MetaInfo_vti_clientid]. [In Appendix B: Product Behavior] <21> Section 2.2.4.13: This attribute is not returned in Windows SharePoint Services 3.0."); } if (Common.IsRequirementEnabled(2425, this.Site)) { // Verify R2425 Site.CaptureRequirementIfIsNull( change.ServerChangeUnit, 2425, @"[In Appendix B: Product Behavior] Implemementation does not return this attribute[ServerChangeUnit]. " + "<22> Section 2.2.4.13: This attribute[ServerChangeUnit] is not returned in Windows SharePoint Services 3.0."); } }
/// <summary> /// A method used to verify "ServerChangeUnit" attribute does not return in GetListItemChangesSinceToken operation. /// </summary> /// <param name="change">A parameter represents the instance of ListItemChangeDefinition which will be verify whether contain "ServerChangeUnit" attribute</param> private void VerifyServerChangeUnitAttributeNotReturn(ListItemChangeDefinition change) { // If the ServerChangeUnit is null or empty in response of GetListItemChangesSinceToken operation. Site.CaptureRequirementIfIsTrue( string.IsNullOrEmpty(change.ServerChangeUnit), 1444, @"[ServerChangeUnit:]This attribute is not returned when the element is " + "contained in the GetListItemChangesSinceTokenResult element."); }