Пример #1
0
            public void FailsGracefullyWhenNothingFound()
            {
                var args = new ReverseMilepostArgs(15, 15, new ReverseMilepostOptions());

                var client = new HttpClient();
                var url    = "http://localhost:6080/arcgis/rest/services/Soe/SearchApi/MapServer/exts/Search/ReverseMilepost?{0}&f=json"
                             .With(args.ToQueryString());

                var response = client.GetAsync(url);
                var result   = response.Result.Content.ReadAsStringAsync().Result;

                Assert.That(result, Is.Not.Null);
                Assert.That(result, Is.EqualTo("{\"TopResult\":null,\"EqualCandidates\":[]}"));
            }
Пример #2
0
            public void SkipsRampsAndFindsHighway()
            {
                var args = new ReverseMilepostArgs(423834.42, 4508729.44, new ReverseMilepostOptions());

                var client = new HttpClient();
                var url    = "http://localhost:6080/arcgis/rest/services/Soe/SearchApi/MapServer/exts/Search/ReverseMilepost?{0}&f=json"
                             .With(args.ToQueryString());

                var response = client.GetAsync(url);
                var result   = response.Result.Content.ReadAsStringAsync().Result;

                Assert.That(result, Is.Not.Null);
                Assert.That(result, Does.StartWith(
                                "{\"TopResult\":{\"Milepost\":17.426200270235142,\"Route\":\"0201P\"").IgnoreCase);
            }
Пример #3
0
            public void FindsMilepostOnFederalInterstate()
            {
                var args = new ReverseMilepostArgs(311770, 4510850, new ReverseMilepostOptions());

                var client = new HttpClient();
                var url    = "http://localhost:6080/arcgis/rest/services/Soe/SearchApi/MapServer/exts/Search/ReverseMilepost?{0}&f=json"
                             .With(args.ToQueryString());

                var response = client.GetAsync(url);
                var result   = response.Result.Content.ReadAsStringAsync().Result;

                Assert.That(result, Is.Not.Null);
                Assert.That(result,
                            Does.StartWith("{\"TopResult\":{\"Milepost\":42.848619712799547,\"Route\":\"0080N\"").
                            IgnoreCase);
            }
Пример #4
0
            public void ReprojectsPoints()
            {
                var args = new ReverseMilepostArgs(-111.90190785190332, 40.72597381846899,
                                                   new ReverseMilepostOptions {
                    WkId = 4326
                });

                var client = new HttpClient();
                var url    = "http://localhost:6080/arcgis/rest/services/Soe/SearchApi/MapServer/exts/Search/ReverseMilepost?{0}&f=json"
                             .With(args.ToQueryString());

                var response = client.GetAsync(url);
                var result   = response.Result.Content.ReadAsStringAsync().Result;

                Assert.That(result, Is.Not.Null);
                Assert.That(result, Does.StartWith(
                                "{\"TopResult\":{\"Milepost\":17.42619992647089,\"Route\":\"0201P\"").IgnoreCase);
            }