organize + graph
This commit is contained in:
43
models/workflow/workflow_test.go
Normal file
43
models/workflow/workflow_test.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package oclib
|
||||
|
||||
import (
|
||||
"oc-lib/models/resources"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestStoreOneWorkflow(t *testing.T) {
|
||||
w := Workflow{AbstractResource: resources.AbstractResource{
|
||||
Uuid: "123",
|
||||
Name: "testWorkflow",
|
||||
Description: "Lorem Ipsum",
|
||||
Logo: "azerty.com",
|
||||
Owner: "toto",
|
||||
OwnerLogo: "totoLogo",
|
||||
SourceUrl: "azerty.fr",
|
||||
},
|
||||
}
|
||||
|
||||
wma := WorkflowMongoAccessor{}
|
||||
id := wma.StoreOne(&w)
|
||||
|
||||
assert.NotEmpty(t, id)
|
||||
}
|
||||
|
||||
func TestLoadOneWorkflow(t *testing.T) {
|
||||
w := Workflow{AbstractResource: resources.AbstractResource{
|
||||
Uuid: "123",
|
||||
Name: "testWorkflow",
|
||||
Description: "Lorem Ipsum",
|
||||
Logo: "azerty.com",
|
||||
Owner: "toto",
|
||||
OwnerLogo: "totoLogo",
|
||||
SourceUrl: "azerty.fr",
|
||||
},
|
||||
}
|
||||
|
||||
wma := WorkflowMongoAccessor{}
|
||||
new_w := wma.StoreOne(&w)
|
||||
assert.Equal(t, w, new_w)
|
||||
}
|
||||
Reference in New Issue
Block a user