mirror of
https://github.com/hybridgroup/gobot.git
synced 2025-04-29 13:49:14 +08:00
66 lines
1.3 KiB
Go
66 lines
1.3 KiB
Go
![]() |
package gobotArdrone
|
||
|
|
||
|
import (
|
||
|
. "github.com/onsi/ginkgo"
|
||
|
. "github.com/onsi/gomega"
|
||
|
)
|
||
|
|
||
|
var _ = Describe("ArdroneDriver", func() {
|
||
|
var (
|
||
|
driver *ArdroneDriver
|
||
|
)
|
||
|
|
||
|
BeforeEach(func() {
|
||
|
connect = func(me *ArdroneAdaptor) {
|
||
|
d := new(testDrone)
|
||
|
me.ardrone = d
|
||
|
}
|
||
|
adaptor := new(ArdroneAdaptor)
|
||
|
driver = NewArdrone(adaptor)
|
||
|
adaptor.Connect()
|
||
|
})
|
||
|
|
||
|
It("Must be able to Start", func() {
|
||
|
Expect(driver.Start()).To(Equal(true))
|
||
|
})
|
||
|
It("Must be able to Init", func() {
|
||
|
Expect(driver.Init()).To(Equal(true))
|
||
|
})
|
||
|
It("Must be able to Halt", func() {
|
||
|
Expect(driver.Halt()).To(Equal(true))
|
||
|
})
|
||
|
It("Must be able to TakeOff", func() {
|
||
|
driver.TakeOff()
|
||
|
})
|
||
|
It("Must be able to Land", func() {
|
||
|
driver.Land()
|
||
|
})
|
||
|
It("Must be able to go Up", func() {
|
||
|
driver.Up(1)
|
||
|
})
|
||
|
It("Must be able to go Down", func() {
|
||
|
driver.Down(1)
|
||
|
})
|
||
|
It("Must be able to go Left", func() {
|
||
|
driver.Left(1)
|
||
|
})
|
||
|
It("Must be able to go Right", func() {
|
||
|
driver.Right(1)
|
||
|
})
|
||
|
It("Must be able to go Forward", func() {
|
||
|
driver.Forward(1)
|
||
|
})
|
||
|
It("Must be able to go Backward", func() {
|
||
|
driver.Backward(1)
|
||
|
})
|
||
|
It("Must be able to go Clockwise", func() {
|
||
|
driver.Clockwise(1)
|
||
|
})
|
||
|
It("Must be able to go CounterClockwise", func() {
|
||
|
driver.CounterClockwise(1)
|
||
|
})
|
||
|
It("Must be able to Hover", func() {
|
||
|
driver.Hover()
|
||
|
})
|
||
|
})
|