Last active
September 14, 2021 10:03
-
-
Save zdunecki/f35fb45fc0399abc8aed4d34b67d644f to your computer and use it in GitHub Desktop.
Testing DSL/QL concept
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
seed(). | |
upgrade(). | |
createWebsites(createWebsitesP{blocked: true}). | |
goFreemium(). | |
freemiumTask(freemiumTaskP{mockTime: true}). | |
checkBlockedWebsites(checkBlockedWebsitesP{expect: []}) | |
stateMachine := []interface{ | |
{Name: "upgrade", Src: []string{"trial"}, Dst: "has_plan"}, | |
{Name: "goFreemium", Src: []string{"has_plan"}, Dst: "has_freemium", MiddleState: "upgrade"}, | |
{Name: "goFreemium", Src: []string{"has_plan"}, Dst: "has_future_freemium", MiddleState: "downgrade"} | |
} | |
`function Abc($mockTime) -> seed->upgrade->createWebsites(blocked=true)->goFreemium->freemiumTask(mockTime=$mockTime)->checkBlockedWebsites(expect=$expect)` | |
testQuery := `Abc(true)` | |
testQuery2 := `Abc(false)` | |
t := tests.New() | |
t.StateMachine(stateMachine) | |
t.Do(testQuery) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment