MM-19132 Migrate tests from "model/channel_view_test.go" to us… (#12579)

* Migrate tests from "model/channel_view_test.go" to use testify

* Replace require to assert
Этот коммит содержится в:
Vitalii Ananichev
2019-10-08 17:22:07 +03:00
коммит произвёл jfrerich
родитель 598f7c7255
Коммит 13b28b7a20

Просмотреть файл

@@ -6,6 +6,8 @@ package model
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
)
func TestChannelViewJson(t *testing.T) {
@@ -13,13 +15,8 @@ func TestChannelViewJson(t *testing.T) {
json := o.ToJson()
ro := ChannelViewFromJson(strings.NewReader(json))
if o.ChannelId != ro.ChannelId {
t.Fatal("ChannelIdIds do not match")
}
if o.PrevChannelId != ro.PrevChannelId {
t.Fatal("PrevChannelIds do not match")
}
assert.Equal(t, o.ChannelId, ro.ChannelId, "ChannelIdIds do not match")
assert.Equal(t, o.PrevChannelId, ro.PrevChannelId, "PrevChannelIds do not match")
}
func TestChannelViewResponseJson(t *testing.T) {
@@ -28,11 +25,6 @@ func TestChannelViewResponseJson(t *testing.T) {
json := o.ToJson()
ro := ChannelViewResponseFromJson(strings.NewReader(json))
if o.Status != ro.Status {
t.Fatal("ChannelIdIds do not match")
}
if o.LastViewedAtTimes[id] != ro.LastViewedAtTimes[id] {
t.Fatal("LastViewedAtTimes do not match")
}
assert.Equal(t, o.Status, ro.Status, "ChannelIdIds do not match")
assert.Equal(t, o.LastViewedAtTimes[id], ro.LastViewedAtTimes[id], "LastViewedAtTimes do not match")
}