forked from SharpMap/SharpMap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestWmsCapabilityParser.cs
More file actions
50 lines (46 loc) · 1.88 KB
/
TestWmsCapabilityParser.cs
File metadata and controls
50 lines (46 loc) · 1.88 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
using System;
using NUnit.Framework;
using SharpMap.Layers;
using SharpMap.Web.Wms;
namespace UnitTests
{
[TestFixture]
public class TestWmsCapabilityParser
{
[Test]
[Ignore("http://wms.iter.dk is no longer available")]
public void AddLayerFail()
{
WmsLayer layer = new WmsLayer("wms", "http://wms.iter.dk/example_capabilities_1_3_0.xml");
Assert.Throws<ArgumentException>(() => layer.AddLayer("NonExistingLayer") );
}
[Test]
[Ignore("http://wms.iter.dk is no longer available")]
public void AddLayerOK()
{
WmsLayer layer = new WmsLayer("wms", "http://wms.iter.dk/example_capabilities_1_3_0.xml");
layer.AddLayer("ROADS_1M");
}
[Test]
[Ignore("http://wms.iter.dk is no longer available")]
public void Test130()
{
Client c = new Client("http://wms.iter.dk/example_capabilities_1_3_0.xml");
Assert.AreEqual(3, c.ServiceDescription.Keywords.Length);
Assert.AreEqual("1.3.0", c.Version);
Assert.AreEqual("http://hostname/path?", c.GetMapRequests[0].OnlineResource);
Assert.AreEqual("image/gif", c.GetMapOutputFormats[0]);
Assert.AreEqual(4, c.Layer.ChildLayers.Length);
}
[Test, Ignore("Assumption false")]
public void TestDemisv111()
{
Client c = new Client("http://www2.demis.nl/worldmap/wms.asp");
Assert.AreEqual("World Map", c.ServiceDescription.Title);
Assert.AreEqual("1.1.1", c.Version);
Assert.AreEqual("http://www2.demis.nl/wms/wms.asp?wms=WorldMap&", c.GetMapRequests[0].OnlineResource);
Assert.AreEqual("image/png", c.GetMapOutputFormats[0]);
Assert.AreEqual(20, c.Layer.ChildLayers.Length);
}
}
}