-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
299 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
Demeton.Tests/Commands tests/TileShadeCommand/Calculating geo area needed.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module Tests.Commands_tests.TileShadeCommand.Calculating_geo_area_needed | ||
|
||
open Demeton.Commands | ||
|
||
open Xunit | ||
open Swensen.Unquote | ||
open TestHelp | ||
|
||
[<Fact>] | ||
let ``Geo area needed is calculated correctly``() = | ||
let options: TileShadeCommand.Options = { | ||
TileWidth = 800 | ||
TileHeight = 600 | ||
TileCenter = (4, 46) | ||
PixelSize = None | ||
MapScale = Some 250000 | ||
Dpi = 245 | ||
WaterBodiesColor = "#49C8FF" |> Png.Rgba8Bit.parseColorHexValue | ||
} | ||
|
||
match | ||
TileShadeCommand.createProjection options | ||
|> Result.bind (TileShadeCommand.calculateGeoAreaNeeded options) with | ||
| Ok geoAreaNeeded -> | ||
test <@ geoAreaNeeded.MinLon |> isApproxEqualTo 3.866 (Decimals 3) @> | ||
test <@ geoAreaNeeded.MinLat |> isApproxEqualTo 45.930 (Decimals 3) @> | ||
test <@ geoAreaNeeded.MaxLon |> isApproxEqualTo 4.134 (Decimals 3) @> | ||
test <@ geoAreaNeeded.MaxLat |> isApproxEqualTo 46.069 (Decimals 3) @> | ||
|
||
| Error error -> invalidOp error | ||
|
23 changes: 23 additions & 0 deletions
23
Demeton.Tests/Commands tests/TileShadeCommand/Creating map projection.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module Tests.Commands_tests.TileShadeCommand.Creating_map_projection | ||
|
||
open Demeton.Commands | ||
|
||
open Xunit | ||
|
||
[<Fact>] | ||
let ``Projection is created``() = | ||
let options: TileShadeCommand.Options = { | ||
TileWidth= 100 | ||
TileHeight = 200 | ||
TileCenter = (10, 20) | ||
PixelSize= None | ||
MapScale= Some 250000 | ||
Dpi=245 | ||
WaterBodiesColor = "#49C8FF" |> Png.Rgba8Bit.parseColorHexValue | ||
} | ||
|
||
let projection = TileShadeCommand.createProjection options | ||
|
||
match projection with | ||
| Ok projection -> () | ||
| Error error -> invalidOp error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.