Skip to content

Commit 9b56ff0

Browse files
committed
Modernize provider projects and test infrastructure
Adopt shared SDK build settings, update provider and test package references, and bring the library code into compliance with the stricter analyzer and XML documentation requirements. The earlier build churn was driven by stale intermediates plus missing documentation and async/test-platform cleanup in the SDK-style projects, so this commit makes the provider libraries and test suite build and run cleanly under the current toolchain.
1 parent 8f1dc99 commit 9b56ff0

83 files changed

Lines changed: 2095 additions & 374 deletions

File tree

Some content is hidden

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

Directory.Build.props

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,18 @@
1111
<RepositoryType>git</RepositoryType>
1212
<ImplicitUsings>enable</ImplicitUsings>
1313
<LangVersion>latest</LangVersion>
14+
<MinVerTagPrefix>v</MinVerTagPrefix>
15+
<MinVerMinimumMajorMinor>5.0</MinVerMinimumMajorMinor>
16+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
17+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
18+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
19+
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
20+
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
1421
</PropertyGroup>
22+
23+
<ItemGroup>
24+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.201" PrivateAssets="All"/>
25+
<PackageReference Include="AsyncFixer" Version="2.1.0" PrivateAssets="All" />
26+
<PackageReference Include="MinVer" Version="7.0.0" PrivateAssets="All" />
27+
</ItemGroup>
1528
</Project>

src/Geocoding.Core/Address.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,22 @@ public abstract class Address
1212
Location coordinates;
1313
string provider = string.Empty;
1414

15+
/// <summary>
16+
/// Initializes a new address instance.
17+
/// </summary>
18+
/// <param name="formattedAddress">The provider formatted address string.</param>
19+
/// <param name="coordinates">The geocoded coordinates.</param>
20+
/// <param name="provider">The provider name that produced this address.</param>
1521
public Address(string formattedAddress, Location coordinates, string provider)
1622
{
1723
FormattedAddress = formattedAddress;
1824
Coordinates = coordinates;
1925
Provider = provider;
2026
}
2127

28+
/// <summary>
29+
/// Gets or sets the full formatted address.
30+
/// </summary>
2231
public virtual string FormattedAddress
2332
{
2433
get { return formattedAddress; }
@@ -31,6 +40,9 @@ public virtual string FormattedAddress
3140
}
3241
}
3342

43+
/// <summary>
44+
/// Gets or sets the latitude and longitude for this address.
45+
/// </summary>
3446
public virtual Location Coordinates
3547
{
3648
get { return coordinates; }
@@ -43,6 +55,9 @@ public virtual Location Coordinates
4355
}
4456
}
4557

58+
/// <summary>
59+
/// Gets the provider name for this address.
60+
/// </summary>
4661
public virtual string Provider
4762
{
4863
get { return provider; }
@@ -55,16 +70,31 @@ protected set
5570
}
5671
}
5772

73+
/// <summary>
74+
/// Calculates the distance from this address to another address in miles.
75+
/// </summary>
76+
/// <param name="address">The destination address.</param>
77+
/// <returns>The distance between the two addresses.</returns>
5878
public virtual Distance DistanceBetween(Address address)
5979
{
6080
return this.Coordinates.DistanceBetween(address.Coordinates);
6181
}
6282

83+
/// <summary>
84+
/// Calculates the distance from this address to another address.
85+
/// </summary>
86+
/// <param name="address">The destination address.</param>
87+
/// <param name="units">The unit to return the distance in.</param>
88+
/// <returns>The distance between the two addresses.</returns>
6389
public virtual Distance DistanceBetween(Address address, DistanceUnits units)
6490
{
6591
return this.Coordinates.DistanceBetween(address.Coordinates, units);
6692
}
6793

94+
/// <summary>
95+
/// Returns the formatted address.
96+
/// </summary>
97+
/// <returns>The formatted address.</returns>
6898
public override string ToString()
6999
{
70100
return FormattedAddress;

src/Geocoding.Core/Bounds.cs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,45 @@
33

44
namespace Geocoding
55
{
6+
/// <summary>
7+
/// Represents a rectangular viewport defined by southwest and northeast coordinates.
8+
/// </summary>
69
public class Bounds
710
{
811
readonly Location southWest;
912
readonly Location northEast;
1013

14+
/// <summary>
15+
/// Gets the southwest corner.
16+
/// </summary>
1117
public Location SouthWest
1218
{
1319
get { return southWest; }
1420
}
1521

22+
/// <summary>
23+
/// Gets the northeast corner.
24+
/// </summary>
1625
public Location NorthEast
1726
{
1827
get { return northEast; }
1928
}
2029

30+
/// <summary>
31+
/// Initializes bounds from raw latitude and longitude values.
32+
/// </summary>
33+
/// <param name="southWestLatitude">The southwest latitude.</param>
34+
/// <param name="southWestLongitude">The southwest longitude.</param>
35+
/// <param name="northEastLatitude">The northeast latitude.</param>
36+
/// <param name="northEastLongitude">The northeast longitude.</param>
2137
public Bounds(double southWestLatitude, double southWestLongitude, double northEastLatitude, double northEastLongitude)
2238
: this(new Location(southWestLatitude, southWestLongitude), new Location(northEastLatitude, northEastLongitude)) { }
2339

40+
/// <summary>
41+
/// Initializes bounds from two corner locations.
42+
/// </summary>
43+
/// <param name="southWest">The southwest corner.</param>
44+
/// <param name="northEast">The northeast corner.</param>
2445
[JsonConstructor]
2546
public Bounds(Location southWest, Location northEast)
2647
{
@@ -37,11 +58,21 @@ public Bounds(Location southWest, Location northEast)
3758
this.northEast = northEast;
3859
}
3960

61+
/// <summary>
62+
/// Determines whether the specified object is equal to the current bounds.
63+
/// </summary>
64+
/// <param name="obj">The object to compare.</param>
65+
/// <returns><c>true</c> when equal; otherwise <c>false</c>.</returns>
4066
public override bool Equals(object obj)
4167
{
4268
return Equals(obj as Bounds);
4369
}
4470

71+
/// <summary>
72+
/// Determines whether another bounds instance is equal to the current one.
73+
/// </summary>
74+
/// <param name="bounds">The other bounds instance.</param>
75+
/// <returns><c>true</c> when equal; otherwise <c>false</c>.</returns>
4576
public bool Equals(Bounds bounds)
4677
{
4778
if (bounds == null)
@@ -50,11 +81,19 @@ public bool Equals(Bounds bounds)
5081
return (this.SouthWest.Equals(bounds.SouthWest) && this.NorthEast.Equals(bounds.NorthEast));
5182
}
5283

84+
/// <summary>
85+
/// Returns a hash code for the current bounds.
86+
/// </summary>
87+
/// <returns>A hash code for the current bounds.</returns>
5388
public override int GetHashCode()
5489
{
5590
return SouthWest.GetHashCode() ^ NorthEast.GetHashCode();
5691
}
5792

93+
/// <summary>
94+
/// Returns a string representation of the bounds.
95+
/// </summary>
96+
/// <returns>A string representation of the bounds.</returns>
5897
public override string ToString()
5998
{
6099
return string.Format("{0} | {1}", southWest, northEast);

0 commit comments

Comments
 (0)