Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(services): apply mock and naming conventions #391

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: apply test conventions for plivo service
  • Loading branch information
svaloumas committed Sep 12, 2022
commit 74d4576a63a48321ef86cc586b635dc8c84af6cf
36 changes: 0 additions & 36 deletions service/plivo/mock_plivoMsgClient.go

This file was deleted.

51 changes: 51 additions & 0 deletions service/plivo/mock_plivo_msg_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions service/plivo/plivo.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ type MessageOptions struct {
}

// plivoMsgClient abstracts Plivo SDK for writing unit tests
//
//go:generate mockery --name=plivoMsgClient --output=. --case=underscore --inpackage
type plivoMsgClient interface {
Create(plivo.MessageCreateParams) (*plivo.MessageCreateResponseBody, error)
}
Expand Down
6 changes: 3 additions & 3 deletions service/plivo/plivo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestNew(t *testing.T) {
func TestPlivo_New(t *testing.T) {
t.Parallel()

assert := require.New(t)
Expand All @@ -35,7 +35,7 @@ func TestNew(t *testing.T) {
assert.NotNil(svc)
}

func TestAddReceivers(t *testing.T) {
func TestPlivo_AddReceivers(t *testing.T) {
t.Parallel()

assert := require.New(t)
Expand All @@ -50,7 +50,7 @@ func TestAddReceivers(t *testing.T) {
assert.Equal(svc.destinations, nums)
}

func TestSend(t *testing.T) {
func TestPlivo_Send(t *testing.T) {
t.Parallel()

assert := require.New(t)
Expand Down