2021-09-29 20:35:39 +00:00
|
|
|
package domain
|
|
|
|
|
2021-12-29 20:08:30 +00:00
|
|
|
import (
|
2023-01-02 01:15:11 +00:00
|
|
|
"net/url"
|
2021-12-29 20:08:30 +00:00
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Profile describes the data about the user.
|
2021-09-29 20:35:39 +00:00
|
|
|
type Profile struct {
|
2023-08-07 03:07:55 +00:00
|
|
|
Photo *url.URL `json:"photo,omitempty"`
|
|
|
|
URL *url.URL `json:"url,omitempty"`
|
|
|
|
Email *Email `json:"email,omitempty"`
|
|
|
|
Name string `json:"name,omitempty"`
|
2021-09-29 20:35:39 +00:00
|
|
|
}
|
|
|
|
|
2022-02-17 14:58:13 +00:00
|
|
|
func NewProfile() *Profile {
|
|
|
|
return &Profile{
|
2023-08-07 03:07:55 +00:00
|
|
|
Photo: new(url.URL),
|
|
|
|
URL: new(url.URL),
|
|
|
|
Email: new(Email),
|
|
|
|
Name: "",
|
2022-02-17 14:58:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-29 20:08:30 +00:00
|
|
|
// TestProfile returns a valid Profile with the generated test data filled in.
|
2021-09-29 20:35:39 +00:00
|
|
|
func TestProfile(tb testing.TB) *Profile {
|
|
|
|
tb.Helper()
|
|
|
|
|
|
|
|
return &Profile{
|
2023-08-07 03:07:55 +00:00
|
|
|
Email: TestEmail(tb),
|
|
|
|
Name: "Example User",
|
|
|
|
Photo: &url.URL{Scheme: "https", Host: "user.example.net", Path: "/photo.jpg"},
|
|
|
|
URL: &url.URL{Scheme: "https", Host: "user.example.net", Path: "/"},
|
2021-09-29 20:35:39 +00:00
|
|
|
}
|
|
|
|
}
|