private static void CheckContentListItem2(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(content.Fields["#ContentList2Field1"], "This content should contain #ContentList2Field1 field.");
Assert.IsNotNull(content.Fields["#ContentList2Field2"], "This content should contain #ContentList2Field2 field.");
Assert.IsFalse(content.Fields.ContainsKey("#ContentList1Field1"), "This content shouldn't contain #ContentList1Field1 field.");
Assert.IsFalse(content.Fields.ContainsKey("#ContentList1Field2"), "This content shouldn't contain #ContentList1Field2 field.");
Assert.IsFalse(content.Fields.ContainsKey("#ContentList1Field3"), "This content shouldn't contain #ContentList1Field3 field.");
if (fields["#ContentList2Field2"] != null)
{
var field = fields["#ContentList2Field2"];
switch (check)
{
case Check.Signature:
break;
case Check.FieldValuesKept:
Assert.IsTrue(field.HasValue() && ((decimal)field.OriginalValue == testFieldValueForT2), "#ContentList2Field2 doesn't contain the proper value.");
break;
case Check.FieldValuesNotKept:
//Assert.IsTrue(field.HasValue() == false, "#ContentList2Field2 shouldn't contain any value.");
Assert.IsTrue((decimal)field.OriginalValue == 0, "#ContentList2Field2 shouldn't contain any value.");
break;
default:
throw new ArgumentException("You have to assign a valid value to the check parameter!");
}
}
}