github.com/joey-fossa/fossa-cli@v0.7.34-0.20190708193710-569f1e8679f0/buildtools/dotnet/nuspec_test.go (about) 1 package dotnet_test 2 3 import ( 4 "testing" 5 6 "github.com/fossas/fossa-cli/buildtools/dotnet" 7 "github.com/stretchr/testify/assert" 8 ) 9 10 func TestNuSpec(t *testing.T) { 11 testGraph, err := dotnet.NuspecGraph("testdata/test.nuspec") 12 assert.NoError(t, err) 13 14 assert.Len(t, testGraph.Direct, 3) 15 assertImport(t, testGraph.Direct, "one", "1.0.0") 16 assertImport(t, testGraph.Direct, "two", "2.0.0") 17 18 assert.Len(t, testGraph.Transitive, 3) 19 depOne := findPackage(testGraph.Transitive, "one", "1.0.0") 20 assert.NotEmpty(t, depOne) 21 assert.Empty(t, depOne.Imports) 22 depTwo := findPackage(testGraph.Transitive, "two", "2.0.0") 23 assert.NotEmpty(t, depTwo) 24 assert.Empty(t, depTwo.Imports) 25 depThree := findPackage(testGraph.Transitive, "three", "3.0.0") 26 assert.NotEmpty(t, depThree) 27 assert.Empty(t, depThree.Imports) 28 }