oc-lib/workflow_test.go
2024-07-17 17:19:03 +02:00

44 lines
841 B
Go

package oclib
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestStoreOneWorkflow(t *testing.T){
w := Workflow{AbstractResource: 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: AbstractResource{
Uuid: "123",
Name: "testWorkflow",
Description: "Lorem Ipsum",
Logo : "azerty.com",
Owner: "toto",
OwnerLogo: "totoLogo",
SourceUrl: "azerty.fr",
},
}
wma := WorkflowMongoAccessor{}
id := wma.StoreOne(w)
new_w := wma.LoadOne(id)
assert.Equal(t,w, new_w)
}