Skip to content

Commit

Permalink
added some test assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
woutslakhorst committed Jun 18, 2024
1 parent a31a913 commit 22caae4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions vdr/sql/did_document_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func TestSqlDIDDocumentManager_CreateOrUpdate(t *testing.T) {
assert.Equal(t, "did:web:example.com:iam:alice#1", doc.ID)
assert.Equal(t, alice.String(), doc.DID.ID)
assert.Equal(t, "alice", doc.DID.Subject)
assert.Equal(t, "did:web:example.com:iam:alice", doc.DidID)
})
t.Run("with method and services", func(t *testing.T) {
tx := transaction(t, db)
Expand All @@ -61,8 +62,12 @@ func TestSqlDIDDocumentManager_CreateOrUpdate(t *testing.T) {
doc, err := docManager.CreateOrUpdate(sqlDidBob, []SqlVerificationMethod{vm}, []SqlService{service})
require.NoError(t, err)

assert.Len(t, doc.VerificationMethods, 1)
assert.Len(t, doc.Services, 1)
require.Len(t, doc.VerificationMethods, 1)
require.Len(t, doc.Services, 1)
assert.Equal(t, "did:web:example.com:iam:bob#1", doc.VerificationMethods[0].DIDDocumentID)
assert.Equal(t, "did:web:example.com:iam:bob#1", doc.Services[0].DIDDocumentID)
assert.Equal(t, []byte("{}"), doc.VerificationMethods[0].Data)
assert.Equal(t, []byte("{}"), doc.Services[0].Data)
})
t.Run("update", func(t *testing.T) {
tx := db.Begin()
Expand Down

0 comments on commit 22caae4

Please sign in to comment.