concept_analyser_test.go 550 字节
Newer Older
P
Phodal Huang 已提交
1 2 3
package concept

import (
4 5
	"github.com/phodal/coca/core/models"
	"github.com/phodal/coca/core/support"
P
Phodal Huang 已提交
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
	"encoding/json"
	"log"
	"testing"

	. "github.com/onsi/gomega"
)

func TestConceptAnalyser_Analysis(t *testing.T) {
	g := NewGomegaWithT(t)

	var parsedDeps []models.JClassNode
	analyser := NewConceptAnalyser()
	file := support.ReadFile("../../../_fixtures/call_api_test.json")
	if file == nil {
		log.Fatal("lost file")
	}

	_ = json.Unmarshal(file, &parsedDeps)

	counts := analyser.Analysis(&parsedDeps)

	g.Expect(counts.Len()).To(Equal(4))
}