示例#1
0
        public void TestSN17001Scanner_initScanner()
        {
            try
            {
                SN17001Scanner scanner = new SN17001Scanner();
                scanner.initScanner();

                //Check Indicator scanner
                if (scanner.Icrscanner == null)
                {
                    throw new Exception("failed to load object");
                }
                else if (scanner.Icrscanner.CRVID != "N17001")
                {
                    throw new Exception("CRVID mismatch");
                }
                else if (scanner.Icrscanner.Patterns.Count < 1)
                {
                    throw new Exception("Icrscanner does not contain patterns");
                }
                else if (scanner.Icrscanner.FileExtensions.Count < 1)
                {
                    throw new Exception("Icrscanner does not contain file extensions");
                }

                //Check Analyzer scanner
                if (scanner.Acrscanner == null)
                {
                    throw new Exception("failed to load object");
                }
                else if (scanner.Acrscanner.CRVID != "N17001")
                {
                    throw new Exception("CRVID mismatch");
                }
                else if (scanner.Acrscanner.Patterns.Count < 1)
                {
                    throw new Exception("Icrscanner does not contain patterns");
                }
                else if (scanner.Acrscanner.FileExtensions.Count < 1)
                {
                    throw new Exception("Icrscanner does not contain file extensions");
                }
            }
            catch (Exception ex)
            {
                throw new AssertFailedException(ex.Message);
            }
        }
示例#2
0
        public void Test17001IScanner()
        {
            SN17001Scanner sn17 = new SN17001Scanner();

            try
            {
                var d = sn17.Scan(@"C:\Working\Project\CampaignPlanner");
                d.Notes = "This is a test scan on a real code base.";
                CRObjSerializer cros = new CRObjSerializer();
                cros.SaveCRObj(CRGlobal.CRScanData + "\\" + d.CRID + "_testScan" + ".xml", d);
            }
            catch (Exception ex)
            {
                throw new AssertFailedException(ex.Message);
            }
        }