Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package model
import (
"testing"
"github.com/smartystreets/goconvey/convey"
)
func TestDispatchState(t *testing.T) {
convey.Convey("UpState", t, func() {
dispatchState := int32(0x3a4b5c6d)
role := int8(1)
result, _ := DispatchState(dispatchState, role)
convey.So(result, convey.ShouldEqual, uint32(0x6))
})
}
func TestSetDispatchState(t *testing.T) {
convey.Convey("UpState", t, func() {
dispatchState := int32(0x3a4b5c6d)
state := int8(0x1)
role := int8(1)
result, err := SetDispatchState(dispatchState, role, state)
convey.ShouldBeNil(err)
convey.So(result, convey.ShouldEqual, uint32(0x3a4b5c1d))
})
}