private ContentAccessor ShortTextTest(string contentTypeName)
{
string originalValue;
string currentValue;
string handlerValue;
string fieldName = "ShortText";
string defaultValue = (string)PropertyType.GetDefaultValue(DataType.String);
string testValue = "TestValue";
string defaultHandlerValue = defaultValue;
string testHandlerValue = testValue;
Content content = Content.CreateNew(contentTypeName, Repository.Root, "FieldTest");
ContentAccessor contentAcc = new ContentAccessor(content);
originalValue = (string)content.Fields[fieldName].OriginalValue;
Assert.IsTrue(originalValue == defaultValue, contentTypeName + "#1");
currentValue = (string)content[fieldName];
Assert.IsTrue(currentValue == defaultValue, contentTypeName + "#2");
handlerValue = (string)content.ContentHandler[fieldName];
Assert.IsTrue(handlerValue == defaultHandlerValue, contentTypeName + "#3");
content[fieldName] = testValue;
originalValue = (string)content.Fields[fieldName].OriginalValue;
Assert.IsTrue(originalValue == defaultValue, contentTypeName + "#4");
currentValue = (string)content[fieldName];
Assert.IsTrue(currentValue == testValue, contentTypeName + "#5");
contentAcc.SaveFields();
originalValue = (string)content.Fields[fieldName].OriginalValue;
Assert.IsTrue(originalValue == testValue, contentTypeName + "#6");
currentValue = (string)content[fieldName];
Assert.IsTrue(currentValue == testValue, contentTypeName + "#7");
handlerValue = (string)content.ContentHandler[fieldName];
Assert.IsTrue(handlerValue == testHandlerValue, contentTypeName + "#8");
content[fieldName] = defaultValue;
originalValue = (string)content.Fields[fieldName].OriginalValue;
Assert.IsTrue(originalValue == testValue, contentTypeName + "#9");
currentValue = (string)content[fieldName];
Assert.IsTrue(currentValue == defaultValue, contentTypeName + "#10");
contentAcc.SaveFields();
originalValue = (string)content.Fields[fieldName].OriginalValue;
Assert.IsTrue(originalValue == defaultValue, contentTypeName + "#11");
currentValue = (string)content[fieldName];
Assert.IsTrue(currentValue == defaultValue, contentTypeName + "#12");
handlerValue = (string)content.ContentHandler[fieldName];
Assert.IsTrue(handlerValue == defaultHandlerValue, contentTypeName + "#13");
return contentAcc;
}
private ContentAccessor LongTextTest(string contentTypeName)