Improve code coverage for PM File Converter (Go)
[nonrtric/plt/ranpm.git] / pm-file-converter / common / utils / utils_test.go
1 package utils
2
3 import (
4         "github.com/stretchr/testify/assert"
5         "testing"
6 )
7
8 func TestSend_http_request(t *testing.T) {
9         type testCase struct {
10                 Name string
11
12                 Json    []byte
13                 Method  string
14                 Url     string
15                 Retry   bool
16                 UseAuth bool
17
18                 ExpectedBool bool
19         }
20
21         validate := func(t *testing.T, tc *testCase) {
22                 t.Run(tc.Name, func(t *testing.T) {
23                         actualBool := Send_http_request(tc.Json, tc.Method, tc.Url, tc.Retry, tc.UseAuth)
24
25                         assert.Equal(t, tc.ExpectedBool, actualBool)
26                 })
27         }
28
29         validate(t, &testCase{})
30 }