예제 #1
0
 public void GetAllShapefileGroupsTest()
 {
     ShapefileDAO target = new ShapefileDAO(connnetion);
     Nullable<int> page = null;
     Nullable<int> recordsPerPage = null;
     IEnumerable<ShapefileGroup> actual = target.GetShapefileGroups(page, recordsPerPage);
     Assert.AreEqual(2, actual.Count());
 }
예제 #2
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());
        }
예제 #3
0
        public void GetShapefileGroupsByPageNumberTest()
        {
            ShapefileDAO target = new ShapefileDAO(connnetion);
            Nullable<int> page = new Nullable<int>(1);
            Nullable<int> recordsPerPage = new Nullable<int>(1);
            ShapefileGroup expected = new ShapefileGroup
            {
                ID = 1,
                Name = "concelhos distritos e freguesias de portugal"
            };
            IEnumerable<ShapefileGroup> actual = target.GetShapefileGroups(page, recordsPerPage);

            Assert.AreEqual(1, actual.Count());
            Assert.AreEqual(expected, actual.ElementAt(0));
        }
예제 #4
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));
        }
예제 #5
0
 public void ShapefileDAOConstructorTest()
 {
     ShapefileDAO target = new ShapefileDAO(connnetion);
     Assert.AreNotEqual(target, null);
 }