Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Commit

Permalink
review domain package
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilsk committed Oct 16, 2018
1 parent fff63fb commit b1b251b
Show file tree
Hide file tree
Showing 7 changed files with 505 additions and 108 deletions.
7 changes: 4 additions & 3 deletions pkg/domain/id_test.go
Expand Up @@ -3,14 +3,15 @@ package domain_test
import (
"testing"

"github.com/kamilsk/form-api/pkg/domain"
"github.com/stretchr/testify/assert"

. "github.com/kamilsk/form-api/pkg/domain"
)

func TestID(t *testing.T) {
tests := []struct {
name string
uuid domain.ID
uuid ID
isValid bool
}{
{"ID is empty", "", false},
Expand All @@ -23,6 +24,6 @@ func TestID(t *testing.T) {
for _, test := range tests {
assert.Equal(t, test.uuid == "", test.uuid.IsEmpty(), test.name)
assert.Equal(t, test.isValid, test.uuid.IsValid(), test.name)
assert.Equal(t, test.uuid, domain.ID(test.uuid.String()), test.name)
assert.Equal(t, test.uuid, ID(test.uuid.String()), test.name)
}
}
1 change: 1 addition & 0 deletions pkg/domain/input.go
Expand Up @@ -30,6 +30,7 @@ const (
)

// Input represents an element of an HTML form.
//go:generate easyjson -all
type Input struct {
ID string `json:"id,omitempty" yaml:"id,omitempty" xml:"id,attr,omitempty"`
Name string `json:"name" yaml:"name" xml:"name,attr"`
Expand Down
198 changes: 198 additions & 0 deletions pkg/domain/input_easyjson.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/domain/schema.go
Expand Up @@ -6,6 +6,7 @@ import (
)

// Schema represents an HTML form.
//go:generate easyjson -all
type Schema struct {
ID string `json:"id,omitempty" yaml:"id,omitempty" xml:"id,attr,omitempty"`
Language string `json:"lang" yaml:"lang" xml:"lang,attr"`
Expand Down

0 comments on commit b1b251b

Please sign in to comment.