-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathactiivty_test.go
More file actions
56 lines (47 loc) · 1.24 KB
/
actiivty_test.go
File metadata and controls
56 lines (47 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package bpmn_engine
import (
"fmt"
"github.com/corbym/gocrest/is"
"github.com/corbym/gocrest/then"
"reflect"
"testing"
)
func Test_Activity_interfaces_implemented(t *testing.T) {
var _ activity = &elementActivity{}
}
func Test_GatewayActivity_interfaces_implemented(t *testing.T) {
var _ activity = &gatewayActivity{}
}
func Test_EventBaseGatewayActivity_interfaces_implemented(t *testing.T) {
var _ activity = &gatewayActivity{}
}
func Test_Timer_implements_Activity(t *testing.T) {
var _ activity = &Timer{}
}
func Test_Job_implements_Activity(t *testing.T) {
var _ activity = &job{}
}
func Test_MessageSubscription_implements_Activity(t *testing.T) {
var _ activity = &MessageSubscription{}
}
func Test_SetState_is_working(t *testing.T) {
// to avoid errors, when anyone forgets the pointer on the receiver type
tests := []struct {
a activity
}{
{&MessageSubscription{}},
{&Timer{}},
{&elementActivity{}},
{&eventBasedGatewayActivity{}},
{&gatewayActivity{}},
{&job{}},
{&processInstanceInfo{}},
{&subProcessInfo{}},
}
for _, test := range tests {
t.Run(fmt.Sprintf("%s", reflect.TypeOf(test.a)), func(t *testing.T) {
test.a.SetState(Completed)
then.AssertThat(t, test.a.State(), is.EqualTo(Completed))
})
}
}