0
|
1 using System;
|
|
2 using NUnit.Framework;
|
|
3 using BLToolkit.EditableObjects;
|
|
4
|
|
5 namespace HowTo.EditableObjects
|
|
6 {
|
|
7 [TestFixture]
|
|
8 public class IsDirty
|
|
9 {
|
|
10 public /*[a]*/abstract/*[/a]*/ class TestObject : /*[a]*/EditableObject/*[/a]*/<TestObject>
|
|
11 {
|
|
12 public /*[a]*/abstract/*[/a]*/ string FirstName { get; set; }
|
|
13 public /*[a]*/abstract/*[/a]*/ string LastName { get; set; }
|
|
14 }
|
|
15
|
|
16 [Test]
|
|
17 public void Test()
|
|
18 {
|
|
19 TestObject obj = TestObject./*[a]*/CreateInstance/*[/a]*/();
|
|
20
|
|
21 Assert./*[a]*/IsFalse/*[/a]*/(obj./*[a]*/IsDirty/*[/a]*/);
|
|
22
|
|
23 obj.FirstName = "Tester";
|
|
24 obj.LastName = "Testerson";
|
|
25
|
|
26 Assert./*[a]*/IsTrue/*[/a]*/(obj./*[a]*/IsDirty/*[/a]*/);
|
|
27
|
|
28 obj.AcceptChanges();
|
|
29
|
|
30 Assert./*[a]*/IsFalse/*[/a]*/(obj./*[a]*/IsDirty/*[/a]*/);
|
|
31 }
|
|
32 }
|
|
33 }
|