aboutsummaryrefslogtreecommitdiffstats
path: root/board
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-08-13 12:08:48 +0200
committerMichael Muré <batolettre@gmail.com>2022-08-18 15:55:48 +0200
commit45f5f852b71a63c142bca8b05efe53eebf142594 (patch)
treecb92d9f598b13dda69fbbc652a21d0ad8dc314c2 /board
parentcd52872475f1b39f3fb6546606c1e78afb6c08e3 (diff)
downloadgit-bug-45f5f852b71a63c142bca8b05efe53eebf142594.tar.gz
core: generalized resolvers to resolve any entity time when unmarshalling an operation
Diffstat (limited to 'board')
-rw-r--r--board/resolver_test.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/board/resolver_test.go b/board/resolver_test.go
new file mode 100644
index 00000000..77bfbe61
--- /dev/null
+++ b/board/resolver_test.go
@@ -0,0 +1,28 @@
+package board
+
+import (
+ "fmt"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ "github.com/MichaelMure/git-bug/bug"
+ "github.com/MichaelMure/git-bug/entity"
+ "github.com/MichaelMure/git-bug/identity"
+ "github.com/MichaelMure/git-bug/repository"
+)
+
+func TestResolvers(t *testing.T) {
+ repo := repository.NewMockRepo()
+
+ rs := entity.Resolvers{
+ &identity.IdentityStub{}: identity.NewStubResolver(),
+ &identity.Identity{}: identity.NewSimpleResolver(repo),
+ &bug.Bug{}: bug.NewSimpleResolver(repo),
+ }
+
+ ide, err := entity.Resolve[identity.Interface](rs, "foo")
+ require.NoError(t, err)
+
+ fmt.Println(ide)
+}