From a22a425a43af6831f96ae602f5f963e0f2508869 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 | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 engine_test.go diff --git a/engine_test.go b/engine_test.go new file mode 100644 index 00000000..0cbddbda --- /dev/null +++ b/engine_test.go @@ -0,0 +1,35 @@ +package veracity + +import ( + "log/slog" + "testing" + + "github.com/dogmatiq/enginekit/enginetest" + "github.com/dogmatiq/persistencekit/driver/memory/memoryjournal" + "github.com/dogmatiq/persistencekit/driver/memory/memorykv" + "github.com/dogmatiq/spruce" +) + +func TestEngine(t *testing.T) { + logger := slog.Default() + if testing.Verbose() { + logger = spruce.NewLogger(t) + } + + enginetest.RunTests( + t, + func(p enginetest.SetupParams) enginetest.SetupResult { + e := New( + p.App, + WithJournalStore(&memoryjournal.BinaryStore{}), + WithKeyValueStore(&memorykv.BinaryStore{}), + WithLogger(logger), + ) + + return enginetest.SetupResult{ + RunEngine: e.Run, + Executor: e, + } + }, + ) +}