private void VerifyUpdateListFieldResults(UpdateListResponseUpdateListResultResults results)
{
// Verify R1445
// 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(
1445,
@"[UpdateListFieldResults]Specifies the results from an Add, Update, or Delete "
+ "operation on a list's fields.");
// Verify R1446
// 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(
1446,
@"[The schema of UpdateListFieldResults is defined as :]"
+ @"<s:complexType name=""UpdateListFieldResults"">"
+ @" <s:sequence>"
+ @" <s:element name=""Method"" minOccurs=""0"" maxOccurs=""unbounded"">"
+ @" <s:complexType mixed=""true"">"
+ @" <s:sequence>"
+ @" <s:element name=""ErrorCode"" type=""s:string"" />"
+ @" <s:element name=""ErrorText"" type=""s:string"" minOccurs=""0"" />"
+ @" <s:element name=""Field"" type=""core:FieldDefinition"" minOccurs=""0""/>"
+ @" </s:sequence>"
+ @" <s:attribute name=""ID"" type=""s:string"" />"
+ @" </s:complexType>"
+ @" </s:element>"
+ @" </s:sequence>"
+ @"</s:complexType>");
Site.Assert.IsNotNull(results, "The UpdateListFieldResults cannot be null");
// Verify R1448
string strErrorCode = string.Empty;
if ((results.NewFields != null) && (results.NewFields.Length > 0))
{
strErrorCode = results.NewFields[0].ErrorCode;
}
else if ((results.UpdateFields != null) && (results.UpdateFields.Length > 0))
{
strErrorCode = results.UpdateFields[0].ErrorCode;
}
else if ((results.DeleteFields != null) && (results.DeleteFields.Length > 0))
{
strErrorCode = results.DeleteFields[0].ErrorCode;
}
if (!string.IsNullOrEmpty(strErrorCode))
{
// Verify MS-LISTSWS requirement: MS-LISTSWS_R1448
// If the ErrorCode can be parsed to int, then the following requirement can be captured.
int errorCode = int.MinValue;
bool isVerifyR1448 = int.TryParse(
strErrorCode.Substring(2),
System.Globalization.NumberStyles.HexNumber,
null,
out errorCode);
Site.CaptureRequirementIfIsTrue(
isVerifyR1448,
1448,
@"[ErrorCode:] The string representation of a hexadecimal number indicating "
+ "whether the operation succeeded or failed.");
}
// Verify R1451
// 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(
1451,
@"[Field: ]As specified in [MS-WSSFO2] section 2.2.8.3.3.[A field definition describes "
+ "the structure and format of a field that is used within a list or content type.]");
// Verify R1211
// If all the above requirements are verified, then the requirement can be
// captured.
Site.CaptureRequirement(
1211,
@"[In Complex Types]The Complex type UpdateListFieldResults is used Specifies the "
+ "results from an Add, Update, or Delete operation on a list's fields.");
}