1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.owasp.dependencycheck.analyzer;
19
20 import static org.junit.Assert.assertEquals;
21 import static org.junit.Assert.assertFalse;
22 import static org.junit.Assert.assertTrue;
23 import org.junit.Before;
24 import org.junit.Test;
25 import org.owasp.dependencycheck.BaseTest;
26
27 import java.io.File;
28
29 public class NuspecAnalyzerTest extends BaseTest {
30
31 private NuspecAnalyzer instance;
32
33 @Before
34 public void setUp() throws Exception {
35 instance = new NuspecAnalyzer();
36 instance.initialize();
37 instance.setEnabled(true);
38 }
39
40 @Test
41 public void testGetAnalyzerName() {
42 assertEquals("Nuspec Analyzer", instance.getName());
43 }
44
45 @Test
46 public void testSupportsFileExtensions() {
47 assertTrue(instance.accept(new File("test.nuspec")));
48 assertFalse(instance.accept(new File("test.nupkg")));
49 }
50
51 @Test
52 public void testGetAnalysisPhaze() {
53 assertEquals(AnalysisPhase.INFORMATION_COLLECTION, instance.getAnalysisPhase());
54 }
55 }
56
57