public void DataTypeEditorControllerTests_DataType_Saved()
{
//Arrange
//create data type in persistence layer
var propEditor = new MandatoryPropertyEditor();
var dataTypeEntity = HiveModelCreationHelper.CreateAttributeType("test", "Test", "");
dataTypeEntity.RenderTypeProvider = propEditor.Id.ToString();
RebelApplicationContext.AddPersistenceData(dataTypeEntity);
var controller = new DataTypeEditorController(GetBackOfficeRequestContext());
controller.InjectDependencies(new Dictionary<string, string>(), new Dictionary<string, string>
{
{"Name", "Hello World"},
{"PropertyEditorId", "5A379AF0-0256-4BE9-9D01-F149603DB257"},
{ "submit.Save", "Save"} //set save flag
}, GetBackOfficeRequestContext(), false);
//Act
var result = controller.EditForm(dataTypeEntity.Id);
//Assert
Assert.IsTrue(result is RedirectToRouteResult);
using (var uow = RebelApplicationContext.Hive.OpenReader<IContentStore>())
{
var latestEntity = uow.Repositories.Schemas.Get<AttributeType>(dataTypeEntity.Id);
Assert.IsTrue(dataTypeEntity.UtcModified < latestEntity.UtcModified);
}
}