-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Tests for EqualBy, Diff And Track.IsDirty
- Loading branch information
1 parent
b0b8b7c
commit 36f76d4
Showing
8 changed files
with
222 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
Gu.State.Tests/Track/Dirty/DirtyTrackerTests.WithInheritance.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
namespace Gu.State.Tests | ||
{ | ||
using NUnit.Framework; | ||
|
||
using static DirtyTrackerTypes; | ||
|
||
public partial class DirtyTrackerTests | ||
{ | ||
public class WithInheritance | ||
{ | ||
[Test] | ||
public void NotDirtyWhenSameType() | ||
{ | ||
var x = new With<BaseClass>(); | ||
var y = new With<BaseClass>(); | ||
using (var tracker = Track.IsDirty(x, y)) | ||
{ | ||
x.Value = new Derived2(); | ||
y.Value = new Derived2(); | ||
Assert.AreEqual(false, tracker.IsDirty); | ||
} | ||
} | ||
|
||
[Test] | ||
public void DirtyWhenDifferentTypes() | ||
{ | ||
var x = new With<BaseClass>(); | ||
var y = new With<BaseClass>(); | ||
using (var tracker = Track.IsDirty(x, y)) | ||
{ | ||
x.Value = new Derived2(); | ||
y.Value = new Derived1(); | ||
Assert.AreEqual(true, tracker.IsDirty); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters