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

Merge branch '157-unit-test-test_core_get-is-not-reliable' into 'develop'

Resolve "Unit-Test: Test_core_Get is not reliable"

See merge request !226
parents d2a0f661 f8a3a535
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 #89670 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