go-common/app/admin/main/aegis/model/resource/resource_test.go

35 lines
582 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package resource
import (
"github.com/smartystreets/goconvey/convey"
"testing"
)
var (
s = &Result{
AttributeList: map[string]int8{"one": 0},
}
ss = &Res{
AttributeList: map[string]int8{"one": 0},
}
)
func TestRes_AttrParse(t *testing.T) {
ss.AttrParse(nil)
}
func TestRes_AttrSet(t *testing.T) {
ss.MetaParse()
}
func TestResult_AttrParse(t *testing.T) {
s.AttrParse(nil)
}
func TestResult_AttrSet(t *testing.T) {
s.AttrSet(map[string]uint{"one": 1})
convey.Convey("Result_AttrSet", t, func() {
convey.So(s.AttributeList["one"], convey.ShouldEqual, 1)
})
}