e2e.TestVariantsService_Get   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nop 1
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
package e2e
2
3
import (
4
	"context"
5
	"net/http"
6
	"testing"
7
8
	"github.com/davecgh/go-spew/spew"
9
10
	"github.com/stretchr/testify/assert"
11
)
12
13
func TestVariantsService_Get(t *testing.T) {
14
	// Act
15
	variant, response, err := client.Variants.Get(context.Background(), 36095)
16
17
	// Assert
18
	assert.Nil(t, err)
19
20
	assert.Equal(t, http.StatusOK, response.HTTPResponse.StatusCode)
21
	assert.Equal(t, "36095", variant.Data.ID)
22
}
23
24
func TestVariantsService_List(t *testing.T) {
25
	// Act
26
	variants, response, err := client.Variants.List(context.Background())
27
28
	spew.Dump(variants)
29
30
	// Assert
31
	assert.Nil(t, err)
32
33
	assert.Equal(t, http.StatusOK, response.HTTPResponse.StatusCode)
34
	assert.Equal(t, 6, len(variants.Data))
35
}
36