private static void CheckContentListItem1(string encodedPath, Check check)
{
var node = LoadNode(encodedPath);
var content = Content.Create(node);
var fields = content.Fields;
Assert.IsNotNull(node.ContentListType, "ContentListItem ContentListType == null");
Assert.IsTrue(node.ContentListId > 0, "ContentListItem ContentListId == 0");
Assert.IsNotNull(fields["#ContentList1Field1"], "This content should contain #ContentList1Field1 field.");
Assert.IsNotNull(fields["#ContentList1Field2"], "This content should contain #ContentList1Field2 field.");
Assert.IsNotNull(fields["#ContentList1Field3"], "This content should contain #ContentList1Field3 field.");
Assert.IsFalse(fields.ContainsKey("#ContentList2Field1"), "This content shouldn't contain #ContentList2Field1 field.");
Assert.IsFalse(fields.ContainsKey("#ContentList2Field2"), "This content shouldn't contain #ContentList2Field2 field.");
if (fields["#ContentList1Field3"] != null)
{
var field = fields["#ContentList1Field3"];
switch (check)
{
case Check.Signature:
break;
case Check.FieldValuesKept:
Assert.IsTrue(field.HasValue() && (field.OriginalValue.ToString() == testFieldValueForT1), "#ContentList1Field3 doesn't contain the proper value.");
break;
case Check.FieldValuesNotKept:
Assert.IsTrue(field.HasValue() == false, "#ContentList1Field3 shouldn't contain any value.");
break;
default:
throw new ArgumentException("You have to assign a valid value to the check parameter!");
}
}
}