This repository has been archived on 2024-04-06. You can view files and clone it, but cannot push or open issues or pull requests.
core-old/internal/domain/version_test.go
Dawid Wysokiński 1e6e1efc04
All checks were successful
continuous-integration/drone/push Build is passing
fix: add missing test
2023-02-28 07:03:42 +01:00

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())
}