Skip to content
This repository was archived by the owner on Jun 22, 2023. It is now read-only.

Commit 273e00f

Browse files
authored
Merge pull request #26 from airbreather/refactoring/vs2017
Support VS2017
2 parents c4742d0 + 536f662 commit 273e00f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+324
-2350
lines changed

GeoAPI.Tests/DataStructures/IntervalTest.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
namespace GeoAPI.Tests.DataStructures
55
{
6-
[TestFixtureAttribute]
6+
[TestFixture]
77
public class IntervalTest
88
{
9-
[TestAttribute]
9+
[Test]
1010
public void TestIntersectsBasic()
1111
{
1212
Assert.IsTrue(Interval.Create(5, 10).Overlaps(Interval.Create(7, 12)));
@@ -17,7 +17,7 @@ public void TestIntersectsBasic()
1717
Assert.IsTrue(Interval.Create(10, 12).Overlaps(Interval.Create(5, 10)));
1818
}
1919

20-
[TestAttribute]
20+
[Test]
2121
public void TestIntersectsZeroWidthInterval()
2222
{
2323
Assert.IsTrue(Interval.Create(10).Overlaps(Interval.Create(7, 12)));
@@ -28,20 +28,20 @@ public void TestIntersectsZeroWidthInterval()
2828
Assert.IsTrue(Interval.Create(10, 12).Overlaps(Interval.Create(10)));
2929
}
3030

31-
[TestAttribute]
31+
[Test]
3232
public void TestCopyConstructor()
3333
{
3434
Assert.IsTrue(IntervalsAreEqual(Interval.Create(3, 4), Interval.Create(3, 4)));
3535
Assert.IsTrue(IntervalsAreEqual(Interval.Create(3, 4), Interval.Create(Interval.Create(3, 4))));
3636
}
3737

38-
[TestAttribute]
38+
[Test]
3939
public void TestCentre()
4040
{
4141
Assert.AreEqual(6.5, Interval.Create(4, 9).Centre, 1E-10);
4242
}
4343

44-
[TestAttribute]
44+
[Test]
4545
public void TestExpandToInclude()
4646
{
4747
var expected = Interval.Create(3, 8);

GeoAPI.Tests/GeoAPI.Tests.csproj

Lines changed: 28 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,45 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
2+
<Project Sdk="Microsoft.NET.Sdk">
43
<PropertyGroup>
5-
<!-- Define SolutionDir if not already set -->
6-
<SolutionDir Condition=" '$(SolutionDir)' == '' ">$(MSBuildThisFileDirectory)\..\</SolutionDir>
7-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9-
<ProjectGuid>{A2CC5645-37A7-4762-ACC4-6C8AA18B1574}</ProjectGuid>
10-
<OutputType>Library</OutputType>
11-
<AppDesignerFolder>Properties</AppDesignerFolder>
12-
<RootNamespace>GeoAPI.Tests</RootNamespace>
13-
<AssemblyName>GeoAPI.Tests</AssemblyName>
14-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
15-
<FileAlignment>512</FileAlignment>
4+
<TargetFrameworks>net45</TargetFrameworks>
5+
<NoWarn>1591</NoWarn>
6+
<OutputPath>$(SolutionDir)$(Configuration)\$(Platform)</OutputPath>
7+
<DocumentationFile>$(OutputPath)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
8+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
9+
<SignAssembly>true</SignAssembly>
10+
<AssemblyOriginatorKeyFile>..\geoapi.snk</AssemblyOriginatorKeyFile>
1611
</PropertyGroup>
17-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
12+
13+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
1814
<DebugSymbols>true</DebugSymbols>
1915
<DebugType>full</DebugType>
20-
<Optimize>false</Optimize>
21-
<OutputPath>$(SolutionDir)$(Configuration)\$(TargetFrameworkVersion)\$(Platform)\</OutputPath>
22-
<DefineConstants>DEBUG;TRACE</DefineConstants>
23-
<ErrorReport>prompt</ErrorReport>
24-
<WarningLevel>4</WarningLevel>
2516
</PropertyGroup>
26-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
17+
18+
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
2719
<DebugType>pdbonly</DebugType>
28-
<Optimize>true</Optimize>
29-
<OutputPath>$(SolutionDir)$(Configuration)\$(TargetFrameworkVersion)\$(Platform)\</OutputPath>
30-
<DefineConstants>TRACE</DefineConstants>
31-
<ErrorReport>prompt</ErrorReport>
32-
<WarningLevel>4</WarningLevel>
3320
</PropertyGroup>
21+
3422
<ItemGroup>
35-
<Reference Include="System" />
36-
<Reference Include="nunit.framework, Version=3.6.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb">
37-
<HintPath>..\packages\NUnit.3.6.0\lib\net45\nunit.framework.dll</HintPath>
38-
</Reference>
39-
</ItemGroup>
40-
<ItemGroup>
41-
<Compile Include="Geometries\CoordinateTest.cs" />
42-
<Compile Include="Geometries\EnvelopeTest.cs" />
43-
<Compile Include="DataStructures\IntervalTest.cs" />
44-
<Compile Include="Properties\AssemblyInfo.cs" />
23+
<None Include="$(SolutionDir)geoapi.snk">
24+
<Link>geoapi.snk</Link>
25+
</None>
4526
</ItemGroup>
27+
4628
<ItemGroup>
47-
<ProjectReference Include="..\GeoAPI\GeoAPI.csproj">
48-
<Project>{FFB69466-79DE-466A-ADA7-5C47C5C5CA3A}</Project>
49-
<Name>GeoAPI</Name>
50-
</ProjectReference>
29+
<Reference Include="System" />
30+
31+
<PackageReference Include="NUnit" Version="3.6.1" />
32+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
33+
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0-alpha1" />
34+
35+
<ProjectReference Include="..\GeoAPI\GeoAPI.csproj" />
5136
</ItemGroup>
37+
5238
<ItemGroup>
53-
<None Include="packages.config" />
39+
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
5440
</ItemGroup>
55-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
56-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
57-
Other similar extension points exist, see Microsoft.Common.targets.
41+
5842
<Target Name="BeforeBuild">
43+
<Message Text="Building for '$(TargetFramework)'" />
5944
</Target>
60-
<Target Name="AfterBuild">
61-
</Target>
62-
-->
6345
</Project>

GeoAPI.Tests/Geometries/CoordinateTest.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace GeoAPI.Tests.Geometries
66
{
77
public class CoordinateTest
88
{
9-
[TestAttribute]
9+
[Test]
1010
public void TestConstructor3D()
1111
{
1212
Coordinate c = new Coordinate(350.2, 4566.8, 5266.3);
@@ -15,7 +15,7 @@ public void TestConstructor3D()
1515
Assert.AreEqual(c.Z, 5266.3);
1616
}
1717

18-
[TestAttribute]
18+
[Test]
1919
public void TestConstructor2D()
2020
{
2121
Coordinate c = new Coordinate(350.2, 4566.8);
@@ -24,7 +24,7 @@ public void TestConstructor2D()
2424
Assert.AreEqual(c.Z, Coordinate.NullOrdinate);
2525
}
2626

27-
[TestAttribute]
27+
[Test]
2828
public void TestDefaultConstructor()
2929
{
3030
Coordinate c = new Coordinate();
@@ -33,7 +33,7 @@ public void TestDefaultConstructor()
3333
Assert.AreEqual(c.Z, Coordinate.NullOrdinate);
3434
}
3535

36-
[TestAttribute]
36+
[Test]
3737
public void TestCopyConstructor3D()
3838
{
3939
Coordinate orig = new Coordinate(350.2, 4566.8, 5266.3);
@@ -43,7 +43,7 @@ public void TestCopyConstructor3D()
4343
Assert.AreEqual(c.Z, 5266.3);
4444
}
4545

46-
[TestAttribute]
46+
[Test]
4747
public void TestSetCoordinate()
4848
{
4949
Coordinate orig = new Coordinate(350.2, 4566.8, 5266.3);
@@ -53,7 +53,7 @@ public void TestSetCoordinate()
5353
Assert.AreEqual(c.Z, 5266.3);
5454
}
5555

56-
[TestAttribute]
56+
[Test]
5757
public void TestGetOrdinate()
5858
{
5959
Coordinate c = new Coordinate(350.2, 4566.8, 5266.3);
@@ -62,7 +62,7 @@ public void TestGetOrdinate()
6262
Assert.AreEqual(c[Ordinate.Z], 5266.3);
6363
}
6464

65-
[TestAttribute]
65+
[Test]
6666
public void TestSetOrdinate()
6767
{
6868
Coordinate c = new Coordinate();
@@ -74,7 +74,7 @@ public void TestSetOrdinate()
7474
Assert.AreEqual(c[Ordinate.Z], 333.0);
7575
}
7676

77-
[TestAttribute]
77+
[Test]
7878
public void TestEquals()
7979
{
8080
Coordinate c1 = new Coordinate(1, 2, 3);
@@ -88,7 +88,7 @@ public void TestEquals()
8888
Assert.IsFalse(c1.Equals2D(c3));
8989
}
9090

91-
[TestAttribute]
91+
[Test]
9292
public void TestEquals2D()
9393
{
9494
Coordinate c1 = new Coordinate(1, 2, 3);
@@ -99,7 +99,7 @@ public void TestEquals2D()
9999
Assert.IsFalse(c1.Equals2D(c3));
100100
}
101101

102-
[TestAttribute]
102+
[Test]
103103
public void TestEquals3D()
104104
{
105105
Coordinate c1 = new Coordinate(1, 2, 3);
@@ -110,15 +110,15 @@ public void TestEquals3D()
110110
Assert.IsFalse(c1.Equals3D(c3));
111111
}
112112

113-
[TestAttribute]
113+
[Test]
114114
public void TestEquals2DWithinTolerance()
115115
{
116116
Coordinate c = new Coordinate(100.0, 200.0, 50.0);
117117
Coordinate aBitOff = new Coordinate(100.1, 200.1, 50.0);
118118
Assert.IsTrue(c.Equals2D(aBitOff, 0.2));
119119
}
120120

121-
[TestAttribute]
121+
[Test]
122122
public void TestEqualsInZ()
123123
{
124124

@@ -127,7 +127,7 @@ public void TestEqualsInZ()
127127
Assert.IsTrue(c.EqualInZ(withSameZ, 0.2));
128128
}
129129

130-
[TestAttribute]
130+
[Test]
131131
public void TestCompareTo()
132132
{
133133
Coordinate lowest = new Coordinate(10.0, 100.0, 50.0);
@@ -141,23 +141,23 @@ public void TestCompareTo()
141141
Assert.AreEqual(0, highest.CompareTo(equalToHighest));
142142
}
143143

144-
[TestAttribute]
144+
[Test]
145145
public void TestToString()
146146
{
147147
const string expectedResult = "(100, 200, 50)";
148148
String actualResult = new Coordinate(100, 200, 50).ToString();
149149
Assert.AreEqual(expectedResult, actualResult);
150150
}
151151

152-
[TestAttribute]
152+
[Test]
153153
public void TestClone()
154154
{
155155
Coordinate c = new Coordinate(100.0, 200.0, 50.0);
156156
Coordinate clone = (Coordinate)c.Clone();
157157
Assert.IsTrue(c.Equals3D(clone));
158158
}
159159

160-
[TestAttribute]
160+
[Test]
161161
public void TestDistance()
162162
{
163163
Coordinate coord1 = new Coordinate(0.0, 0.0, 0.0);
@@ -166,7 +166,7 @@ public void TestDistance()
166166
Assert.AreEqual(distance, 223.60679774997897, 0.00001);
167167
}
168168

169-
[TestAttribute]
169+
[Test]
170170
public void TestDistance3D()
171171
{
172172
Coordinate coord1 = new Coordinate(0.0, 0.0, 0.0);
@@ -175,7 +175,7 @@ public void TestDistance3D()
175175
Assert.AreEqual(distance, 229.128784747792, 0.000001);
176176
}
177177

178-
[TestAttribute]
178+
[Test]
179179
public void TestSettingOrdinateValuesViaIndexer()
180180
{
181181
var c = new Coordinate();

GeoAPI.Tests/Geometries/EnvelopeTest.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
namespace GeoAPI.Tests.Geometries
66
{
7-
[TestFixtureAttribute]
7+
[TestFixture]
88
public class EnvelopeTest
99
{
10-
[TestAttribute]
10+
[Test]
1111
public void TestEverything()
1212
{
1313
Envelope e1 = new Envelope();
@@ -48,7 +48,7 @@ public void TestEverything()
4848
Assert.IsTrue(e1.Intersects(e4));
4949
}
5050

51-
[TestAttribute]
51+
[Test]
5252
public void TestIntersectsEmpty()
5353
{
5454
Assert.IsTrue(!new Envelope(-5, 5, -5, 5).Intersects(new Envelope()));
@@ -57,7 +57,7 @@ public void TestIntersectsEmpty()
5757
Assert.IsTrue(!new Envelope(100, 101, 100, 101).Intersects(new Envelope()));
5858
}
5959

60-
[TestAttribute]
60+
[Test]
6161
public void TestContainsEmpty()
6262
{
6363
Assert.IsTrue(!new Envelope(-5, 5, -5, 5).Contains(new Envelope()));
@@ -66,7 +66,7 @@ public void TestContainsEmpty()
6666
Assert.IsTrue(!new Envelope(100, 101, 100, 101).Contains(new Envelope()));
6767
}
6868

69-
[TestAttribute]
69+
[Test]
7070
public void TestExpandToIncludeEmpty()
7171
{
7272
Assert.AreEqual(new Envelope(-5, 5, -5, 5), ExpandToInclude(new Envelope(-5,
@@ -85,7 +85,7 @@ private static Envelope ExpandToInclude(Envelope a, Envelope b)
8585
return a;
8686
}
8787

88-
[TestAttribute]
88+
[Test]
8989
public void TestEmpty()
9090
{
9191
Assert.AreEqual(0, new Envelope().Height, 0);
@@ -96,7 +96,7 @@ public void TestEmpty()
9696
Assert.AreEqual(new Envelope(), e);
9797
}
9898

99-
[TestAttribute]
99+
[Test]
100100
public void TestSetToNull()
101101
{
102102
Envelope e1 = new Envelope();
@@ -107,7 +107,7 @@ public void TestSetToNull()
107107
Assert.IsTrue(e1.IsNull);
108108
}
109109

110-
[TestAttribute]
110+
[Test]
111111
public void TestEquals()
112112
{
113113
Envelope e1 = new Envelope(1, 2, 3, 4);
@@ -126,15 +126,15 @@ public void TestEquals()
126126
Assert.AreEqual(e1.GetHashCode(), e2.GetHashCode());
127127
}
128128

129-
[TestAttribute]
129+
[Test]
130130
public void TestEquals2()
131131
{
132132
Assert.IsTrue(new Envelope().Equals(new Envelope()));
133133
Assert.IsTrue(new Envelope(1, 2, 1, 2).Equals(new Envelope(1, 2, 1, 2)));
134134
Assert.IsTrue(!new Envelope(1, 2, 1.5, 2).Equals(new Envelope(1, 2, 1, 2)));
135135
}
136136

137-
[TestAttribute]
137+
[Test]
138138
public void TestCopyConstructor()
139139
{
140140
Envelope e1 = new Envelope(1, 2, 3, 4);

GeoAPI.Tests/packages.config

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)