Skip to content

Commit

Permalink
rewrite tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kamaev committed Sep 27, 2018
1 parent 253004c commit bd194c3
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions protectors/matched/matched_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,12 @@ func TestMatchedProtector(t *testing.T) {
for _, val := range databaseResponse {
database.EXPECT().GetMatchedMetricsUpdatesCount().Return(val, nil)
}
//database.EXPECT().GetMatchedMetricsUpdatesCount().Return(int64(0), nil).AnyTimes()
stream := protector.GetStream()
numChecks := 0
for {
select {
case protectorData := <- stream:
fmt.Println(protectorData)
protector.Protect(protectorData)
if numChecks == 10 {
return
}
numChecks ++
}
numChecks := 10
for i := 0; i < numChecks; i++ {
protectorData := <- stream
fmt.Println(protectorData)
protector.Protect(protectorData)
}
})
}

0 comments on commit bd194c3

Please sign in to comment.