Merge pull request #1184 from wingyplus/geo-pos-cmd-result

add NewGeoPosCmdResult to make GeoPos mockable result
This commit is contained in:
Vladimir Mihailenco 2019-12-09 09:59:43 +02:00 committed by GitHub
commit 5e9d366691
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -139,6 +139,14 @@ func NewGeoLocationCmdResult(val []GeoLocation, err error) *GeoLocationCmd {
return &cmd
}
// NewGeoPosCmdResult returns a GeoPosCmd initialised with val and err for testing
func NewGeoPosCmdResult(val []*GeoPos, err error) *GeoPosCmd {
var cmd GeoPosCmd
cmd.val = val
cmd.setErr(err)
return &cmd
}
// NewCommandsInfoCmdResult returns a CommandsInfoCmd initialised with val and err for testing
func NewCommandsInfoCmdResult(val map[string]*CommandInfo, err error) *CommandsInfoCmd {
var cmd CommandsInfoCmd