-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a test to make sure response codes don't get overlooked
- Loading branch information
1 parent
72d09ba
commit 5a53916
Showing
1 changed file
with
18 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package hedera | ||
|
||
import ( | ||
"github.com/hashgraph/hedera-sdk-go/proto" | ||
"github.com/stretchr/testify/assert" | ||
"testing" | ||
) | ||
|
||
// TestStatusFromProtoToString tests pulling all codes from the proto generated code, | ||
// converting it to the sdk enum, and calling String() | ||
// | ||
// Ideally this will catch any changes to response codes when the protobufs get updated | ||
func TestStatusFromProtoToString(t *testing.T) { | ||
for _, code := range proto.ResponseCodeEnum_value { | ||
status := Status(code) | ||
assert.NotPanics(t, func() { _ = status.String() }) | ||
} | ||
} |