Esempio n. 1
0
        public void ValidateGeofence_HappyPath()
        {
            var result = GeofenceValidation.ValidateWKT(_validBoundary);

            Assert.Equal(GeofenceValidation.ValidationOk, result);

            var points     = GeofenceValidation.ParseGeometryDataPointLL(_validBoundary);
            var enumerable = points.ToList();

            Assert.Equal(4, enumerable.Count);

            var wkt = GeofenceValidation.GetWicketFromPoints(GeofenceValidation.MakingValidPoints(enumerable));

            Assert.Equal(_validBoundary, wkt);
        }
Esempio n. 2
0
        public void ValidateGeofence_CloseTheOpenGeofence()
        {
            var result = GeofenceValidation.ValidateWKT(_invalidBoundary_NotClosed);

            Assert.Equal(GeofenceValidation.ValidationOk, result);

            var points     = GeofenceValidation.ParseGeometryDataPointLL(_invalidBoundary_NotClosed);
            var enumerable = points.ToList();

            Assert.Equal(3, enumerable.Count);

            var wkt = GeofenceValidation.GetWicketFromPoints(GeofenceValidation.MakingValidPoints(enumerable));

            Assert.Equal(_validBoundary, wkt);
        }
Esempio n. 3
0
        // there no legacyIds: Customer or Project
        public static ProjectValidation MapCreateProjectV5RequestToProjectValidation(CreateProjectV5Request source, string customerUid)
        {
            var projectValidation = new ProjectValidation()
            {
                CustomerUid = new Guid(customerUid),
                ProjectType = CwsProjectType.AcceptsTagFiles,
                ProjectName = source.ProjectName,
                UpdateType  = ProjectUpdateType.Created,
                CoordinateSystemFileName = source.CoordinateSystem.Name
            };

            var internalPoints = AutoMapperUtility.Automapper.Map <List <Point> >(source.BoundaryLL);

            projectValidation.ProjectBoundaryWKT =
                GeofenceValidation.GetWicketFromPoints(GeofenceValidation.MakingValidPoints(internalPoints));
            return(projectValidation);
        }