(t *testing.T)
| 208 | } |
| 209 | |
| 210 | func TestList(t *testing.T) { |
| 211 | // cleanup |
| 212 | clear(components) |
| 213 | |
| 214 | // given |
| 215 | Register(NewAnyComponent).Conditional(AnyCondition{}) |
| 216 | |
| 217 | // when |
| 218 | componentList := List() |
| 219 | |
| 220 | // then |
| 221 | require.Len(t, componentList, 1) |
| 222 | |
| 223 | component := componentList[0] |
| 224 | def := component.Definition() |
| 225 | |
| 226 | require.NotNil(t, def, "nil definition") |
| 227 | assert.Equal(t, "anyComponent", def.Name()) |
| 228 | |
| 229 | // Condition check |
| 230 | require.Len(t, component.Conditions(), 1) |
| 231 | } |
| 232 | |
| 233 | func TestList_MultipleComponent(t *testing.T) { |
| 234 | // cleanup |
nothing calls this directly
no test coverage detected