Implementing a test for U4-6035
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user