forked from linguanostra/GoogleMapsAPI.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStreetViewImageAPITests.cs
More file actions
58 lines (45 loc) · 1.61 KB
/
Copy pathStreetViewImageAPITests.cs
File metadata and controls
58 lines (45 loc) · 1.61 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
using System.Drawing.Imaging;
using FluentAssertions;
using GoogleMapsAPI.NET.API.Common.Components.Locations;
using GoogleMapsAPI.NET.Tests.API.Common;
using GoogleMapsAPI.NET.Tests.API.Extensions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace GoogleMapsAPI.NET.Tests.API.StreetViewImage
{
/// <summary>
/// Street view image API tests
/// </summary>
[TestClass]
public class StreetViewImageAPITests : APITests
{
#region Test methods
/// <summary>
/// Test get street view image
/// </summary>
[TestMethod]
public void TestGetStreetViewImage()
{
// Get mocked client
using (var client = GetMockedAPIClient())
{
// Arrange mocks for image
var webMocks = client.ArrangeStreetViewImageWebResponseMocks();
// Make client call
var result = client.StreetViewImage.GetStreetViewImage(
new GeoCoordinatesLocation(46.414382, 10.013988),
width: 600,
height: 300,
heading: 151.780,
pitch: -0.76);
// Assertions
webMocks.WebRequestUtil.AssertGetWasCalledOnceWithUrl(
"https://maps.googleapis.com/maps/api/streetview?" +
"location=46.414382%2C10.013988&size=600x300" +
"&heading=151.78&pitch=-0.76");
// Image data
result.Content.Should().NotBeNullOrEmpty();
}
}
#endregion
}
}