This repository was archived by the owner on Feb 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathEncodingTests.cs
More file actions
43 lines (36 loc) · 1.27 KB
/
EncodingTests.cs
File metadata and controls
43 lines (36 loc) · 1.27 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
using NUnit.Framework;
using PolylineEncoder.Net.Models;
using PolylineEncoder.Net.Utility;
using System.Collections.Generic;
using System.Linq;
namespace PolylineEncoder.Tests
{
public class DecodeTests
{
[Test]
public void DecodeTest()
{
// arrange
var s = "sezbGuogHuAa@TmFgAeCrBsH|FaG~CHE{IrAPtFkKgF}h@rC{AMuG~FoBpFdNvDoGhDKpBfB~CnKlHmT`IDdB{Yk@}MyCkNjKrDM`DhElFxCvNt@sS|BhB~AeKhBaBqAqDqAV}AoF}Akd@}ByJpAc@JkLfAzPzAUKmf@rBgRn@KP|G|AxCvAuAMqBtAECqCnFsGaHcl@hC{AfAyNhF_IfDsKnGcGtRqC|MbG|AcCxFtHxAyCo@aIdAaA?aFkFuT`JaC~C|Eh@mLzMpCtCaC`@|EzC}HxGbMt@xH_AvAzFs@";
var utility = new PolylineUtility();
// act
IEnumerable<IGeoCoordinate> res = utility.Decode(s);
// assert
Assert.IsTrue(res != null);
Assert.IsTrue(res.ToList().Count > 0);
}
[Test]
public void EncodeTest()
{
// arrange
var expected = "_c`|@_c`|@";
var utility = new PolylineUtility();
var p = new GeoCoordinate(10.0, 10.0);
// act
var encoded = utility.Encode(p);
// assert
Assert.IsTrue(encoded != null);
Assert.IsTrue(encoded == expected);
}
}
}