add event base intelligency
This commit is contained in:
@@ -26,14 +26,14 @@ func TestStorageResource_ConvertToPricedResource_ValidType(t *testing.T) {
|
||||
res := &resources.StorageResource{}
|
||||
res.AbstractInstanciatedResource.CreatorID = "creator"
|
||||
res.AbstractInstanciatedResource.UUID = "res-id"
|
||||
priced := res.ConvertToPricedResource(tools.STORAGE_RESOURCE, &tools.APIRequest{})
|
||||
priced, _ := res.ConvertToPricedResource(tools.STORAGE_RESOURCE, nil, nil, nil, nil, nil, &tools.APIRequest{})
|
||||
assert.NotNil(t, priced)
|
||||
assert.IsType(t, &resources.PricedStorageResource{}, priced)
|
||||
}
|
||||
|
||||
func TestStorageResource_ConvertToPricedResource_InvalidType(t *testing.T) {
|
||||
res := &resources.StorageResource{}
|
||||
priced := res.ConvertToPricedResource(tools.COMPUTE_RESOURCE, &tools.APIRequest{})
|
||||
priced, _ := res.ConvertToPricedResource(tools.COMPUTE_RESOURCE, nil, nil, nil, nil, nil, &tools.APIRequest{})
|
||||
assert.Nil(t, priced)
|
||||
}
|
||||
|
||||
@@ -94,12 +94,12 @@ func TestStorageResourcePricingStrategy_GetQuantity_Invalid(t *testing.T) {
|
||||
assert.Equal(t, 0.0, q)
|
||||
}
|
||||
|
||||
func TestPricedStorageResource_GetPrice_NoProfiles(t *testing.T) {
|
||||
func TestPricedStorageResource_GetPriceHT_NoProfiles(t *testing.T) {
|
||||
res := &resources.PricedStorageResource{
|
||||
PricedResource: resources.PricedResource{
|
||||
ResourceID: "res-id",
|
||||
},
|
||||
}
|
||||
_, err := res.GetPrice()
|
||||
_, err := res.GetPriceHT()
|
||||
assert.Error(t, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user