e2e/payment_method_service_test.go   A
last analyzed

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 28
dl 0
loc 46
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A e2e.TestPaymentMethodService_ResolveDetails 0 16 1
A e2e.TestPaymentMethodService_Create 0 16 1
1
package e2e
2
3
import (
4
	"context"
5
	"net/http"
6
	"testing"
7
8
	"github.com/NdoleStudio/neero-go"
9
	"github.com/davecgh/go-spew/spew"
10
	"github.com/stretchr/testify/assert"
11
)
12
13
func TestPaymentMethodService_Create(t *testing.T) {
14
	// Arrange
15
	request := &neero.CreatePaymentMethodRequestMobileMoneyDetails{
16
		PhoneNumber:         "+237691111111",
17
		CountryIso:          "CM",
18
		MobileMoneyProvider: neero.MobileMoneyProviderOrangeMoney,
19
	}
20
21
	// Act
22
	paymentMethod, response, err := client.PaymentMethod.Create(context.Background(), request)
23
24
	// Assert
25
	assert.Nil(t, err)
26
	assert.Equal(t, http.StatusOK, response.HTTPResponse.StatusCode)
27
	assert.NotEmpty(t, paymentMethod.ID)
28
	spew.Dump(paymentMethod.ID)
29
}
30
31
func TestPaymentMethodService_ResolveDetails(t *testing.T) {
32
	// Arrange
33
	request := &neero.CreatePaymentMethodRequestMobileMoneyDetails{
34
		PhoneNumber:         "+237691111111",
35
		CountryIso:          "CM",
36
		MobileMoneyProvider: neero.MobileMoneyProviderOrangeMoney,
37
	}
38
39
	// Act
40
	paymentMethod, response, err := client.PaymentMethod.ResolveDetails(context.Background(), request)
41
42
	// Assert
43
	assert.Nil(t, err)
44
	assert.Equal(t, http.StatusOK, response.HTTPResponse.StatusCode)
45
	assert.NotEmpty(t, paymentMethod.Name)
46
	spew.Dump(paymentMethod.Name)
47
}
48