add sets up
This commit is contained in:
@@ -22,7 +22,7 @@ type MockPricingProfile struct {
|
||||
ReturnCost float64
|
||||
}
|
||||
|
||||
func (m *MockPricingProfile) IsPurchased() bool {
|
||||
func (m *MockPricingProfile) IsPurchasable() bool {
|
||||
return m.Purchased
|
||||
}
|
||||
|
||||
@@ -49,13 +49,13 @@ func TestGetIDAndCreatorAndType(t *testing.T) {
|
||||
func TestIsPurchased(t *testing.T) {
|
||||
t.Run("nil selected pricing returns false", func(t *testing.T) {
|
||||
r := &resources.PricedResource{}
|
||||
assert.False(t, r.IsPurchased())
|
||||
assert.False(t, r.IsPurchasable())
|
||||
})
|
||||
|
||||
t.Run("returns true if pricing profile is purchased", func(t *testing.T) {
|
||||
mock := &MockPricingProfile{Purchased: true}
|
||||
r := &resources.PricedResource{SelectedPricing: mock}
|
||||
assert.True(t, r.IsPurchased())
|
||||
assert.True(t, r.IsPurchasable())
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user