Home | History | Annotate | Download | only in filesystem
      1 package filesystem
      2 
      3 import (
      4 	"testing"
      5 
      6 	"github.com/stretchr/testify/assert"
      7 
      8 	e "repodiff/entities"
      9 )
     10 
     11 func TestReadXMLAsEntity(t *testing.T) {
     12 	var manifest e.ManifestFile
     13 	err := ReadXMLAsEntity("testdata/manifest.xml", &manifest)
     14 	assert.Equal(t, nil, err, "Error should be nil")
     15 	assert.Equal(t, 761, len(manifest.Projects), "Number of loaded projects")
     16 }
     17 
     18 func TestReadXMLAsEntityFileDoesNotExist(t *testing.T) {
     19 	var manifest e.ManifestFile
     20 	err := ReadXMLAsEntity("testdata/non_existent_file.xml", &manifest)
     21 	assert.NotEqual(t, nil, err, "Error should be generated")
     22 }
     23