public void TestNewXmlProcessor()
        {
            //Get the switches
            IConfiguration    config = UnitTestHelper.GetConfig();
            CommandLineParser clp    = new CommandLineParser();

            capf.ConfigureCommandLineParser(clp, config);

            List <CommandLineSwitch> lst = new List <CommandLineSwitch>();
            IEnumerator en = clp.AvailableSwitches.GetEnumerator();

            while (en.MoveNext())
            {
                lst.Add(en.Current as CommandLineSwitch);
            }
            IXmlProcessor xmlProc = capf.NewXmlProcessor(lst.ToArray(), config);

            Assert.AreEqual(xmlProc.GetType(), typeof(CSharpAPIProcessor), "Wrong return type.");
            CSharpAPIProcessor csProc = (CSharpAPIProcessor)xmlProc;

            ReflectionEngineParameters rep = (ReflectionEngineParameters)
                                             UnitTestHelper.GetPrivateField(csProc, "rep");

            Assert.IsNotNull(rep, "ReflectionEngineParameters instance not set properly.");
        }
Exemple #2
0
        public void SetUp()
        {
            ConfigManager.GetInstance().LoadFile("../../test_files/logger.xml");

            rep = new ReflectionEngineParameters();
            rep.AssemblyFileNames = new string[] { UnitTestHelper.MOCKLIBPATH };
            rep.ReferencePaths    = new string[] { UnitTestHelper.REFPATH };
            rep.SlashDocFileNames = new string[] { UnitTestHelper.MOCKXMLPATH };
            rep.LoggerNamespace   = "MyLoggerNamespace";
            rep.DocumentPrivates  = true;

            csap = new CSharpAPIProcessor(rep);
        }
Exemple #3
0
        public void TestProcessDocument1()
        {
            rep.TypePrefixes = new string[] { "NoSuchPrefix" };
            csap             = new CSharpAPIProcessor(rep);

            XmlDocument doc = new XmlDocument();

            doc.LoadXml("<apispec></apispec>");

            csap.ProcessDocument(doc);
            Assert.AreEqual("<apispec></apispec>", doc.DocumentElement.OuterXml,
                            "No action must be taken.");
        }
Exemple #4
0
 public void TestConstructorFail1()
 {
     csap = new CSharpAPIProcessor(null);
 }
Exemple #5
0
 public void TearDown()
 {
     ConfigManager.GetInstance().Clear(false);
     csap = null;
 }