public void GetImageBordersOtherCs() { using Image image = Image.NewFromFile(_in4326); Size size = new Size(image.Width, image.Height); Assert.Throws <NotSupportedException>(() => GdalWorker.GetImageBorders(_in4326, size, CsOther)); }
public void GetImageBordersNullSize() { string proj = GdalWorker.GetProjString(_in4326); CoordinateSystem cs = GdalWorker.GetCoordinateSystem(proj); Assert.Throws <ArgumentNullException>(() => GdalWorker.GetImageBorders(_in4326, null, cs)); }
public void GetImageBordersNonExistingPath() { using Image image = Image.NewFromFile(_in4326); Size size = new Size(image.Width, image.Height); string proj = GdalWorker.GetProjString(_in4326); CoordinateSystem cs = GdalWorker.GetCoordinateSystem(proj); Assert.Throws <FileNotFoundException>(() => GdalWorker.GetImageBorders(ShouldFail, size, cs)); }
public void GetImageBordersNullPath() { using Image image = Image.NewFromFile(_in4326); Size size = new Size(image.Width, image.Height); string proj = GdalWorker.GetProjString(_in4326); CoordinateSystem cs = GdalWorker.GetCoordinateSystem(proj); Assert.Throws <ArgumentNullException>(() => GdalWorker.GetImageBorders(null, size, cs)); }
public void GetImageBordersNormal() { using Image image = Image.NewFromFile(_in4326); Size size = new Size(image.Width, image.Height); string proj = GdalWorker.GetProjString(_in4326); CoordinateSystem cs = GdalWorker.GetCoordinateSystem(proj); GeoCoordinate minCoordinate = null; GeoCoordinate maxCoordinate = null; Assert.DoesNotThrow(() => (minCoordinate, maxCoordinate) = GdalWorker.GetImageBorders(_in4326, size, cs)); Assert.True(minCoordinate is GeodeticCoordinate && maxCoordinate is GeodeticCoordinate); }
public void GetImageBordersWrongCs2() { using Image image = Image.NewFromFile(_in3785); Size size = new Size(image.Width, image.Height); Assert.Throws <ArgumentOutOfRangeException>(() => { (GeoCoordinate minCoordinate, GeoCoordinate maxCoordinate) = GdalWorker.GetImageBorders(_in3785, size, Cs4326); // Pass the tests too if (!(minCoordinate is MercatorCoordinate && maxCoordinate is MercatorCoordinate)) { throw new ArgumentOutOfRangeException(); } }); }