Skip to content

Commit

Permalink
Adding test for value function
Browse files Browse the repository at this point in the history
  • Loading branch information
CoryKleinjanCACI committed Jan 22, 2025
1 parent c7e7b33 commit ce2c4ac
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions pkg/models/mto_service_items_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,31 @@ func (suite *ModelSuite) TestFetchRelatedDestinationSITServiceItems() {
suite.Len(relatedServiceItems, 0, "There should be zero related destination service items")
})
}

func (suite *ModelSuite) TestValue() {
suite.Run("value returns an array", func() {
move := factory.BuildMove(suite.DB(), nil, nil)
shipment := factory.BuildMTOShipment(suite.DB(), []factory.Customization{
{
Model: move,
LinkOnly: true,
},
}, nil)
msServiceItem := factory.BuildMTOServiceItem(suite.DB(), []factory.Customization{
{
Model: shipment,
LinkOnly: true,
},
{
Model: models.ReService{
Code: models.ReServiceCodeMS,
},
},
}, nil)

byte, err := msServiceItem.Value()

suite.NotNil(byte)
suite.Nil(err)
})
}

0 comments on commit ce2c4ac

Please sign in to comment.