-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPostcodeInfoTests.cs
More file actions
37 lines (33 loc) · 1.2 KB
/
Copy pathPostcodeInfoTests.cs
File metadata and controls
37 lines (33 loc) · 1.2 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
using System.Configuration;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using PostcodeAPI;
using PostcodeAPI.Model;
using PostcodeAPI.Wrappers;
namespace PostcodeAPI.Tests
{
[TestClass]
public class PostcodeInfoTests : TestBase
{
[TestMethod]
public void GetLargePostcodeSet()
{
PostcodeApiClient client = new PostcodeApiClient(ApiKey);
ApiHalResultWrapper result = client.GetPostcodes("1097");
Assert.IsNotNull(result);
Assert.IsNotNull(result.Links.Self);
Assert.IsNotNull(result.Links.Next);
Assert.IsTrue(result.Embedded.Postcodes.Count == 20);
Assert.AreEqual("Amsterdam", result.Embedded.Postcodes[0].City.Label);
}
[TestMethod]
public void GetSinglePostcodeInformation()
{
PostcodeApiClient client = new PostcodeApiClient(ApiKey);
PostcodeArea result = client.GetPostcode("1097JR");
Assert.IsNotNull(result);
Assert.AreEqual(1, result.Streets.Count);
Assert.AreEqual("Pierre Lallementstraat", result.Streets[0]);
Assert.AreEqual("Amsterdam", result.City.Label);
}
}
}