Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<PackageReference Include="Asp.Versioning.Mvc" Version="8.1.0" />
<PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
<PackageReference Include="AutoMapper" Version="14.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.9" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.3.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.6" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using FluentAssertions;
using Shouldly;
using System;
using System.Collections.Generic;
using System.Text;
Expand All @@ -18,17 +18,17 @@ public void ConsturctorTakesValidPoints(double topLeftLatitude, double topLeftLo
BoundingBox box = new BoundingBox(topLeftLatitude, topLeftLongitude,
bottomRightLatitude, bottomRightLongitude);

box.PointOne.Latitude.Value.Should().Be(topLeftLatitude);
box.PointOne.Longitude.Value.Should().Be(topLeftLongitude);
box.PointTwo.Latitude.Value.Should().Be(bottomRightLatitude);
box.PointTwo.Longitude.Value.Should().Be(bottomRightLongitude);
box.PointOne.Latitude.Value.ShouldBe(topLeftLatitude);
box.PointOne.Longitude.Value.ShouldBe(topLeftLongitude);
box.PointTwo.Latitude.Value.ShouldBe(bottomRightLatitude);
box.PointTwo.Longitude.Value.ShouldBe(bottomRightLongitude);

}

[Fact]
public void ConsturctorRejectsPointsThatAreTheSame()
{
var exception = Assert.Throws<ArgumentException>(() => new BoundingBox(41.93301, -87.62007, 41.93301, -87.62007));
var exception = Assert.Throws<ArgumentException>(() => new BoundingBox(41.93301, -87.62007, 41.93301, -87.62007));
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;
using Xunit;
using FluentAssertions;
using Shouldly;
using System.Linq;

namespace DavidBerry.Framework.Spatial.Tests
Expand Down Expand Up @@ -33,7 +33,7 @@ public void CheckBearingsResultInCorrectCompassDirection(double bearing, string
var direction = CompassDirection.GetDirection(bearing);

// Assert
direction.Abbreviation.Should().Be(expectedDirection,
direction.Abbreviation.ShouldBe(expectedDirection,
$"Expected direction of {expectedDirection} but got {direction.Abbreviation} for bearing {bearing}");
}

Expand All @@ -53,7 +53,7 @@ public void CheckBoundaryBearingsReturCorrectDirectionForCardinalDirections(doub
var direction = CompassDirection.GetDirection(bearing);

// Assert
direction.Abbreviation.Should().Be(expectedDirection,
direction.Abbreviation.ShouldBe(expectedDirection,
$"Expected direction of {expectedDirection} but got {direction.Abbreviation} for bearing {bearing}");
}

Expand All @@ -73,7 +73,7 @@ public void CheckBoundaryBearingsReturCorrectDirectionForIntercardinalDirections
var direction = CompassDirection.GetDirection(bearing);

// Assert
direction.Abbreviation.Should().Be(expectedDirection,
direction.Abbreviation.ShouldBe(expectedDirection,
$"Expected direction of {expectedDirection} but got {direction.Abbreviation} for bearing {bearing}");
}

Expand All @@ -95,36 +95,36 @@ public void CheckEqualsReturnsFalseWhenNullPassedIn()
{
var result = CompassDirection.NORTH.Equals(null);

result.Should().BeFalse();
result.ShouldBeFalse();
}


[Fact]
public void CheckAllDirectionsEqualThemselves()
{
CompassDirection.NORTH.Equals(CompassDirection.NORTH).Should().BeTrue();
CompassDirection.NORTH_NORTHEAST.Equals(CompassDirection.NORTH_NORTHEAST).Should().BeTrue();
CompassDirection.NORTHEAST.Equals(CompassDirection.NORTHEAST).Should().BeTrue();
CompassDirection.EAST_NORTHEAST.Equals(CompassDirection.EAST_NORTHEAST).Should().BeTrue();
CompassDirection.EAST.Equals(CompassDirection.EAST).Should().BeTrue();
CompassDirection.EAST_SOUTHEAST.Equals(CompassDirection.EAST_SOUTHEAST).Should().BeTrue();
CompassDirection.SOUTHEAST.Equals(CompassDirection.SOUTHEAST).Should().BeTrue();
CompassDirection.SOUTH_SOUTHEAST.Equals(CompassDirection.SOUTH_SOUTHEAST).Should().BeTrue();
CompassDirection.SOUTH.Equals(CompassDirection.SOUTH).Should().BeTrue();
CompassDirection.SOUTH_SOUTHWEST.Equals(CompassDirection.SOUTH_SOUTHWEST).Should().BeTrue();
CompassDirection.SOUTHWEST.Equals(CompassDirection.SOUTHWEST).Should().BeTrue();
CompassDirection.WEST_SOUTHWEST.Equals(CompassDirection.WEST_SOUTHWEST).Should().BeTrue();
CompassDirection.WEST.Equals(CompassDirection.WEST).Should().BeTrue();
CompassDirection.WEST_NORTHWEST.Equals(CompassDirection.WEST_NORTHWEST).Should().BeTrue();
CompassDirection.NORTHWEST.Equals(CompassDirection.NORTHWEST).Should().BeTrue();
CompassDirection.NORTH_NORTHWEST.Equals(CompassDirection.NORTH_NORTHWEST).Should().BeTrue();
CompassDirection.NORTH.Equals(CompassDirection.NORTH).ShouldBeTrue();
CompassDirection.NORTH_NORTHEAST.Equals(CompassDirection.NORTH_NORTHEAST).ShouldBeTrue();
CompassDirection.NORTHEAST.Equals(CompassDirection.NORTHEAST).ShouldBeTrue();
CompassDirection.EAST_NORTHEAST.Equals(CompassDirection.EAST_NORTHEAST).ShouldBeTrue();
CompassDirection.EAST.Equals(CompassDirection.EAST).ShouldBeTrue();
CompassDirection.EAST_SOUTHEAST.Equals(CompassDirection.EAST_SOUTHEAST).ShouldBeTrue();
CompassDirection.SOUTHEAST.Equals(CompassDirection.SOUTHEAST).ShouldBeTrue();
CompassDirection.SOUTH_SOUTHEAST.Equals(CompassDirection.SOUTH_SOUTHEAST).ShouldBeTrue();
CompassDirection.SOUTH.Equals(CompassDirection.SOUTH).ShouldBeTrue();
CompassDirection.SOUTH_SOUTHWEST.Equals(CompassDirection.SOUTH_SOUTHWEST).ShouldBeTrue();
CompassDirection.SOUTHWEST.Equals(CompassDirection.SOUTHWEST).ShouldBeTrue();
CompassDirection.WEST_SOUTHWEST.Equals(CompassDirection.WEST_SOUTHWEST).ShouldBeTrue();
CompassDirection.WEST.Equals(CompassDirection.WEST).ShouldBeTrue();
CompassDirection.WEST_NORTHWEST.Equals(CompassDirection.WEST_NORTHWEST).ShouldBeTrue();
CompassDirection.NORTHWEST.Equals(CompassDirection.NORTHWEST).ShouldBeTrue();
CompassDirection.NORTH_NORTHWEST.Equals(CompassDirection.NORTH_NORTHWEST).ShouldBeTrue();
}


[Fact]
public void CheckDirectionsThatDoNotEqualReturnFalse()
{
CompassDirection.NORTH.Equals(CompassDirection.EAST).Should().BeFalse();
CompassDirection.NORTH.Equals(CompassDirection.EAST).ShouldBeFalse();
}

[Fact]
Expand All @@ -135,7 +135,7 @@ public void CheckAllDirectionsHaveUniqueAbbreviations()
.Distinct()
.Count();

uniquePoints.Should().Be(CompassDirection.COMPASS_POINTS.Length);
uniquePoints.ShouldBe(CompassDirection.COMPASS_POINTS.Length);
}


Expand All @@ -147,7 +147,7 @@ public void CheckHashcodesDifferentForDifferentCompassPoints()
.Distinct()
.Count();

uniqueHashCodes.Should().Be(CompassDirection.COMPASS_POINTS.Length);
uniqueHashCodes.ShouldBe(CompassDirection.COMPASS_POINTS.Length);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="8.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="UnitsNet" Version="5.74.0" />
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="UnitsNet" Version="5.75.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.0">
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using Xunit;
using FluentAssertions;
using Shouldly;
using UnitsNet.Units;
using DavidBerry.Framework.Spatial;

Expand All @@ -22,13 +22,13 @@ public void CanConstructValidPointWithDegrees(double latitude, double longitude)
{
GeoCoordinate p = new GeoCoordinate(latitude, longitude);

p.Should().NotBeNull();
p.ShouldNotBeNull();

p.Latitude.Unit.Should().Be(AngleUnit.Degree);
p.Latitude.Value.Should().Be(latitude);
p.Latitude.Unit.ShouldBe(AngleUnit.Degree);
p.Latitude.Value.ShouldBe(latitude);

p.Longitude.Unit.Should().Be(AngleUnit.Degree);
p.Longitude.Value.Should().Be(longitude);
p.Longitude.Unit.ShouldBe(AngleUnit.Degree);
p.Longitude.Value.ShouldBe(longitude);
}


Expand Down
Loading