more tests for Format.Filter.v1, all pass in FF3, IE7 and Chromium6, no functional change

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10421 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Éric Lemoine
2010-06-22 07:08:20 +00:00
parent 9a2363d06b
commit fa1b7d2481

View File

@@ -5,9 +5,14 @@
function test_PropertyIsBetween(t) {
t.plan(3);
t.plan(6);
var test_xml =
var test_wml, parser, xml;
parser = new OpenLayers.Format.Filter.v1();
xml = new OpenLayers.Format.XML();
test_xml =
'<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">' +
'<ogc:PropertyIsBetween>' +
'<ogc:PropertyName>number</ogc:PropertyName>' +
@@ -20,16 +25,30 @@
'</ogc:PropertyIsBetween>' +
'</ogc:Filter>';
var parser = new OpenLayers.Format.Filter.v1();
var xml = new OpenLayers.Format.XML();
var filter = parser.read(xml.read(test_xml).documentElement);
t.eq(filter.type, OpenLayers.Filter.Comparison.BETWEEN,
"read correct type");
"[0] read correct type");
t.eq(filter.lowerBoundary, 0,
"record correct lower boundary value");
"[0] record correct lower boundary value");
t.eq(filter.upperBoundary, 100,
"record correct upper boundary value");
"[0] record correct upper boundary value");
test_xml =
'<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">' +
'<ogc:PropertyIsBetween>' +
'<ogc:PropertyName>number</ogc:PropertyName>' +
'<ogc:LowerBoundary>0</ogc:LowerBoundary>' +
'<ogc:UpperBoundary>100</ogc:UpperBoundary>' +
'</ogc:PropertyIsBetween>' +
'</ogc:Filter>';
var filter = parser.read(xml.read(test_xml).documentElement);
t.eq(filter.type, OpenLayers.Filter.Comparison.BETWEEN,
"[1] read correct type");
t.eq(filter.lowerBoundary, 0,
"[1] record correct lower boundary value");
t.eq(filter.upperBoundary, 100,
"[1] record correct upper boundary value");
}