-
Notifications
You must be signed in to change notification settings - Fork 18
/
builder_middleware.go
65 lines (45 loc) · 1.74 KB
/
builder_middleware.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package cute
func (qt *cute) StepName(name string) MiddlewareRequest {
qt.tests[qt.countTests].AllureStep.Name = name
return qt
}
func (qt *cute) BeforeExecute(fs ...BeforeExecute) MiddlewareRequest {
qt.tests[qt.countTests].Middleware.Before = append(qt.tests[qt.countTests].Middleware.Before, fs...)
return qt
}
func (qt *cute) BeforeExecuteT(fs ...BeforeExecuteT) MiddlewareRequest {
qt.tests[qt.countTests].Middleware.BeforeT = append(qt.tests[qt.countTests].Middleware.BeforeT, fs...)
return qt
}
func (qt *cute) After(fs ...AfterExecute) ExpectHTTPBuilder {
qt.tests[qt.countTests].Middleware.After = append(qt.tests[qt.countTests].Middleware.After, fs...)
return qt
}
func (qt *cute) AfterT(fs ...AfterExecuteT) ExpectHTTPBuilder {
qt.tests[qt.countTests].Middleware.AfterT = append(qt.tests[qt.countTests].Middleware.AfterT, fs...)
return qt
}
func (qt *cute) AfterExecute(fs ...AfterExecute) MiddlewareRequest {
qt.tests[qt.countTests].Middleware.After = append(qt.tests[qt.countTests].Middleware.After, fs...)
return qt
}
func (qt *cute) AfterExecuteT(fs ...AfterExecuteT) MiddlewareRequest {
qt.tests[qt.countTests].Middleware.AfterT = append(qt.tests[qt.countTests].Middleware.AfterT, fs...)
return qt
}
func (qt *cute) AfterTestExecute(fs ...AfterExecute) NextTestBuilder {
previousTest := 0
if qt.countTests != 0 {
previousTest = qt.countTests - 1
}
qt.tests[previousTest].Middleware.After = append(qt.tests[previousTest].Middleware.After, fs...)
return qt
}
func (qt *cute) AfterTestExecuteT(fs ...AfterExecuteT) NextTestBuilder {
previousTest := 0
if qt.countTests != 0 {
previousTest = qt.countTests - 1
}
qt.tests[previousTest].Middleware.AfterT = append(qt.tests[previousTest].Middleware.AfterT, fs...)
return qt
}