Completed
Push — main ( 9faed7...8c19e1 )
by Yume
15s queued 12s
created

test.TestFetchTodayCard   A

Complexity

Conditions 5

Size

Total Lines 22
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 16
nop 1
dl 0
loc 22
rs 9.1333
c 0
b 0
f 0
1
package test
2
3
import (
4
	"github.com/memnix/memnixrest/app/queries"
5
	"reflect"
6
	"testing"
7
)
8
9
func TestFetchTodayCard(t *testing.T) {
10
	tests := []struct {
11
		name   string
12
		userID uint
13
		want   bool
14
	}{
15
		{
16
			name:   "fetch today card",
17
			userID: 6,
18
			want:   true,
19
		},
20
	}
21
22
	_, err := Setup()
23
	if err != nil {
24
		return
25
	}
26
27
	for _, tt := range tests {
28
		t.Run(tt.name, func(t *testing.T) {
29
			if got := queries.FetchTodayCard(tt.userID); !reflect.DeepEqual(got.Success, tt.want) {
30
				t.Errorf("FetchTodayCard() = %v, want %v", got, tt.want)
31
			}
32
		})
33
	}
34
}
35