-
Notifications
You must be signed in to change notification settings - Fork 113
EditableObjects.IsDirty
Igor Tkachev edited this page May 20, 2016
·
1 revision
The IsDirty property gets a value that indicates whether the object has changed.
IsDirty.cs
using System;
using NUnit.Framework;
using BLToolkit.EditableObjects;
namespace HowTo.EditableObjects
{
[TestFixture]
public class IsDirty
{
public abstract class TestObject : EditableObject<TestObject>
{
public abstract string FirstName { get; set; }
public abstract string LastName { get; set; }
}
[Test]
public void Test()
{
TestObject obj = TestObject.CreateInstance();
Assert.IsFalse(obj.IsDirty);
obj.FirstName = "Tester";
obj.LastName = "Testerson";
Assert.IsTrue(obj.IsDirty);
obj.AcceptChanges();
Assert.IsFalse(obj.IsDirty);
}
}
}