예제 #1
0
        public static int Execute(IPlatformFactory factory, ITestLogger logger, ref int testsRun)
        {
            int failures = 0;
            var types    = typeof(MapGuideTests).Assembly.GetTypes();

            foreach (var type in types)
            {
                if (typeof(IExternalTest).IsAssignableFrom(type) && type.IsClass && !type.IsAbstract)
                {
                    var test = (IExternalTest)Activator.CreateInstance(type);
                    try
                    {
                        logger.WriteLine("****** Executing MapGuide test: " + type.Name + " *********");
                        Console.WriteLine("Executing external MapGuide test: " + type.Name);
                        test.Execute(factory, logger);
                    }
                    catch (AssertException ex)
                    {
                        logger.WriteLine("Assertion failure: " + ex.Message);
                        failures++;
                    }
                    catch (Exception ex)
                    {
                        logger.WriteLine("General failure: " + ex.ToString());
                        failures++;
                    }
                    finally
                    {
                        testsRun++;
                    }
                }
            }
            return(failures);
        }
예제 #2
0
        public void Execute(IPlatformFactory factory, ITestLogger logger)
        {
            logger.WriteLine("Skipping CollectionTestsLayerCollection: MgLayerGroupCollection constructor not visible");

            /*
             * MgLayerGroup group1 = new MgLayerGroup("group1");
             * MgLayerGroup group2 = new MgLayerGroup("group2");
             * MgLayerGroup group3 = new MgLayerGroup("group3");
             * MgLayerGroup group4 = new MgLayerGroup("group4");
             *
             * MgLayerGroupCollection coll = new MgLayerGroupCollection();
             * coll.Add(group1);
             * coll.Insert(1, group2);
             * coll.Add(group3);
             * coll.Insert(3, group4);
             *
             * Assert.AreEqual(4, coll.Count);
             * Assert.AreEqual(coll[2].GetName(), "group3");
             *
             * coll[1] = coll[2];
             *
             * string txt = "";
             * foreach (MgLayerGroup group in coll)
             * {
             *  txt += "[" + group.GetName() + "]";
             * }
             * Assert.AreEqual("[group1][group3][group3][group4]", txt);
             */
        }
예제 #3
0
            public void WriteProcessOutputToLog(string processDescription)
            {
                WaitForOutput();

                _testLogger?.WriteLine("");
                _testLogger?.WriteLine($"====== {processDescription} standard output log =====");
                _testLogger?.WriteLine(StandardOutput);
                _testLogger?.WriteLine($"----- {processDescription} end of standard output log  -----");

                _testLogger?.WriteLine("");
                _testLogger?.WriteLine($"====== {processDescription} standard error log =====");
                _testLogger?.WriteLine(StandardError);
                _testLogger?.WriteLine($"----- {processDescription} end of standard error log -----");
                _testLogger?.WriteLine("");
            }
예제 #4
0
        public void Execute(IPlatformFactory factory, ITestLogger logger)
        {
            logger.WriteLine("Skipping PropertiesTestLayerBase: Resource Service required to construct MgLayer");
            //MgUserInformation user = new MgUserInformation("Administrator", "admin");
            //MgSiteConnection siteConnection = new MgSiteConnection();
            //siteConnection.Open(user);
            //MgResourceService resourceService = (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);

            //MgResourceIdentifier id = new MgResourceIdentifier("Library://UnitTests/Data/Shuttle.DrawingSource");

            //MgLayerBase lb = new MgLayerBase(id, resourceService);

            //lb.Name = "TestLayerName";
            //Assert.AreEqual("TestLayerName", lb.Name);

            //Assert.AreEqual(MgLayerType.Dynamic, lb.LayerType);

            //MgLayerGroup lg = new MgLayerGroup("TestLayerGroup");
            //lb.Group = lg;
            //Assert.AreEqual(lg.Name, lb.Group.Name);

            //lb.Visible = true;
            //Assert.AreEqual(true, lb.Visible);
            //lb.Visible = false;
            //Assert.AreEqual(false, lb.Visible);

            //lb.Selectable = true;
            //Assert.AreEqual(true, lb.Selectable);
            //lb.Selectable = false;
            //Assert.AreEqual(false, lb.Selectable);

            //Assert.AreEqual(id.ToString(), lb.LayerDefinition.ToString());

            //lb.DisplayInLegend = true;
            //Assert.AreEqual(true, lb.DisplayInLegend);
            //lb.DisplayInLegend = false;
            //Assert.AreEqual(false, lb.DisplayInLegend);

            //Assert.AreEqual(false, lb.ExpandInLegend);

            //lb.LegendLabel = "TestLegendLabel";
            //Assert.AreEqual("TestLegendLabel", lb.LegendLabel);

            //Assert.AreEqual("", lb.FeatureSourceId);
            //Assert.AreEqual("", lb.FeatureClassName);
        }
예제 #5
0
 public void Execute(IPlatformFactory factory, ITestLogger logger)
 {
     logger.WriteLine("Skipping CollectionTestsReadOnlyLayerCollection: Resource Service required to construct MgLayer");
 }