Skip to content

Commit

Permalink
add a test to make sure response codes don't get overlooked
Browse files Browse the repository at this point in the history
  • Loading branch information
QuestofIranon committed Feb 19, 2020
1 parent 72d09ba commit 5a53916
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions status_test.go
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() })
}
}

0 comments on commit 5a53916

Please sign in to comment.