}
func TestNilConnection(t *testing.T) {
+ RegisterTestingT(t)
var conn *Connection
ch, err := conn.NewAPIChannel()
Expect(conn).Should(BeNil())
}
+func TestAsyncConnection(t *testing.T) {
+ ctx := setupTest(t)
+ defer ctx.teardownTest()
+
+ ctx.conn.Disconnect()
+ conn, ch, err := AsyncConnect(ctx.mockVpp)
+ ctx.conn = conn
+
+ Expect(err).ShouldNot(HaveOccurred())
+ Expect(conn).ShouldNot(BeNil())
+
+ ev := <-ch
+ Expect(ev.State).Should(BeEquivalentTo(Connected))
+}
+
func TestFullBuffer(t *testing.T) {
ctx := setupTest(t)
defer ctx.teardownTest()