Fixes: U4-6035 Properrty.WasDirty() always returns false

This commit is contained in:
Shannon
2015-05-07 11:43:53 +10:00
parent e45b0a53b8
commit 813f1a1f2d
5 changed files with 124 additions and 78 deletions

View File

@@ -712,9 +712,21 @@ namespace Umbraco.Tests.Models
// Act
content.SetPropertyValue("title", "new title");
Assert.That(content.IsEntityDirty(), Is.False);
Assert.That(content.IsDirty(), Is.True);
Assert.That(content.IsPropertyDirty("title"), Is.True);
Assert.That(content.IsAnyUserPropertyDirty(), Is.True);
Assert.That(content.GetDirtyUserProperties().Count(), Is.EqualTo(1));
Assert.That(content.Properties[0].IsDirty(), Is.True);
Assert.That(content.Properties["title"].IsDirty(), Is.True);
content.ResetDirtyProperties(); //this would be like committing the entity
// Assert
Assert.That(content.WasDirty(), Is.True);
Assert.That(content.Properties[0].WasDirty(), Is.True);
Assert.That(content.WasPropertyDirty("title"), Is.True);
Assert.That(content.Properties["title"].IsDirty(), Is.False);
Assert.That(content.Properties["title"].WasDirty(), Is.True);