goog.provide('ol.test.geom.MultiPolygon');


describe('ol.geom.MultiPolygon', function() {

  it('can be constructed with a null geometry', function() {
    expect(function() {
      var multiPolygon = new ol.geom.MultiPolygon(null);
      multiPolygon = multiPolygon; // suppress gjslint warning
    }).not.to.throwException();
  });

  describe('with a simple MultiPolygon', function() {

    var multiPolygon;
    beforeEach(function() {
      multiPolygon = new ol.geom.MultiPolygon([
        [[[0, 0], [0, 2], [1, 1], [2, 0]]],
        [[[3, 0], [4, 1], [5, 2], [5, 0]]]
      ]);
    });

    describe('#getSimplifiedGeometry', function() {

      it('returns the expected result', function() {
        var simplifiedGeometry = multiPolygon.getSimplifiedGeometry(1);
        expect(simplifiedGeometry).to.be.an(ol.geom.MultiPolygon);
        expect(simplifiedGeometry.getCoordinates()).to.eql([
          [[[0, 0], [0, 2], [2, 0]]],
          [[[3, 0], [5, 2], [5, 0]]]
        ]);
      });
    });

  });

});


goog.require('ol.geom.MultiPolygon');

@@ -588,16 +588,505 @@
    %7D);%0A%0A
+    it('can return all polygons', function() %7B%0A      var polygons = multiPolygon.getPolygons();%0A      expect(polygons).to.be.an(Array);%0A      expect(polygons).to.have.length(2);%0A      expect(polygons%5B0%5D).to.be.an(ol.geom.Polygon);%0A      expect(polygons%5B0%5D.getCoordinates()).to.eql(%0A          %5B%5B%5B0, 0%5D, %5B0, 2%5D, %5B1, 1%5D, %5B2, 0%5D%5D%5D);%0A      expect(polygons%5B1%5D).to.be.an(ol.geom.Polygon);%0A      expect(polygons%5B1%5D.getCoordinates()).to.eql(%0A          %5B%5B%5B3, 0%5D, %5B4, 1%5D, %5B5, 2%5D, %5B5, 0%5D%5D%5D);%0A    %7D);%0A%0A
     desc
@@ -1520,28 +1520,61 @@
 re('ol.geom.MultiPolygon');%0A
+goog.require('ol.geom.Polygon');%0A

Add test for ol.geom.MultiPolygon#getPolygons