This repository was archived by the owner on May 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 493
Expand file tree
/
Copy pathMaps_Tests.cs
More file actions
70 lines (62 loc) · 2.3 KB
/
Maps_Tests.cs
File metadata and controls
70 lines (62 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
using System;
using System.Threading.Tasks;
using Xamarin.Essentials;
using Xunit;
namespace Tests
{
public class Maps_Tests
{
const double testLatitude = 47.645160;
const double testLongitude = -122.1306032;
const string mapName = "Microsoft Building 25";
[Fact]
public async Task Open_Map_LatLong_NetStandard() =>
await Assert.ThrowsAsync<NotImplementedInReferenceAssemblyException>(
() => Map.OpenAsync(
testLatitude,
testLongitude,
new MapLaunchOptions { Name = mapName }));
[Fact]
public async Task Open_Map_Location_NetStandard() =>
await Assert.ThrowsAsync<NotImplementedInReferenceAssemblyException>(
() => Map.OpenAsync(
new Location(testLatitude, testLongitude),
new MapLaunchOptions { Name = mapName }));
[Fact]
public async Task Open_Map_Placemark_NetStandard() =>
await Assert.ThrowsAsync<NotImplementedInReferenceAssemblyException>(
() => Map.OpenAsync(
new Placemark(),
new MapLaunchOptions { Name = mapName }));
[Fact]
public async Task LaunchMap_NullLocation()
{
Location location = null;
await Assert.ThrowsAsync<ArgumentNullException>(() => Map.OpenAsync(location));
}
[Fact]
public async Task LaunchMap_NullOptionsLocation()
{
var location = new Location(testLatitude, testLongitude);
await Assert.ThrowsAsync<ArgumentNullException>(() => Map.OpenAsync(location, null));
}
[Fact]
public async Task LaunchMap_NullPlacemark()
{
Placemark location = null;
await Assert.ThrowsAsync<ArgumentNullException>(() => Map.OpenAsync(location));
}
[Fact]
public async Task LaunchMap_NullOptionsPlacemark()
{
var placemark = new Placemark
{
CountryName = "United States",
AdminArea = "WA",
Thoroughfare = "Microsoft Building 25",
Locality = "Redmond"
};
await Assert.ThrowsAsync<ArgumentNullException>(() => Map.OpenAsync(placemark, null));
}
}
}