@Override
    public String getName() {
        return ANALYZER_NAME;
    }
@Test
    public void testNugetconfAnalysis() throws Exception {

        try (Engine engine = new Engine(getSettings())) {
            File file = BaseTest.getResourceAsFile(this, "nugetconf/packages.config");
            Dependency toScan = new Dependency(file);
            NugetconfAnalyzer analyzer = new NugetconfAnalyzer();
            analyzer.setFilesMatched(true);
            analyzer.initialize(getSettings());
            analyzer.prepare(engine);
            analyzer.setEnabled(true);
            analyzer.analyze(toScan, engine);

            int foundCount = 0;

            for (Dependency result : engine.getDependencies()) {
                assertEquals(DEPENDENCY_ECOSYSTEM, result.getEcosystem());
                assertTrue(result.isVirtual());

                switch(result.getName()) {
                    case "Autofac":
                        foundCount++;
                        assertTrue(result.getEvidence(EvidenceType.PRODUCT).toString().contains("Autofac"));
                        assertTrue(result.getEvidence(EvidenceType.VERSION).toString().contains("4.6.2"));
                        break;

                    case "Microsoft.AspNet.WebApi.Core":
                        foundCount++;
                        assertTrue(result.getEvidence(EvidenceType.PRODUCT).toString().contains("Microsoft.AspNet.WebApi.Core"));
                        assertTrue(result.getEvidence(EvidenceType.VERSION).toString().contains("5.2.4"));
                        break;

                    case "Microsoft.Owin":
                        foundCount++;
                        assertTrue(result.getEvidence(EvidenceType.PRODUCT).toString().contains("Microsoft.Owin"));
                        assertTrue(result.getEvidence(EvidenceType.VERSION).toString().contains("3.1.0"));
                        break;

                    case "Newtonsoft.Json":
                        foundCount++;
                        assertTrue(result.getEvidence(EvidenceType.PRODUCT).toString().contains("Newtonsoft.Json"));
                        assertTrue(result.getEvidence(EvidenceType.VERSION).toString().contains("10.0.3"));
                        break;
                    
                    default :
                        break;
                    }
                }
            assertEquals("4 dependencies should be found", 4, foundCount);
        }
    }