refactor tests, move to testify tests (#12604)
Этот коммит содержится в:
коммит произвёл
Jesús Espino
родитель
8f93d3b6f0
Коммит
77dc6a9544
@@ -6,14 +6,13 @@ package model
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestAuditJson(t *testing.T) {
|
func TestAuditJson(t *testing.T) {
|
||||||
audit := Audit{Id: NewId(), UserId: NewId(), CreateAt: GetMillis()}
|
audit := Audit{Id: NewId(), UserId: NewId(), CreateAt: GetMillis()}
|
||||||
json := audit.ToJson()
|
json := audit.ToJson()
|
||||||
result := AuditFromJson(strings.NewReader(json))
|
result := AuditFromJson(strings.NewReader(json))
|
||||||
|
require.Equal(t, audit.Id, result.Id, "Ids do not match")
|
||||||
if audit.Id != result.Id {
|
|
||||||
t.Fatal("Ids do not match")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user