Skip to content
Snippets Groups Projects
Commit f8a3a535 authored by Malte Bauch's avatar Malte Bauch
Browse files

changed test case `Test_core_Get`, within `core_test.go`

Fixes: #157
parent d2a0f661
No related branches found
No related tags found
6 merge requests!246Develop,!245Develop into Master,!244Master into develop2 into master,!228Merge develop into stmakurz_http_server,!226Resolve "Unit-Test: Test_core_Get is not reliable",!138Develop
Pipeline #89667 passed
......@@ -63,6 +63,7 @@ func Test_core_Get(t *testing.T) {
name string
args args
want []string
length int
wantErr bool
}{
{
......@@ -70,15 +71,28 @@ func Test_core_Get(t *testing.T) {
args: args{
ctx: context.Background(),
request: &pb.GetRequest{
All: true,
Pid: []string{
pndID,
},
},
},
length: 1,
want: []string{
pndID,
"test",
"test",
},
},
{
name: "getAll",
args: args{
ctx: context.Background(),
request: &pb.GetRequest{
All: true,
},
},
length: 2,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
......@@ -91,13 +105,19 @@ func Test_core_Get(t *testing.T) {
return
}
got := []string{
resp.Pnd[0].Id,
resp.Pnd[0].Name,
resp.Pnd[0].Description,
if tt.name == "default" {
got := []string{
resp.Pnd[0].Id,
resp.Pnd[0].Name,
resp.Pnd[0].Description,
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("core.Get() = %v, want %v", got, tt.want)
}
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("core.Get() = %v, want %v", got, tt.want)
length := len(resp.Pnd)
if tt.length != length {
t.Errorf("core.Get() = %v, want %v", length, tt.length)
}
})
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment