add sets up

This commit is contained in:
mr
2025-06-20 07:51:32 +02:00
parent 938f9f1326
commit d8ccdec501
23 changed files with 277 additions and 92 deletions

View File

@@ -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())
})
}