-
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
3 changed files
with
54 additions
and
3 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
namespace TilesMath.Tests; | ||
|
||
public class TileTests | ||
{ | ||
[Fact] | ||
public void Tile_ParentAt_OneZoomUp_ShouldEqualParent() | ||
{ | ||
var tile = Tile.Create(1025, 4511, 14); | ||
|
||
var parent = tile.Parent ?? throw new Exception("No parent"); | ||
Assert.Equal(parent, tile.ParentAt(tile.Zoom - 1)); | ||
} | ||
|
||
[Fact] | ||
public void Tile_ParentAt_TwoZoomsUp_ShouldEqualParentOfParent() | ||
{ | ||
var tile = Tile.Create(1025, 4511, 14); | ||
|
||
var parent = tile.Parent?.Parent ?? throw new Exception("No parent"); | ||
Assert.Equal(parent, tile.ParentAt(tile.Zoom - 2)); | ||
} | ||
|
||
[Fact] | ||
public void Tile_ParentAt_5ZoomsUp_ShouldEqual5thParentUp() | ||
{ | ||
var tile = Tile.Create(1025, 4511, 14); | ||
|
||
var parent = tile.Parent?.Parent?.Parent?.Parent?.Parent ?? throw new Exception("No parent"); | ||
Assert.Equal(parent, tile.ParentAt(tile.Zoom - 5)); | ||
} | ||
} |