-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e1cbfb
commit e0163b1
Showing
3 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2021 Contributors to the Veraison project. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package corim | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestRoles_MarshalJSON_ok(t *testing.T) { | ||
tvs := []struct { | ||
roles *Roles | ||
expected string | ||
}{ | ||
{ | ||
roles: NewRoles().Add(RoleManifestCreator), | ||
expected: `[ "manifestCreator" ]`, | ||
}, | ||
} | ||
|
||
for _, tv := range tvs { | ||
actual, err := tv.roles.MarshalJSON() | ||
|
||
assert.Nil(t, err) | ||
assert.JSONEq(t, tv.expected, string(actual)) | ||
} | ||
} |