You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bog/test/domain/services_test.go

31 lines
607 B
Go

package test
import (
"testing"
"caj-larsson/bog/domain"
"caj-larsson/bog/test/mock"
)
var file_ref1 = domain.FileReference { "path1", "ua1" }
//var file_ref2 = domain.FileReference { "path1", "ua2" }
//var file_ref3 = domain.FileReference { "path2", "ua1" }
func TestFileService(t *testing.T) {
file_repo := mock.NewMockFileRepository()
ua_repo := mock.NewMockUserAgentRepository()
service := domain.NewBogFileService(ua_repo, file_repo)
outfile, err := service.OpenOutFile(file_ref1)
if outfile != nil && err != domain.ErrNotExists {
t.Errorf("File shall not exist by default")
}
}