Skip to content

Commit ffef6a3

Browse files
supermihimatt-lethargic
authored andcommitted
Update tests project to msbuild 15 and add netcoreapp1.1 target (#87)
* remove unreferenced sources from test project * update test project to MsBuild15 + add netcoreapp1.1 target
1 parent 155ce55 commit ffef6a3

3 files changed

Lines changed: 26 additions & 138 deletions

File tree

src/GeoJSON.Net.Tests/CoordinateReferenceSystem/LinkedCRSTests.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ public void Ctor_Throws_ArgumentNullExpection_When_Href_Uri_Is_Null()
6161
[Test]
6262
public void Ctor_Throws_ArgumentExpection_When_Href_Is_Not_Dereferencable_Uri()
6363
{
64+
#if NETCOREAPP1_1
65+
System.Globalization.CultureInfo.CurrentUICulture = new System.Globalization.CultureInfo("en-US");
66+
#else
6467
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US");
68+
#endif
69+
6570
var argumentExpection = Assert.Throws<ArgumentException>(() => { var crs = new LinkedCRS("http://not-a-valid-<>-url"); });
6671
Assert.AreEqual($"must be a dereferenceable URI{Environment.NewLine}Parameter name: href", argumentExpection.Message);
6772
}
Lines changed: 14 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -1,149 +1,27 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
32
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProductVersion>8.0.30703</ProductVersion>
7-
<SchemaVersion>2.0</SchemaVersion>
3+
84
<ProjectGuid>{6C93B314-9208-4684-B873-172F7EC81689}</ProjectGuid>
9-
<OutputType>Library</OutputType>
10-
<AppDesignerFolder>Properties</AppDesignerFolder>
115
<RootNamespace>GeoJSON.Net.Tests</RootNamespace>
126
<AssemblyName>GeoJSON.Net.Tests</AssemblyName>
13-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
14-
<FileAlignment>512</FileAlignment>
15-
<TargetFrameworkProfile />
7+
<TargetFrameworks>net45;netcoreapp1.1</TargetFrameworks>
8+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
169
</PropertyGroup>
17-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18-
<DebugSymbols>true</DebugSymbols>
19-
<DebugType>full</DebugType>
20-
<Optimize>false</Optimize>
21-
<OutputPath>bin\Debug\</OutputPath>
22-
<DefineConstants>DEBUG;TRACE</DefineConstants>
23-
<ErrorReport>prompt</ErrorReport>
24-
<WarningLevel>4</WarningLevel>
25-
<Prefer32Bit>false</Prefer32Bit>
26-
</PropertyGroup>
27-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28-
<DebugType>pdbonly</DebugType>
29-
<Optimize>true</Optimize>
30-
<OutputPath>bin\Release\</OutputPath>
31-
<DefineConstants>TRACE</DefineConstants>
32-
<ErrorReport>prompt</ErrorReport>
33-
<WarningLevel>4</WarningLevel>
34-
<Prefer32Bit>false</Prefer32Bit>
35-
</PropertyGroup>
36-
<ItemGroup>
37-
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
38-
<HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
39-
</Reference>
40-
<Reference Include="nunit.framework, Version=3.7.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
41-
<HintPath>..\packages\NUnit.3.7.0\lib\net45\nunit.framework.dll</HintPath>
42-
</Reference>
43-
<Reference Include="System" />
44-
<Reference Include="System.Core" />
45-
<Reference Include="Microsoft.CSharp" />
46-
</ItemGroup>
4710
<ItemGroup>
48-
<Compile Include="CoordinateReferenceSystem\DefaultCrsTests.cs" />
49-
<Compile Include="CoordinateReferenceSystem\LinkedCRSTests.cs" />
50-
<Compile Include="CoordinateReferenceSystem\NamedCrsTests.cs" />
51-
<Compile Include="CoordinateReferenceSystem\UnspecifiedCRSTests.cs" />
52-
<Compile Include="Feature\FeatureCollectionTests.cs" />
53-
<Compile Include="Feature\FeatureTests.cs" />
54-
<Compile Include="Feature\GenericFeatureTests.cs" />
55-
<Compile Include="Feature\TestFeatureEnum.cs" />
56-
<Compile Include="Feature\TestFeatureProperty.cs" />
57-
<Compile Include="Geometry\GeometryTests.cs" />
58-
<Compile Include="Geometry\LineStringTests.cs" />
59-
<Compile Include="Geometry\MultiLineStringTests.cs" />
60-
<Compile Include="Geometry\MultiPointTests.cs" />
61-
<Compile Include="Geometry\MultiPolygonTests.cs" />
62-
<Compile Include="Geometry\PointTests.cs" />
63-
<Compile Include="Geometry\PolygonTests.cs" />
64-
<Compile Include="JsonAssert.cs" />
65-
<Compile Include="Properties\AssemblyInfo.cs" />
66-
<Compile Include="TestBase.cs" />
11+
<ProjectReference Include="..\GeoJSON.Net\GeoJSON.Net.csproj" />
12+
<PackageReference Include="NUnit" Version="3.7.0" />
13+
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0-alpha1" />
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
6715
</ItemGroup>
6816
<ItemGroup>
69-
<None Include="app.config" />
70-
<Content Include="Feature\FeatureCollectionTests_Can_Deserialize.json">
71-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
72-
</Content>
73-
<Content Include="Feature\FeatureTests_Can_Deserialize_Point_Feature.json">
74-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
75-
</Content>
76-
<Content Include="Feature\FeatureTests_Can_Serialize_LineString_Feature.json">
77-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
78-
</Content>
79-
<Content Include="Feature\FeatureTests_Can_Serialize_MultiLineString_Feature.json">
80-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
81-
</Content>
82-
<Content Include="Feature\FeatureTests_Can_Serialize_MultiPolygon_Feature.json">
83-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
84-
</Content>
85-
<Content Include="Feature\FeatureTests_Can_Serialize_Point_Feature.json">
86-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
87-
</Content>
88-
<Content Include="Feature\FeatureTests_Can_Serialize_Polygon_Feature.json">
89-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
90-
</Content>
91-
<Content Include="Geometry\LineStringTests_Can_Deserialize.json">
92-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
93-
</Content>
94-
<Content Include="Geometry\LineStringTests_Can_Serialize.json">
95-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
96-
</Content>
97-
<Content Include="Geometry\MultiLineStringTests_Can_Deserialize.json">
17+
<None Update="Feature\*.json">
9818
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
99-
</Content>
100-
<Content Include="Geometry\MultiLineStringTests_Can_Serialize.json">
19+
</None>
20+
<None Update="Geometry\*.json">
10121
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
102-
</Content>
103-
<Content Include="Geometry\MultiPolygonTests_Can_Deserialize.json">
104-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
105-
</Content>
106-
<Content Include="Geometry\MultiPolygonTests_Can_Serialize.json">
107-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
108-
</Content>
109-
<Content Include="Geometry\PolygonTests_Can_Deserialize.json">
110-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
111-
</Content>
112-
<Content Include="Geometry\PolygonTests_Can_Deserialize_With_Exterior_And_Inner_Rings.json">
113-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
114-
</Content>
115-
<Content Include="Geometry\PolygonTests_Can_Serialize.json">
116-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
117-
</Content>
118-
<Content Include="Geometry\MultiPointTests_Can_Deserialize.json">
119-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
120-
</Content>
121-
<Content Include="Geometry\MultiPointTests_Can_Serialize.json">
122-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
123-
</Content>
124-
<Content Include="Feature\GenericFeatureTests_Can_Deserialize_Point_Feature.json">
125-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
126-
</Content>
127-
<Content Include="Feature\GenericFeatureTests_Can_Deserialize_LineString_Feature.json">
128-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
129-
</Content>
130-
<None Include="packages.config" />
22+
</None>
13123
</ItemGroup>
13224
<ItemGroup>
133-
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
134-
</ItemGroup>
135-
<ItemGroup>
136-
<ProjectReference Include="..\GeoJSON.Net\GeoJSON.Net.csproj">
137-
<Project>{8af7c40e-e8c7-425f-a8b1-a4b7e74d3ca9}</Project>
138-
<Name>GeoJSON.Net</Name>
139-
</ProjectReference>
140-
</ItemGroup>
141-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
142-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
143-
Other similar extension points exist, see Microsoft.Common.targets.
144-
<Target Name="BeforeBuild">
145-
</Target>
146-
<Target Name="AfterBuild">
147-
</Target>
148-
-->
25+
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
26+
</ItemGroup>
14927
</Project>

src/GeoJSON.Net.Tests/TestBase.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@ namespace GeoJSON.Net.Tests
77
{
88
public abstract class TestBase
99
{
10-
private static readonly string AssemblyName = typeof(TestBase).Assembly.GetName().Name;
10+
private static readonly Assembly ThisAssembly = typeof(TestBase)
11+
#if NETCOREAPP1_1
12+
.GetTypeInfo()
13+
#endif
14+
.Assembly;
15+
private static readonly string AssemblyName = ThisAssembly.GetName().Name;
1116

1217
public static string AssemblyDirectory
1318
{
1419
get
1520
{
16-
string codeBase = typeof(TestBase).Assembly.CodeBase;
21+
string codeBase = ThisAssembly.CodeBase;
1722
UriBuilder uri = new UriBuilder(codeBase);
1823
string path = Uri.UnescapeDataString(uri.Path);
1924
return Path.GetDirectoryName(path);

0 commit comments

Comments
 (0)