Dawid Wysokiński
1e6e1efc04
All checks were successful
continuous-integration/drone/push Build is passing
29 lines
594 B
Go
29 lines
594 B
Go
package domain_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gitea.dwysokinski.me/twhelp/core/internal/domain"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestVersion_URL(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
assert.Equal(t, "https://plemiona.pl", domain.Version{
|
|
Host: "plemiona.pl",
|
|
}.URL())
|
|
}
|
|
|
|
func TestVersionNotFoundError(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
err := domain.VersionNotFoundError{
|
|
VerCode: "pl",
|
|
}
|
|
var _ domain.Error = err
|
|
assert.Equal(t, "version (code=pl) not found", err.Error())
|
|
assert.Equal(t, err.Error(), err.UserError())
|
|
assert.Equal(t, domain.ErrorCodeEntityNotFound, err.Code())
|
|
}
|