Skip to content
Snippets Groups Projects
Commit e9bf9b7b authored by Danis Kirasirov's avatar Danis Kirasirov
Browse files

err checks

parent aff174b0
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,9 @@ import (
func TestAction(t *testing.T) {
t.Run("Protobuf", func(t *testing.T) {
var pbAction *pb.Action
gofakeit.Struct(&pbAction)
err := gofakeit.Struct(&pbAction)
require.NoError(t, err)
action := ActionFromPB(pbAction)
result := ActionToPB(action)
require.Equal(t, pbAction, result)
......@@ -26,7 +28,9 @@ func TestAction(t *testing.T) {
t.Run("Map", func(t *testing.T) {
var action *Action
gofakeit.Struct(&action)
err := gofakeit.Struct(&action)
require.NoError(t, err)
dict := ActionToMap(action)
result, err := ActionFromMap(dict)
require.NoError(t, err)
......@@ -45,7 +49,9 @@ func TestAction(t *testing.T) {
func TestActionRequest(t *testing.T) {
t.Run("Protobuf", func(t *testing.T) {
var pbAction *pb.ActionRequest
gofakeit.Struct(&pbAction)
err := gofakeit.Struct(&pbAction)
require.NoError(t, err)
action := ActionRequestFromPB(pbAction)
result := ActionRequestToPB(action)
require.Equal(t, pbAction, result)
......@@ -62,7 +68,9 @@ func TestActionRequest(t *testing.T) {
func TestActionResponse(t *testing.T) {
t.Run("Protobuf", func(t *testing.T) {
var pbAction *pb.ActionResponse
gofakeit.Struct(&pbAction)
err := gofakeit.Struct(&pbAction)
require.NoError(t, err)
action := ActionResponseFromPB(pbAction)
result := ActionResponseToPB(action)
require.Equal(t, pbAction, result)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment