kopia lustrzana https://git.sr.ht/~michalr/hamlocator
35 wiersze
1.2 KiB
Vala
35 wiersze
1.2 KiB
Vala
public class MaidenheadTests : TestCase {
|
|
public MaidenheadTests() {
|
|
base("Maidenhead Tests");
|
|
add_test_location(0.0, 0.0, "JJ00aa");
|
|
add_test_location(90.0, 0.0, "JS00aa");
|
|
add_test_location(0.0, 180.0, "SJ00aa");
|
|
add_test_location(90.0, 180.0, "SS00aa");
|
|
add_test_location(-90.0, 0.0, "JA00aa");
|
|
add_test_location(0.0, -180.0, "AJ00aa");
|
|
add_test_location(-90.0, -180.0, "AA00aa");
|
|
add_test_location(90.0, -180.0, "AS00aa");
|
|
add_test_location(-90.0, 180.0, "SA00aa");
|
|
|
|
add_test_location(51.1205, 17.0261, "JO81mc");
|
|
add_test_location(37.1104, -5.4932, "IM77gc");
|
|
add_test_location(-30.5377, 22.8516, "KF19kl");
|
|
add_test_location(-27.4613, -65.0391, "FG72lm");
|
|
add_test_location(-24.6168, 136.4063, "PG85ej");
|
|
}
|
|
|
|
protected Hamlocator.LocationToMaidenhead tested;
|
|
|
|
public override void set_up() {
|
|
this.tested = new Hamlocator.LocationToMaidenhead();
|
|
}
|
|
|
|
public void add_test_location(double lat, double lon, string expected) {
|
|
add_test (@"Expect location lat:$lat lon:$lon to be $expected", () => {
|
|
GClue.Location pos = new FakeGeoclueLocation(lat, lon);
|
|
assert_cmpstr(this.tested.get_locator(pos), EQ, expected);
|
|
});
|
|
}
|
|
}
|
|
|