public void MSLISTSWS_S03_TC27_GetListItemChangesWithKnowledge_VerifyPrefixOfZrow()
{
Site.Assume.IsTrue(Common.IsRequirementEnabled(24881, this.Site), @"Test is executed only when R24881Enabled is set to true.");
#region Create a new list.
string listName = TestSuiteHelper.CreateList();
#endregion
#region Add a new list item into the new list.
TestSuiteHelper.AddListItems(listName, 1);
#endregion
#region Invoke "GetListItemChangesWithKnowledge" to get last item changes.
GetListItemChangesWithKnowledgeResponseGetListItemChangesWithKnowledgeResult getListItemChangesWithKnowledgeResult = null;
getListItemChangesWithKnowledgeResult
= this.listswsAdapter.GetListItemChangesWithKnowledge(listName, null, null, null, null, null, null, null, null);
Site.Assert.IsNotNull(getListItemChangesWithKnowledgeResult, "The response of \"GetListItemChangesWithKnowledge\" is null!");
#endregion
#region Confirm the Requirement 1141
bool captureR1141 = true;
Site.Assert.IsNotNull(getListItemChangesWithKnowledgeResult.listitems, "The \"listitems\" is null in the response of \"GetListItemChangesWithKnowledge\"");
Site.Assert.IsNotNull(getListItemChangesWithKnowledgeResult.listitems.data, "The \"listitems.data\" is null in the response of \"GetListItemChangesWithKnowledge\"");
Site.Assert.IsNotNull(getListItemChangesWithKnowledgeResult.listitems.data.Any, "The \"listitems.data.Any\" is null in the response of \"GetListItemChangesWithKnowledge\"");
foreach (XmlElement row in getListItemChangesWithKnowledgeResult.listitems.data.Any)
{
System.Collections.IEnumerator attributeEnumerator = row.Attributes.GetEnumerator();
while (attributeEnumerator.MoveNext())
{
XmlAttribute curAttribute = (XmlAttribute)attributeEnumerator.Current;
string attributeName = curAttribute.Name;
string prefix = attributeName.Substring(0, 4);
if (prefix != "ows_")
{
captureR1141 = false;
string errorInfo = string.Format("The prefix of attribute {0} is not \"ows_\"", attributeName);
Site.Log.Add(LogEntryKind.TestFailed, errorInfo);
break;
}
}
}
Site.CaptureRequirementIfIsTrue(
captureR1141,
1141,
"[In GetListItemChangesWithKnowledgeResponse]The names of the attributes containing the list item data in inner z:row elements are prefixed by \"ows_\".");
#endregion
}