Skip to content

Commit 1c6a62b

Browse files
author
Roman Köhler
committed
#69 implemented and tested
1 parent d18b6c8 commit 1c6a62b

File tree

8 files changed

+420
-6080
lines changed

8 files changed

+420
-6080
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
6+
namespace ObjectFiller.Test
7+
{
8+
using ObjectFiller.Test.TestPoco.Person;
9+
10+
using Xunit;
11+
using Tynamix.ObjectFiller;
12+
13+
public class Student : Person
14+
{
15+
public string Class { get; set; }
16+
}
17+
18+
public class TestIgnoranceOfInheritance
19+
{
20+
[Fact]
21+
public void IfIgnoreInheritanceIsSetToTrueTheNameOfTheStudentShouldBeNull()
22+
{
23+
Filler<Student> filler = new Filler<Student>();
24+
filler.Setup().IgnoreInheritance();
25+
var student = filler.Create();
26+
27+
Assert.Null(student.FirstName);
28+
Assert.NotNull(student.Class);
29+
}
30+
31+
[Fact]
32+
public void IfIgnoreInheritanceIsSetToFalseTheNameOfTheStudentShouldNotBeNull()
33+
{
34+
Filler<Student> filler = new Filler<Student>();
35+
filler.Setup()
36+
.OnType<IAddress>().CreateInstanceOf<Address>();
37+
var student = filler.Create();
38+
39+
Assert.NotNull(student.FirstName);
40+
Assert.NotNull(student.Class);
41+
}
42+
}
43+
}

Tynamix.ObjectFiller.Test/project.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,15 @@
1111
},
1212

1313
"frameworks": {
14-
"dnxcore50": {
15-
"compilationOptions": {"define": ["NETSTD"]}
16-
},
1714
"dnx451": {
1815
"compilationOptions": { "define": [ "NET4X" ] }
1916
}
20-
2117
},
2218

2319
"dependencies": {
2420
"xunit": "2.1.0",
2521
"xunit.runner.dnx": "2.1.0-rc1-build204",
2622
"System.Text.RegularExpressions": "4.0.11-beta-23516",
27-
"Tynamix.ObjectFiller": "1.4.1"
23+
"Tynamix.ObjectFiller": "1.5.0-*"
2824
}
2925
}

0 commit comments

Comments
 (0)