(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func TestApplyRunEffects(t *testing.T) { |
| 12 | Convey("ApplyRunEffects", t, func() { |
| 13 | test := func(w *Flow, expectedEffect string) { |
| 14 | var buf strings.Builder |
| 15 | ctx := context.Background() |
| 16 | ctx = WithEffectWriter(ctx, &buf) |
| 17 | deps := &Dependencies{} |
| 18 | err := ApplyRunEffects(ctx, deps, NewFlows(w)) |
| 19 | So(err, ShouldBeNil) |
| 20 | So(buf.String(), ShouldEqual, expectedEffect) |
| 21 | } |
| 22 | |
| 23 | test(&Flow{ |
| 24 | FlowID: "wf-0", |
| 25 | StateToken: "wf-0-state-0", |
| 26 | Intent: &testMarshalIntent0{ |
| 27 | Intent0: "intent0-0", |
| 28 | }, |
| 29 | Nodes: []Node{ |
| 30 | Node{ |
| 31 | Type: NodeTypeSimple, |
| 32 | Simple: &testMarshalNode0{ |
| 33 | Node0: "node0-0", |
| 34 | }, |
| 35 | }, |
| 36 | Node{ |
| 37 | Type: NodeTypeSubFlow, |
| 38 | SubFlow: &Flow{ |
| 39 | Intent: &testMarshalIntent0{ |
| 40 | Intent0: "intent0-1", |
| 41 | }, |
| 42 | Nodes: []Node{ |
| 43 | Node{ |
| 44 | Type: NodeTypeSimple, |
| 45 | Simple: &testMarshalNode0{ |
| 46 | Node0: "node0-1", |
| 47 | }, |
| 48 | }, |
| 49 | }, |
| 50 | }, |
| 51 | }, |
| 52 | Node{ |
| 53 | Type: NodeTypeSimple, |
| 54 | Simple: &testMarshalNode0{ |
| 55 | Node0: "node0-2", |
| 56 | }, |
| 57 | }, |
| 58 | }, |
| 59 | }, `run-effect: node0-0 |
| 60 | run-effect: node0-1 |
| 61 | run-effect: node0-2 |
| 62 | `) |
| 63 | }) |
| 64 | } |
| 65 | |
| 66 | func TestApplyAllEffects(t *testing.T) { |
| 67 | Convey("ApplyAllEffects", t, func() { |
nothing calls this directly
no test coverage detected