AddCommand creates a command of a specified type in a schema structure and pupulates it with random attributes
(commandType schema.CommandType)
| 83 | |
| 84 | // AddCommand creates a command of a specified type in a schema structure and pupulates it with random attributes |
| 85 | func (testDevFile *TestDevfile) AddCommand(commandType schema.CommandType) schema.Command { |
| 86 | |
| 87 | var command *schema.Command |
| 88 | switch commandType { |
| 89 | case schema.ExecCommandType: |
| 90 | command = testDevFile.createExecCommand() |
| 91 | testDevFile.SetExecCommandValues(command) |
| 92 | case schema.CompositeCommandType: |
| 93 | command = testDevFile.createCompositeCommand() |
| 94 | testDevFile.SetCompositeCommandValues(command) |
| 95 | case schema.ApplyCommandType: |
| 96 | command = testDevFile.createApplyCommand() |
| 97 | testDevFile.SetApplyCommandValues(command) |
| 98 | } |
| 99 | return *command |
| 100 | } |
| 101 | |
| 102 | // createExecCommand creates and returns an empty exec command in a schema structure |
| 103 | func (testDevFile *TestDevfile) createExecCommand() *schema.Command { |
no test coverage detected