forked from ThatRendle/Simple.Data
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimpleRecordCloneTest.cs
More file actions
36 lines (33 loc) · 1005 Bytes
/
SimpleRecordCloneTest.cs
File metadata and controls
36 lines (33 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
namespace Simple.Data.UnitTest
{
using NUnit.Framework;
[TestFixture]
public class SimpleRecordCloneTest
{
[Test]
public void CloneShouldNotBeSameObject()
{
dynamic target = new SimpleRecord();
var actual = target.Clone();
Assert.AreNotSame(target, actual);
}
[Test]
public void CloneShouldContainSameValues()
{
dynamic target = new SimpleRecord();
target.Name = "Foo";
var actual = target.Clone();
Assert.AreNotSame(target, actual);
Assert.AreEqual(target.Name, actual.Name);
}
[Test]
public void CloneShouldNotChangeWhenOriginalChanges()
{
dynamic target = new SimpleRecord();
target.Name = "Foo";
var actual = target.Clone();
target.Name = "Bar";
Assert.AreEqual("Foo", actual.Name);
}
}
}