(t *testing.T)
| 208 | } |
| 209 | |
| 210 | func TestContainer_Shutdown(t *testing.T) { |
| 211 | seq := 0 |
| 212 | container := New() |
| 213 | container.AddModule(closer(func() { assert.Equal(t, 2, seq); seq = 1 })) |
| 214 | container.AddModule(closer(func() { assert.Equal(t, 3, seq); seq = 2 })) |
| 215 | container.AddModule(closer(func() { assert.Equal(t, 0, seq); seq = 3 })) |
| 216 | container.Shutdown() |
| 217 | assert.Equal(t, 1, seq) |
| 218 | } |
| 219 | |
| 220 | func TestC_AddModule(t *testing.T) { |
| 221 | type Module struct { |