Extracted scenario

This commit is contained in:
Artyom Belousov 2021-06-06 11:00:50 +03:00
parent c02435ccaa
commit cc2058090c
13 changed files with 235 additions and 173 deletions

View 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,
}
}