comparison HowTo/EditableObjects/IsDirty.cs @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f990fcb411a9
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 }