예제 #1
0
        public void TestGetRates()
        {
            var taxRates = DorTaxRateReader.EnemerateTaxRates(QuarterYear.Current).ToArray();

            Assert.IsNotNull(taxRates);
            CollectionAssert.AllItemsAreNotNull(taxRates);
        }
예제 #2
0
        public FeatureCollection GetCombinedBoundariesAndRates(int year, int quarter, int outSR = _defaultSrid)
        {
            ProjectionInfo targetProjection  = outSR == _defaultSrid ? null : ProjectionInfo.FromEpsgCode(outSR);
            var            boundaries        = DorTaxRateReader.EnumerateLocationCodeBoundariesWithTaxRates(new QuarterYear(year, quarter), targetProjection);
            var            featureCollection = boundaries.ToNtsFeatureCollection(outSR, _omittedFields);

            return(featureCollection);
        }
예제 #3
0
        public FeatureCollection GetSalesTaxJursitictionBoundaries(int year, int quarter, int outSR = _defaultSrid)
        {
            ProjectionInfo targetProjection = outSR == _defaultSrid ? null : ProjectionInfo.FromEpsgCode(outSR);
            var            boundaries       = DorTaxRateReader.EnumerateLocationCodeBoundaries(new QuarterYear(year, quarter), targetProjection);
            var            aliases          = new Dictionary <string, string>();

            aliases.Add("LOCCODE", "LocationCode");
            var featureCollection = boundaries.ToNtsFeatureCollection(outSR, _omittedFields, aliases);

            return(featureCollection);
        }
예제 #4
0
        public void GetCombinedTaxBoundaryFeatures()
        {
            var boundaries = DorTaxRateReader.EnumerateLocationCodeBoundariesWithTaxRates(QuarterYear.Current);

            foreach (var feature in boundaries)
            {
                Assert.IsNotNull(feature, "No featurre should be null.");
                Assert.IsTrue(feature.DataRow.ItemArray.Length >= 8);
                CollectionAssert.AllItemsAreNotNull(feature.DataRow.ItemArray, "All columns should have values.");
            }
        }
예제 #5
0
        public void GetLocationCodeBoundaries()
        {
            const int srid             = 4326;
            var       targetProjection = ProjectionInfo.FromEpsgCode(srid);
            var       boundaries       = DorTaxRateReader.EnumerateLocationCodeBoundaries(QuarterYear.Current, targetProjection);

            Assert.IsNotNull(boundaries);

            foreach (Feature feature in boundaries)
            {
                if (feature.BasicGeometry == null)
                {
                    Assert.Fail("All features should have geometry.");
                    var polygon = feature.BasicGeometry as Polygon;
                    if (polygon == null)
                    {
                        var multipoly = feature.BasicGeometry as MultiPolygon;
                        if (multipoly == null)
                        {
                            Assert.Fail("All geometries must be either polygon or multipolygon.");
                        }
                    }
                    break;
                }
                if (feature.DataRow == null)
                {
                    Assert.Fail("All features should have attributes.");
                    break;
                }
                else if (feature.DataRow["LOCCODE"] == null)
                {
                    Assert.Fail("All features should have \"LOCCODE\" attribute.");
                    break;
                }
            }
        }
예제 #6
0
 public IEnumerable <TaxRateItem> GetTaxRates(int year, int quarter)
 {
     return(DorTaxRateReader.EnemerateTaxRates(new QuarterYear(year, quarter)));
 }