Ejemplo n.º 1
0
        public void GetAllShapefilesTest()
        {
            ShapefileDAO target = new ShapefileDAO(connnetion);
            Nullable<int> shapefilegroupId = new Nullable<int>(1);
            Nullable<int> page = null;
            Nullable<int> recordsPerPage = null;
            IEnumerable<Shapefile> actual = target.GetShapefiles(shapefilegroupId, page, recordsPerPage);

            Assert.AreEqual(3, actual.Count());
        }
Ejemplo n.º 2
0
        public void GetShapefilesByFileGroupTest()
        {
            ShapefileDAO target = new ShapefileDAO(connnetion);
            Nullable<int> shapefilegroupId = new Nullable<int>(1);
            Nullable<int> page = new Nullable<int>(1);
            Nullable<int> recordsPerPage = new Nullable<int>(1);
            Shapefile expected = new Shapefile
            {
                ID = 1,
                FileName = "distritos.shp",
                Group = new ShapefileGroup
                {
                    ID = 1,
                    Name = "concelhos distritos e freguesias de portugal"
                },
                Level = 1,
                Name = "distritos",
                Path = "D:\\Dropbox\\My Dropbox\\Tese\\shapefiles\\sapo\\GIS\\Distritos"
            };
            IEnumerable<Shapefile> actual = target.GetShapefiles(shapefilegroupId, page, recordsPerPage);

            Assert.AreEqual(1, actual.Count());
            Assert.AreEqual(expected, actual.ElementAt(0));
        }