From 60cea1b10fd9d0e44c128890040fe58c0c31da45 Mon Sep 17 00:00:00 2001 From: James Harris Date: Fri, 26 May 2023 10:01:51 +1000 Subject: [PATCH] Add enginekit acceptance tests. --- engine_test.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 engine_test.go diff --git a/engine_test.go b/engine_test.go new file mode 100644 index 00000000..a37c3690 --- /dev/null +++ b/engine_test.go @@ -0,0 +1,34 @@ +package veracity + +import ( + "testing" + + "github.com/dogmatiq/enginekit/enginetest" + "github.com/dogmatiq/veracity/internal/test" + "github.com/dogmatiq/veracity/persistence/driver/memory" + "golang.org/x/exp/slog" +) + +func TestEngine(t *testing.T) { + logger := slog.Default() + if testing.Verbose() { + logger = test.NewLogger(t) + } + + enginetest.RunTests( + t, + func(p enginetest.SetupParams) enginetest.SetupResult { + e := New( + p.App, + WithJournalStore(&memory.JournalStore{}), + WithKeyValueStore(&memory.KeyValueStore{}), + WithLogger(logger), + ) + + return enginetest.SetupResult{ + RunEngine: e.Run, + Executor: e, + } + }, + ) +}