}else{// if the 'limit' query is empty, or has the wrong value, list everything
marsh,err=json.Marshal(copyOflisting.Items)
}
marsh,err:=json.Marshal(listing.Items)
iferr!=nil{
iferr!=nil{
t.Fatalf("Unable to Marshal the listing ")
t.Fatalf("Unable to Marshal the listing ")
}
}
expectedJsonString:=string(marsh)
expectedJsonString:=string(marsh)
ifactualJsonResponseString!=expectedJsonString{
ifactualJsonResponseString!=expectedJsonString{
t.Errorf("Json response string doesnt match the expected Json response ")
t.Errorf("Json response string doesnt match the expected Json response for test number %d with sort = %s , order = %s,\nExpected response %s\nActual response = %s\n ",i+1,test.SortBy,test.OrderBy,expectedJsonString,actualJsonResponseString)