resource_test.go 582 B

12345678910111213141516171819202122232425262728293031323334
  1. package resource
  2. import (
  3. "github.com/smartystreets/goconvey/convey"
  4. "testing"
  5. )
  6. var (
  7. s = &Result{
  8. AttributeList: map[string]int8{"one": 0},
  9. }
  10. ss = &Res{
  11. AttributeList: map[string]int8{"one": 0},
  12. }
  13. )
  14. func TestRes_AttrParse(t *testing.T) {
  15. ss.AttrParse(nil)
  16. }
  17. func TestRes_AttrSet(t *testing.T) {
  18. ss.MetaParse()
  19. }
  20. func TestResult_AttrParse(t *testing.T) {
  21. s.AttrParse(nil)
  22. }
  23. func TestResult_AttrSet(t *testing.T) {
  24. s.AttrSet(map[string]uint{"one": 1})
  25. convey.Convey("Result_AttrSet", t, func() {
  26. convey.So(s.AttributeList["one"], convey.ShouldEqual, 1)
  27. })
  28. }