Skip to content

Commit

Permalink
change test file
Browse files Browse the repository at this point in the history
  • Loading branch information
taeJungCaci committed Oct 29, 2024
1 parent e9a4ac7 commit 240cfff
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions pkg/handlers/internalapi/internal/payloads/model_to_payload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,6 @@ import (
"github.com/transcom/mymove/pkg/models"
)

func (suite *PayloadsSuite) TestMarketCode() {
suite.Run("returns nil when marketCode is nil", func() {
var marketCode *models.MarketCode = nil
result := MarketCode(marketCode)
suite.Equal(result, "")
})

suite.Run("returns string when marketCode is not nil", func() {
marketCodeDomestic := models.MarketCodeDomestic
result := MarketCode(&marketCodeDomestic)
suite.NotNil(result, "Expected result to not be nil when marketCode is not nil")
suite.Equal("d", result, "Expected result to be 'd' for domestic market code")
})

suite.Run("returns string when marketCode is international", func() {
marketCodeInternational := models.MarketCodeInternational
result := MarketCode(&marketCodeInternational)
suite.NotNil(result, "Expected result to not be nil when marketCode is not nil")
suite.Equal("i", result, "Expected result to be 'i' for international market code")
})
}

func (suite *PayloadsSuite) TestFetchPPMShipment() {

ppmShipmentID, _ := uuid.NewV4()
Expand Down Expand Up @@ -88,3 +66,25 @@ func (suite *PayloadsSuite) TestFetchPPMShipment() {
suite.True(*returnedPPMShipment.IsActualExpenseReimbursement)
})
}

func (suite *PayloadsSuite) TestMarketCode() {
suite.Run("returns nil when marketCode is nil", func() {
var marketCode *models.MarketCode = nil
result := MarketCode(marketCode)
suite.Equal(result, "")
})

suite.Run("returns string when marketCode is not nil", func() {
marketCodeDomestic := models.MarketCodeDomestic
result := MarketCode(&marketCodeDomestic)
suite.NotNil(result, "Expected result to not be nil when marketCode is not nil")
suite.Equal("d", result, "Expected result to be 'd' for domestic market code")
})

suite.Run("returns string when marketCode is international", func() {
marketCodeInternational := models.MarketCodeInternational
result := MarketCode(&marketCodeInternational)
suite.NotNil(result, "Expected result to not be nil when marketCode is not nil")
suite.Equal("i", result, "Expected result to be 'i' for international market code")
})
}

0 comments on commit 240cfff

Please sign in to comment.