Skip to content

Commit 65e36e2

Browse files
author
Roman Köhler
committed
#68 fixes Collection<T> types to get generated.
1 parent d18b6c8 commit 65e36e2

File tree

7 files changed

+469
-6090
lines changed

7 files changed

+469
-6090
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
6+
namespace ObjectFiller.Test.BugfixTests
7+
{
8+
using Tynamix.ObjectFiller;
9+
10+
using Xunit;
11+
12+
public class Bug68HashsetCanNotBeCreated
13+
{
14+
[Fact]
15+
public void AHashsetShouldBeGenerated()
16+
{
17+
Filler<HashSet<string>> filler = new Filler<HashSet<string>>();
18+
19+
var hashset = filler.Create();
20+
21+
Assert.NotNull(hashset);
22+
Assert.True(hashset.Any());
23+
}
24+
}
25+
}

Tynamix.ObjectFiller.Test/ListFillingTest.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public void TestFillAllListsExceptArray()
2626
Assert.NotNull(entity.EntityICollection);
2727
Assert.NotNull(entity.EntityIEnumerable);
2828
Assert.NotNull(entity.EntityIList);
29+
Assert.NotNull(entity.EntityHashset);
30+
2931
}
3032

3133
[Fact]
@@ -64,7 +66,7 @@ public void TestFillList()
6466
Assert.NotNull(entity.EntityIEnumerable);
6567
Assert.NotNull(entity.EntityIList);
6668
Assert.NotNull(entity.EntityArray);
67-
69+
Assert.NotNull(entity.EntityHashset);
6870
}
6971

7072
[Fact]
@@ -79,6 +81,7 @@ public void TestIgnoreAllUnknownTypesWithOutException()
7981
Assert.NotNull(entity.EntityICollection);
8082
Assert.NotNull(entity.EntityIEnumerable);
8183
Assert.NotNull(entity.EntityIList);
84+
Assert.NotNull(entity.EntityHashset);
8285
}
8386

8487
[Fact]
@@ -117,6 +120,7 @@ public void GenerateTestDataForASimpleList()
117120
Assert.True(entityCollection.EntityIEnumerable.Any());
118121
Assert.True(entityCollection.EntityIList.Any());
119122
Assert.True(entityCollection.EntityList.Any());
123+
Assert.NotNull(entityCollection.EntityHashset.Any());
120124
}
121125
}
122126

Tynamix.ObjectFiller.Test/TestPoco/ListTest/EntityCollection.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ public class EntityCollection
1515

1616
public IList<Entity> EntityIList { get; set; }
1717

18+
public HashSet<Entity> EntityHashset { get; set; }
19+
1820
public Entity[,] EntityArray { get; set; }
1921
}
2022
}

Tynamix.ObjectFiller.Test/project.json

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,18 @@
55
"tags": [ "" ],
66
"projectUrl": "",
77
"licenseUrl": "",
8-
98
"commands": {
109
"test": "xunit.runner.dnx"
1110
},
12-
1311
"frameworks": {
14-
"dnxcore50": {
15-
"compilationOptions": {"define": ["NETSTD"]}
16-
},
1712
"dnx451": {
18-
"compilationOptions": { "define": [ "NET4X" ] }
13+
"compilationOptions": { "define": [ "NET4X" ] },
14+
"dependencies": {
15+
"xunit": "2.1.0",
16+
"xunit.runner.dnx": "2.1.0-rc1-build204",
17+
"System.Text.RegularExpressions": "4.0.11-beta-23516",
18+
"Tynamix.ObjectFiller": "1.4.2"
19+
}
1920
}
20-
21-
},
22-
23-
"dependencies": {
24-
"xunit": "2.1.0",
25-
"xunit.runner.dnx": "2.1.0-rc1-build204",
26-
"System.Text.RegularExpressions": "4.0.11-beta-23516",
27-
"Tynamix.ObjectFiller": "1.4.1"
2821
}
2922
}

0 commit comments

Comments
 (0)