public void ShouldSerializeProperly() { HTTPService restService = new HTTPService { Type = "TestService", Name = "TestService", Url = "testeurl.com" }; TCPService tcpService = new TCPService { Type = "TestService", Name = "TestService", Host = "testeurl.com", Port = "5555" }; var arcGISHealtChekerGroup = new ArcGISHealthCheckerGroup { Name = "TestProject", HTTPServices = new List<HTTPService> { restService }, TCPServices = new List<TCPService> { tcpService } }; var arcGISHealtCheker = new ArcGISHealthChecker { Groups = new List<ArcGISHealthCheckerGroup> { arcGISHealtChekerGroup } }; var testFile = GetTempTestFileName(); ConfigurationReader.SerializeToXML(arcGISHealtCheker, testFile); File.Exists(testFile).Should().Be.True(); File.Delete(testFile); }
public void TestGeometryService() { var httpService = new HTTPService() { Type = "Test", Name = "TestName", Url = "http://srvwindev07/ArcGIS/rest/services/Geometry/GeometryServer/project?inSR=4326&outSR=102100&geometries=%7B%22geometryType%22+%3A+%22esriGeometryPoint%22%2C%22geometries%22%3A%5B+%7B%22x%22+%3A+-63.53%2C+%22y%22+%3A+10.23%7D%5D%7D&f=json" }; var httpServices = new List<HTTPService> { httpService }; var servicesStatus = httpChecker.CheckHTTPServices(httpServices); servicesStatus.Count.Should().Be(1); servicesStatus[0].Status.Should().Be("ON"); servicesStatus[0].Error.Should().Be.Null(); }
public void TestInexistentURL() { var httpService = new HTTPService() { Type = "Test", Name = "TestName", Url = "http://192.213.102.115:6080/NAOEXISTE/" }; var httpServices = new List<HTTPService> { httpService }; var servicesStatus = httpChecker.CheckHTTPServices(httpServices); servicesStatus.Count.Should().Be(1); servicesStatus[0].Name.Should().Be("TestName"); servicesStatus[0].Type.Should().Be("Test"); servicesStatus[0].Status.Should().Be("OFF"); servicesStatus[0].Error.Should().Not.Be.Null(); }
public void TestInexistentRESTService() { var httpService = new HTTPService() { Type = "Test", Name = "TestName", Url = "http://192.213.102.115:6080/arcgis/rest/services/SampleWorldCitiesSSS/MapServer?f=json" }; var httpServices = new List<HTTPService> { httpService }; var servicesStatus = httpChecker.CheckHTTPServices(httpServices); servicesStatus.Count.Should().Be(1); servicesStatus[0].Name.Should().Be("TestName"); servicesStatus[0].Type.Should().Be("Test"); servicesStatus[0].Status.Should().Be("OFF"); servicesStatus[0].Error.Should().Not.Be.Null(); }
public void TestMapFeatureServices() { var urls = new string[] { "http://192.213.102.115:6080/arcgis/rest/services/SampleWorldCities/MapServer/0/query?f=json&where=0%3D1", "http://192.213.102.115:6080/arcgis/rest/services/World/MapServer/0/query?f=json&where=0%3D1", "http://192.213.102.115:6080/arcgis/rest/services/World/FeatureServer/0/query?f=json&where=0%3D1", "http://srvwindev07/ArcGIS/rest/services/GES/BusinessServices_View/MapServer/0/query?f=json&where=0%3D1" }; var httpServices = new List<HTTPService>(); foreach (var url in urls) { var httpService = new HTTPService() { Type = "Test", Name = "TestName", Url = url }; httpServices.Add(httpService); } var servicesStatus = httpChecker.CheckHTTPServices(httpServices); servicesStatus.Count.Should().Be(4); servicesStatus.Count(s => s.Status == "ON").Should().Be(4); servicesStatus.Count(s => s.Error == null).Should().Be(4); }