Этот коммит содержится в:
WonChul Heo
2019-10-11 21:25:31 +07:00
коммит произвёл Jesús Espino
родитель 867027117e
Коммит 68fc1b6e5e

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

@@ -6,6 +6,8 @@ package model
import ( import (
"strings" "strings"
"testing" "testing"
"github.com/stretchr/testify/assert"
) )
func TestClusterInfoJson(t *testing.T) { func TestClusterInfoJson(t *testing.T) {
@@ -13,9 +15,7 @@ func TestClusterInfoJson(t *testing.T) {
json := cluster.ToJson() json := cluster.ToJson()
result := ClusterInfoFromJson(strings.NewReader(json)) result := ClusterInfoFromJson(strings.NewReader(json))
if cluster.IpAddress != result.IpAddress { assert.Equal(t, cluster.IpAddress, result.IpAddress, "Ids do not match")
t.Fatal("Ids do not match")
}
} }
func TestClusterInfosJson(t *testing.T) { func TestClusterInfosJson(t *testing.T) {
@@ -25,7 +25,5 @@ func TestClusterInfosJson(t *testing.T) {
json := ClusterInfosToJson(clusterInfos) json := ClusterInfosToJson(clusterInfos)
result := ClusterInfosFromJson(strings.NewReader(json)) result := ClusterInfosFromJson(strings.NewReader(json))
if clusterInfos[0].IpAddress != result[0].IpAddress { assert.Equal(t, clusterInfos[0].IpAddress, result[0].IpAddress, "Ids do not match")
t.Fatal("Ids do not match")
}
} }