Example #1
0
        public override TestResult Execute(int paramSetId)
        {
            try
            {
                this.CreateMapFromResource(paramSetId);

                _unitTestVm.Execute("Select ParamValue from Params WHERE ParamSet={0} AND ParamName=\"GROUPNAME\"", paramSetId);
                string groupName = _unitTestVm.GetString("ParamValue");

                _unitTestVm.Execute("Select ParamValue from Params WHERE ParamSet={0} AND ParamName=\"PARENTGROUPNAME\"", paramSetId);
                string parentGroupName = _unitTestVm.GetString("ParamValue");

                var groups = _map.GetLayerGroups();
                var group  = new MgLayerGroup(groupName);
                if (!string.IsNullOrEmpty(parentGroupName))
                {
                    var parentGroup = groups.GetItem(parentGroupName);
                    group.SetGroup(parentGroup);
                }
                groups.Add(group);

                return(new TestResult(groups.GetCount().ToString(), "text/plain"));
            }
            catch (MgException ex)
            {
                return(TestResult.FromMgException(ex));
            }
        }