packaged every model
This commit is contained in:
48
processing/processing_test.go
Normal file
48
processing/processing_test.go
Normal file
@@ -0,0 +1,48 @@
|
||||
package processing
|
||||
|
||||
import (
|
||||
oclib "oc-lib"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestStoreOneProcessing(t *testing.T){
|
||||
p := Processing{ Container: "totoCont",
|
||||
AbstractResource: oclib.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: oclib.AbstractResource{
|
||||
Uuid: "123",
|
||||
Name: "testData",
|
||||
Description: "Lorem Ipsum",
|
||||
Logo : "azerty.com",
|
||||
Owner: "toto",
|
||||
OwnerLogo: "totoLogo",
|
||||
SourceUrl: "azerty.fr",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
sma := ProcessingMongoAccessor{}
|
||||
id := sma.StoreOne(p)
|
||||
new_s := sma.LoadOne(id)
|
||||
|
||||
assert.Equal(t,p, new_s)
|
||||
}
|
||||
Reference in New Issue
Block a user