add more tests

This commit is contained in:
41666 2024-10-28 19:53:57 -07:00
parent 74add408e6
commit 4a528fe85a
9 changed files with 266 additions and 55 deletions

22
cmd/pruner/pruner_test.go Normal file
View file

@ -0,0 +1,22 @@
package main
import (
"context"
"testing"
"time"
"github.com/genudine/saerro-go/store/storemock"
)
func TestRun(t *testing.T) {
ps := new(storemock.MockPlayerStore)
vs := new(storemock.MockVehicleStore)
ctx, cancel := context.WithTimeout(context.Background(), time.Second*30)
defer cancel()
ps.On("Prune", ctx).Return(30, nil)
vs.On("Prune", ctx).Return(30, nil)
run(ctx, ps, vs)
}