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 ( ...@@ -11,7 +11,9 @@ import (
func TestAction(t *testing.T) { func TestAction(t *testing.T) {
t.Run("Protobuf", func(t *testing.T) { t.Run("Protobuf", func(t *testing.T) {
var pbAction *pb.Action var pbAction *pb.Action
gofakeit.Struct(&pbAction) err := gofakeit.Struct(&pbAction)
require.NoError(t, err)
action := ActionFromPB(pbAction) action := ActionFromPB(pbAction)
result := ActionToPB(action) result := ActionToPB(action)
require.Equal(t, pbAction, result) require.Equal(t, pbAction, result)
...@@ -26,7 +28,9 @@ func TestAction(t *testing.T) { ...@@ -26,7 +28,9 @@ func TestAction(t *testing.T) {
t.Run("Map", func(t *testing.T) { t.Run("Map", func(t *testing.T) {
var action *Action var action *Action
gofakeit.Struct(&action) err := gofakeit.Struct(&action)
require.NoError(t, err)
dict := ActionToMap(action) dict := ActionToMap(action)
result, err := ActionFromMap(dict) result, err := ActionFromMap(dict)
require.NoError(t, err) require.NoError(t, err)
...@@ -45,7 +49,9 @@ func TestAction(t *testing.T) { ...@@ -45,7 +49,9 @@ func TestAction(t *testing.T) {
func TestActionRequest(t *testing.T) { func TestActionRequest(t *testing.T) {
t.Run("Protobuf", func(t *testing.T) { t.Run("Protobuf", func(t *testing.T) {
var pbAction *pb.ActionRequest var pbAction *pb.ActionRequest
gofakeit.Struct(&pbAction) err := gofakeit.Struct(&pbAction)
require.NoError(t, err)
action := ActionRequestFromPB(pbAction) action := ActionRequestFromPB(pbAction)
result := ActionRequestToPB(action) result := ActionRequestToPB(action)
require.Equal(t, pbAction, result) require.Equal(t, pbAction, result)
...@@ -62,7 +68,9 @@ func TestActionRequest(t *testing.T) { ...@@ -62,7 +68,9 @@ func TestActionRequest(t *testing.T) {
func TestActionResponse(t *testing.T) { func TestActionResponse(t *testing.T) {
t.Run("Protobuf", func(t *testing.T) { t.Run("Protobuf", func(t *testing.T) {
var pbAction *pb.ActionResponse var pbAction *pb.ActionResponse
gofakeit.Struct(&pbAction) err := gofakeit.Struct(&pbAction)
require.NoError(t, err)
action := ActionResponseFromPB(pbAction) action := ActionResponseFromPB(pbAction)
result := ActionResponseToPB(action) result := ActionResponseToPB(action)
require.Equal(t, pbAction, result) require.Equal(t, pbAction, result)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment