Extracted scenario
This commit is contained in:
parent
c02435ccaa
commit
cc2058090c
13 changed files with 235 additions and 173 deletions
31
internal/scenario/test_ctx.go
Normal file
31
internal/scenario/test_ctx.go
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package scenario
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"log"
|
||||
)
|
||||
|
||||
type TestScenarioCtx struct {
|
||||
Scenario *Scenario
|
||||
Sender *testSender
|
||||
LogBuf *bytes.Buffer
|
||||
}
|
||||
|
||||
func GetTestScenarioCtx() TestScenarioCtx {
|
||||
sender := &testSender{}
|
||||
buf := &bytes.Buffer{}
|
||||
return TestScenarioCtx{
|
||||
LogBuf: buf,
|
||||
Scenario: &Scenario{
|
||||
Sender: sender,
|
||||
Logger: log.New(buf, "", 0),
|
||||
InfoFetcher: &testInfoFetcher{},
|
||||
Cache: &testCache{
|
||||
table: map[string]string{
|
||||
"good": "good",
|
||||
},
|
||||
},
|
||||
},
|
||||
Sender: sender,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue