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);
}
}
} |