forked from mtusi2026/mtusi2026lab6
chore: import lab5 baseline
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
type ModelSuite struct {
|
||||
suite.Suite
|
||||
}
|
||||
|
||||
func TestModelSuite(t *testing.T) {
|
||||
suite.Run(t, new(ModelSuite))
|
||||
}
|
||||
|
||||
func (s *ModelSuite) TestUserTimestampHasFixedMicroseconds() {
|
||||
createdAt := time.Date(2026, time.September, 23, 21, 28, 15, 423030000, time.UTC)
|
||||
data, err := json.Marshal(User{ID: "id", Username: "user", DisplayName: "User", CreatedAt: createdAt})
|
||||
s.Require().NoError(err)
|
||||
s.Equal(`{"id":"id","username":"user","display_name":"User","created_at":"2026-09-23T21:28:15.423030Z"}`, string(data))
|
||||
}
|
||||
Reference in New Issue
Block a user