Implementing a test for U4-6035

This commit is contained in:
Aaron Powell
2014-12-21 17:56:33 +11:00
parent e1106a9d67
commit b8097219fb

View File

@@ -703,6 +703,25 @@ namespace Umbraco.Tests.Models
Assert.That(contentType.WasPropertyDirty("Alias"), Is.True);
}
[Test]
public void After_Committing_Changes_Was_Dirty_Is_True_On_Changed_Property()
{
// Arrange
var contentType = MockedContentTypes.CreateTextpageContentType();
contentType.ResetDirtyProperties(); //reset
var content = MockedContent.CreateTextpageContent(contentType, "test", -1);
content.ResetDirtyProperties();
// Act
content.SetPropertyValue("title", "new title");
content.ResetDirtyProperties(); //this would be like committing the entity
// Assert
Assert.That(content.WasPropertyDirty("title"), Is.True);
Assert.That(content.Properties["title"].IsDirty(), Is.False);
Assert.That(content.Properties["title"].WasDirty(), Is.True);
}
[Test]
public void If_Not_Committed_Was_Dirty_Is_False()
{