1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
package examples
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestIntegerManipulation(t *testing.T) {
t.Parallel()
Convey("Given a starting integer value", t, func() {
x := 42
Convey("When incremented", func() {
x++
Convey("The value should be greater by one", func() {
So(x, ShouldEqual, 43)
})
Convey("The value should NOT be what it used to be", func() {
So(x, ShouldNotEqual, 42)
})
})
Convey("When decremented", func() {
x--
Convey("The value should be lesser by one", func() {
So(x, ShouldEqual, 41)
})
Convey("The value should NOT be what it used to be", func() {
So(x, ShouldNotEqual, 42)
})
})
})
}
|