47 lines
985 B
Go
47 lines
985 B
Go
package processing
|
|
|
|
import (
|
|
"testing"
|
|
|
|
resources "cloud.o-forge.io/core/oc-lib/models/resources"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestStoreOneProcessing(t *testing.T) {
|
|
p := Processing{Container: "totoCont",
|
|
AbstractResource: resources.AbstractResource{
|
|
Uuid: "123",
|
|
Name: "testData",
|
|
Description: "Lorem Ipsum",
|
|
Logo: "azerty.com",
|
|
Owner: "toto",
|
|
OwnerLogo: "totoLogo",
|
|
SourceUrl: "azerty.fr",
|
|
},
|
|
}
|
|
|
|
sma := ProcessingMongoAccessor{}
|
|
id := sma.StoreOne(&p)
|
|
|
|
assert.NotEmpty(t, id)
|
|
}
|
|
|
|
func TestLoadOneProcessing(t *testing.T) {
|
|
p := Processing{Container: "totoCont",
|
|
AbstractResource: resources.AbstractResource{
|
|
Uuid: "123",
|
|
Name: "testData",
|
|
Description: "Lorem Ipsum",
|
|
Logo: "azerty.com",
|
|
Owner: "toto",
|
|
OwnerLogo: "totoLogo",
|
|
SourceUrl: "azerty.fr",
|
|
},
|
|
}
|
|
|
|
sma := ProcessingMongoAccessor{}
|
|
new_s := sma.StoreOne(&p)
|
|
assert.Equal(t, p, new_s)
|
|
}
|