File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -18,14 +18,18 @@ func TestMux_BasicCommand(t *testing.T) {
18
18
mux .Register (new (postHandler ))
19
19
ctx := dew .NewContext (context .Background (), mux )
20
20
21
- createUser := & createUser {Name : "john" }
22
- testRunDispatch (t , ctx , dew .NewAction (createUser ))
21
+ createUser , err := dew .Dispatch (ctx , & createUser {Name : "john" })
22
+ if err != nil {
23
+ t .Fatalf ("unexpected error: %v" , err )
24
+ }
23
25
if createUser .Result != "user created" {
24
26
t .Fatalf ("unexpected result: %s" , createUser .Result )
25
27
}
26
28
27
- createPost := & createPost {Title : "hello" }
28
- testRunDispatch (t , ctx , dew .NewAction (createPost ))
29
+ createPost , err := dew .Dispatch (ctx , & createPost {Title : "hello" })
30
+ if err != nil {
31
+ t .Fatalf ("unexpected error: %v" , err )
32
+ }
29
33
if createPost .Result != "post created" {
30
34
t .Fatalf ("unexpected result: %s" , createPost .Result )
31
35
}
You can’t perform that action at this time.
0 commit comments