Skip to content

Commit

Permalink
another!
Browse files Browse the repository at this point in the history
  • Loading branch information
sighphyre committed Dec 8, 2023
1 parent 56aa1e5 commit c411eeb
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,40 +223,40 @@ func TestClient_ListFeatures(t *testing.T) {
require.Equal(t, features, client.ListFeatures())
}

// func TestClientWithProjectName(t *testing.T) {
// assert := assert.New(t)
// projectName := "myProject"
// defer gock.OffAll()
func TestClientWithProjectName(t *testing.T) {
assert := assert.New(t)
projectName := "myProject"
defer gock.OffAll()

// gock.New(mockerServer).
// Post("/client/register").
// Reply(200)
gock.New(mockerServer).
Post("/client/register").
Reply(200)

// gock.New(mockerServer).
// Get("/client/features").
// MatchParam("project", projectName).
// Reply(200).
// JSON(api.FeatureResponse{})
gock.New(mockerServer).
Get("/client/features").
MatchParam("project", projectName).
Reply(200).
JSON(api.FeatureResponse{})

// mockListener := &MockedListener{}
// mockListener.On("OnReady").Return()
// mockListener.On("OnRegistered", mock.AnythingOfType("ClientData"))
// mockListener.On("OnError").Return()
mockListener := &MockedListener{}
mockListener.On("OnReady").Return()
mockListener.On("OnRegistered", mock.AnythingOfType("ClientData"))
mockListener.On("OnError").Return()

// client, err := NewClient(
// WithUrl(mockerServer),
// WithAppName(mockAppName),
// WithInstanceId(mockInstanceId),
// WithProjectName(projectName),
// WithListener(mockListener),
// )
client, err := NewClient(
WithUrl(mockerServer),
WithAppName(mockAppName),
WithInstanceId(mockInstanceId),
WithProjectName(projectName),
WithListener(mockListener),
)

// client.WaitForReady()
client.WaitForReady()

// assert.NoError(err)
// assert.Equal(client.options.projectName, projectName)
// assert.True(gock.IsDone(), "there should be no more mocks")
// }
assert.NoError(err)
assert.Equal(client.options.projectName, projectName)
assert.True(gock.IsDone(), "there should be no more mocks")
}

// func TestClientWithoutProjectName(t *testing.T) {
// assert := assert.New(t)
Expand Down

0 comments on commit c411eeb

Please sign in to comment.