Skip to content

Commit d52c5b3

Browse files
committed
Upgraded to AutoFixture 4 and support for netstandard1.5
1 parent 234cfea commit d52c5b3

File tree

7 files changed

+28
-7
lines changed

7 files changed

+28
-7
lines changed

NuGet.config

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<configuration>
4+
<packageSources>
5+
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
6+
<add key="myget AutoFixture" value="https://www.myget.org/F/autofixture/api/v3/index.json" />
7+
</packageSources>
8+
</configuration>

TestStack.Dossier.Tests/DataSources/Dictionaries/Resources/FileDataConventions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class FileDataConventions
1313
[Fact]
1414
public void ApplyConventions()
1515
{
16-
var assembly = typeof(IAnonymousValueSupplier).Assembly;
16+
var assembly = typeof(IAnonymousValueSupplier).GetTypeInfo().Assembly;
1717
var resources = assembly
1818
.GetManifestResourceNames()
1919
.Where(x => x.EndsWith(".txt"))

TestStack.Dossier.Tests/TestStack.Dossier.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<ItemGroup>
88
<PackageReference Include="Castle.Core" Version="4.1.1" />
9-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170727-01" />
9+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
1010
<PackageReference Include="NSubstitute" Version="2.0.3" />
1111
<PackageReference Include="Shouldly" Version="2.8.3" />
1212
<PackageReference Include="System.ComponentModel.Annotations" Version="4.4.0-preview2-25405-01" />

TestStack.Dossier/DataSources/Dictionaries/CachedFileDictionaryRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public IList<string> GetWordsFrom(string dictionary)
2222
else
2323
{
2424
var resourceName = string.Format("TestStack.Dossier.DataSources.Dictionaries.Resources.{0}", name);
25-
words = GetWordsFromEmbeddedResource(GetType().Assembly, resourceName).ToList();
25+
words = GetWordsFromEmbeddedResource(GetType().GetTypeInfo().Assembly, resourceName).ToList();
2626
}
2727

2828
return words;

TestStack.Dossier/Suppliers/DefaultValueSupplier.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Reflection;
23

34
namespace TestStack.Dossier.Suppliers
45
{
@@ -17,7 +18,7 @@ public bool CanSupplyValue(Type type, string propertyName)
1718
public object GenerateAnonymousValue(AnonymousValueFixture any, Type type, string propertyName)
1819
{
1920
// See stackoverflow: http://stackoverflow.com/questions/325426/programmatic-equivalent-of-defaulttype
20-
if (type.IsValueType)
21+
if (type.GetTypeInfo().IsValueType)
2122
{
2223
return Activator.CreateInstance(type);
2324
}

TestStack.Dossier/Suppliers/DefaultValueTypeValueSupplier.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Linq;
3+
using System.Reflection;
34
using Ploeh.AutoFixture;
45
using Ploeh.AutoFixture.Kernel;
56

@@ -13,7 +14,7 @@ public class DefaultValueTypeValueSupplier : IAnonymousValueSupplier
1314
/// <inerhitdoc />
1415
public bool CanSupplyValue(Type type, string propertyName)
1516
{
16-
return type.IsValueType;
17+
return type.GetTypeInfo().IsValueType;
1718
}
1819

1920
/// <inerhitdoc />

TestStack.Dossier/TestStack.Dossier.csproj

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;net45;net40</TargetFrameworks>
4+
<TargetFrameworks>netstandard1.5;net45</TargetFrameworks>
55
</PropertyGroup>
66

77
<ItemGroup>
@@ -139,9 +139,20 @@
139139
</ItemGroup>
140140

141141
<ItemGroup>
142-
<PackageReference Include="AutoFixture" Version="3.50.4" />
143142
<PackageReference Include="Castle.Core" Version="4.1.1" />
144143
<PackageReference Include="NSubstitute" Version="2.0.3" />
145144
</ItemGroup>
146145

146+
<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
147+
<PackageReference Include="AutoFixture">
148+
<Version>4.0.0-alpha.230</Version>
149+
</PackageReference>
150+
</ItemGroup>
151+
152+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.5'">
153+
<PackageReference Include="AutoFixture">
154+
<Version>4.0.0-alpha.230</Version>
155+
</PackageReference>
156+
</ItemGroup>
157+
147158
</Project>

0 commit comments

Comments
 (0)