Skip to content

Commit

Permalink
fix(test): scenario and e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
  • Loading branch information
90dy committed Oct 2, 2018
1 parent 4d8e25f commit 1a883a7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
16 changes: 8 additions & 8 deletions core/test/e2e_test.go
Expand Up @@ -97,7 +97,7 @@ func TestWithEnqueuer(t *testing.T) {
Convey("Alice should only know itself", FailureHalts, func() {
shouldIContinue(t)

contacts, err := alice.client.ContactList(internalCtx, &node.Void{})
contacts, err := alice.client.ContactList(internalCtx, &node.ContactListInput{})
So(err, ShouldBeNil)
So(len(contacts), ShouldEqual, 1) // 'myself' is the only known contact

Expand All @@ -117,7 +117,7 @@ func TestWithEnqueuer(t *testing.T) {
Convey("Bob should only know itself", FailureHalts, func() {
shouldIContinue(t)

contacts, err := bob.client.ContactList(internalCtx, &node.Void{})
contacts, err := bob.client.ContactList(internalCtx, &node.ContactListInput{})
So(err, ShouldBeNil)
So(len(contacts), ShouldEqual, 1) // 'myself' is the only known contact

Expand All @@ -137,7 +137,7 @@ func TestWithEnqueuer(t *testing.T) {
Convey("Eve should only know itself", FailureHalts, func() {
shouldIContinue(t)

contacts, err := eve.client.ContactList(internalCtx, &node.Void{})
contacts, err := eve.client.ContactList(internalCtx, &node.ContactListInput{})
So(err, ShouldBeNil)
So(len(contacts), ShouldEqual, 1) // 'myself' is the only known contact

Expand Down Expand Up @@ -180,7 +180,7 @@ func TestWithEnqueuer(t *testing.T) {
Convey("Alice has en entry in sql for Bob", FailureHalts, func() {
shouldIContinue(t)

contacts, err := alice.client.ContactList(internalCtx, &node.Void{})
contacts, err := alice.client.ContactList(internalCtx, &node.ContactListInput{})
So(err, ShouldBeNil)
So(len(contacts), ShouldEqual, 2)

Expand Down Expand Up @@ -275,7 +275,7 @@ func TestWithEnqueuer(t *testing.T) {
Convey("Bob has en entry in sql for Alice", FailureHalts, func() {
shouldIContinue(t)

contacts, err := bob.client.ContactList(internalCtx, &node.Void{})
contacts, err := bob.client.ContactList(internalCtx, &node.ContactListInput{})
So(err, ShouldBeNil)
So(len(contacts), ShouldEqual, 2)

Expand Down Expand Up @@ -498,7 +498,7 @@ func TestWithEnqueuer(t *testing.T) {
Convey("Alice has Bob as friend", FailureHalts, func() {
shouldIContinue(t)

contacts, err := alice.client.ContactList(internalCtx, &node.Void{})
contacts, err := alice.client.ContactList(internalCtx, &node.ContactListInput{})
So(err, ShouldBeNil)
So(len(contacts), ShouldEqual, 2)

Expand All @@ -520,7 +520,7 @@ func TestWithEnqueuer(t *testing.T) {
Convey("Bob has Alice as friend", FailureHalts, func() {
shouldIContinue(t)

contacts, err := bob.client.ContactList(internalCtx, &node.Void{})
contacts, err := bob.client.ContactList(internalCtx, &node.ContactListInput{})
So(err, ShouldBeNil)
So(len(contacts), ShouldEqual, 2)

Expand All @@ -542,7 +542,7 @@ func TestWithEnqueuer(t *testing.T) {
Convey("Eve has no friend", FailureHalts, func() {
shouldIContinue(t)

contacts, err := eve.client.ContactList(internalCtx, &node.Void{})
contacts, err := eve.client.ContactList(internalCtx, &node.ContactListInput{})
So(err, ShouldBeNil)
So(len(contacts), ShouldEqual, 1)
})
Expand Down
24 changes: 12 additions & 12 deletions core/test/scenario_test.go
Expand Up @@ -31,15 +31,15 @@ func scenario(t *testing.T, alice, bob, eve *AppMock) {
Convey("Nodes should be empty when just initialized", FailureHalts, func() {
shouldIContinue(t)

contacts, err := alice.client.ContactList(internalCtx, &node.Void{})
contacts, err := alice.client.ContactList(internalCtx, &node.ContactListInput{})
So(err, ShouldBeNil)
So(len(contacts), ShouldEqual, 1) // 'myself' is the only known contact

contacts, err = bob.client.ContactList(internalCtx, &node.Void{})
contacts, err = bob.client.ContactList(internalCtx, &node.ContactListInput{})
So(err, ShouldBeNil)
So(len(contacts), ShouldEqual, 1) // 'myself' is the only known contact

contacts, err = eve.client.ContactList(internalCtx, &node.Void{})
contacts, err = eve.client.ContactList(internalCtx, &node.ContactListInput{})
So(err, ShouldBeNil)
So(len(contacts), ShouldEqual, 1) // 'myself' is the only known contact

Expand Down Expand Up @@ -76,7 +76,7 @@ func scenario(t *testing.T, alice, bob, eve *AppMock) {
Convey("Alice has Bob as friend", FailureHalts, func() {
shouldIContinue(t)

contacts, err := alice.client.ContactList(internalCtx, &node.Void{})
contacts, err := alice.client.ContactList(internalCtx, &node.ContactListInput{})
So(err, ShouldBeNil)
So(len(contacts), ShouldEqual, 2)

Expand All @@ -95,7 +95,7 @@ func scenario(t *testing.T, alice, bob, eve *AppMock) {
Convey("Bob has Alice as friend", FailureHalts, func() {
shouldIContinue(t)

contacts, err := bob.client.ContactList(internalCtx, &node.Void{})
contacts, err := bob.client.ContactList(internalCtx, &node.ContactListInput{})
So(err, ShouldBeNil)
So(len(contacts), ShouldEqual, 2)

Expand All @@ -114,7 +114,7 @@ func scenario(t *testing.T, alice, bob, eve *AppMock) {
Convey("Eve has no friend", FailureHalts, func() {
shouldIContinue(t)

contacts, err := eve.client.ContactList(internalCtx, &node.Void{})
contacts, err := eve.client.ContactList(internalCtx, &node.ContactListInput{})
So(err, ShouldBeNil)
So(len(contacts), ShouldEqual, 1)
})
Expand All @@ -126,7 +126,7 @@ func scenario(t *testing.T, alice, bob, eve *AppMock) {
Convey("Bob has no conversation", FailureHalts, func() {
shouldIContinue(t)

conversations, err := bob.client.ConversationList(internalCtx, &node.Void{})
conversations, err := bob.client.ConversationList(internalCtx, &node.ConversationListInput{})
So(err, ShouldBeNil)
So(len(conversations), ShouldEqual, 0)

Expand All @@ -135,7 +135,7 @@ func scenario(t *testing.T, alice, bob, eve *AppMock) {
Convey("Alice has no conversation", FailureHalts, func() {
shouldIContinue(t)

conversations, err := alice.client.ConversationList(internalCtx, &node.Void{})
conversations, err := alice.client.ConversationList(internalCtx, &node.ConversationListInput{})
So(err, ShouldBeNil)
So(len(conversations), ShouldEqual, 0)

Expand All @@ -144,7 +144,7 @@ func scenario(t *testing.T, alice, bob, eve *AppMock) {
Convey("Eve has no conversation", FailureHalts, func() {
shouldIContinue(t)

conversations, err := eve.client.ConversationList(internalCtx, &node.Void{})
conversations, err := eve.client.ConversationList(internalCtx, &node.ConversationListInput{})
So(err, ShouldBeNil)
So(len(conversations), ShouldEqual, 0)

Expand All @@ -170,7 +170,7 @@ func scenario(t *testing.T, alice, bob, eve *AppMock) {
Convey("Bob has a conversation with Alice", FailureHalts, func() {
shouldIContinue(t)

conversations, err := bob.client.ConversationList(internalCtx, &node.Void{})
conversations, err := bob.client.ConversationList(internalCtx, &node.ConversationListInput{})
So(err, ShouldBeNil)
So(len(conversations), ShouldEqual, 1)

Expand All @@ -186,7 +186,7 @@ func scenario(t *testing.T, alice, bob, eve *AppMock) {
Convey("Alice has the conversation with Bob", FailureHalts, func() {
shouldIContinue(t)

conversations, err := alice.client.ConversationList(internalCtx, &node.Void{})
conversations, err := alice.client.ConversationList(internalCtx, &node.ConversationListInput{})
So(err, ShouldBeNil)
So(len(conversations), ShouldEqual, 1)

Expand All @@ -207,7 +207,7 @@ func scenario(t *testing.T, alice, bob, eve *AppMock) {
Convey("Eve has no conversation (again)", FailureHalts, func() {
shouldIContinue(t)

conversations, err := eve.client.ConversationList(internalCtx, &node.Void{})
conversations, err := eve.client.ConversationList(internalCtx, &node.ConversationListInput{})
So(err, ShouldBeNil)
So(len(conversations), ShouldEqual, 0)
})
Expand Down

0 comments on commit 1a883a7

Please sign in to comment.