Skip to content

Commit

Permalink
chore: Adding First(), Last() and Nth() forHeaders(),Trailers…
Browse files Browse the repository at this point in the history
…()`and`FormValues()` (#49)
  • Loading branch information
Eun authored Mar 4, 2021
1 parent ccda7ed commit 29399c4
Show file tree
Hide file tree
Showing 9 changed files with 9,881 additions and 2,417 deletions.
15 changes: 15 additions & 0 deletions clear_expect_form_values_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ type IClearExpectFormValues interface {
Empty() IStep
// Equal clears all matching Equal steps
Equal(value ...interface{}) IStep
// First clears all matching First steps
First() IClearExpectHeaderValue
// Last clears all matching Last steps
Last() IClearExpectHeaderValue
// Len clears all matching Len steps
Len() IClearExpectInt
// NotContains clears all matching NotContains steps
Expand All @@ -25,6 +29,8 @@ type IClearExpectFormValues interface {
NotEqual(value ...interface{}) IStep
// NotOneOf clears all matching NotOneOf steps
NotOneOf(value ...interface{}) IStep
// Nth clears all matching Nth steps
Nth(value ...int) IClearExpectHeaderValue
// OneOf clears all matching OneOf steps
OneOf(value ...interface{}) IStep
}
Expand Down Expand Up @@ -60,6 +66,12 @@ func (v *clearExpectFormValues) Empty() IStep {
func (v *clearExpectFormValues) Equal(value ...interface{}) IStep {
return removeStep(v.callPath().Push("Equal", value))
}
func (v *clearExpectFormValues) First() IClearExpectHeaderValue {
return newClearExpectHeaderValue(v.callPath().Push("First", nil))
}
func (v *clearExpectFormValues) Last() IClearExpectHeaderValue {
return newClearExpectHeaderValue(v.callPath().Push("Last", nil))
}
func (v *clearExpectFormValues) Len() IClearExpectInt {
return newClearExpectInt(v.callPath().Push("Len", nil))
}
Expand All @@ -75,6 +87,9 @@ func (v *clearExpectFormValues) NotEqual(value ...interface{}) IStep {
func (v *clearExpectFormValues) NotOneOf(value ...interface{}) IStep {
return removeStep(v.callPath().Push("NotOneOf", value))
}
func (v *clearExpectFormValues) Nth(value ...int) IClearExpectHeaderValue {
return newClearExpectHeaderValue(v.callPath().Push("Nth", intSliceToInterfaceSlice(value)))
}
func (v *clearExpectFormValues) OneOf(value ...interface{}) IStep {
return removeStep(v.callPath().Push("OneOf", value))
}
80 changes: 80 additions & 0 deletions clear_expect_header_value_gen.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// +build !generate

package hit

import errortrace "github.com/Eun/go-hit/errortrace"

// ⚠️⚠️⚠️ This file was autogenerated by generators/clear/clear ⚠️⚠️⚠️ //

// IClearExpectHeaderValue provides methods to clear steps.
type IClearExpectHeaderValue interface {
IStep
// Contains clears all matching Contains steps
Contains(value ...interface{}) IStep
// Empty clears all matching Empty steps
Empty() IStep
// Equal clears all matching Equal steps
Equal(value ...interface{}) IStep
// Len clears all matching Len steps
Len() IClearExpectInt
// NotContains clears all matching NotContains steps
NotContains(value ...interface{}) IStep
// NotEmpty clears all matching NotEmpty steps
NotEmpty() IStep
// NotEqual clears all matching NotEqual steps
NotEqual(value ...interface{}) IStep
// NotOneOf clears all matching NotOneOf steps
NotOneOf(value ...interface{}) IStep
// OneOf clears all matching OneOf steps
OneOf(value ...interface{}) IStep
}
type clearExpectHeaderValue struct {
cp callPath
tr *errortrace.ErrorTrace
}

func newClearExpectHeaderValue(cp callPath) IClearExpectHeaderValue {
return &clearExpectHeaderValue{cp: cp, tr: ett.Prepare()}
}
func (v *clearExpectHeaderValue) trace() *errortrace.ErrorTrace {
return v.tr
}
func (*clearExpectHeaderValue) when() StepTime {
return cleanStep
}
func (v *clearExpectHeaderValue) callPath() callPath {
return v.cp
}
func (v *clearExpectHeaderValue) exec(hit *hitImpl) error {
if err := removeSteps(hit, v.callPath()); err != nil {
return err
}
return nil
}
func (v *clearExpectHeaderValue) Contains(value ...interface{}) IStep {
return removeStep(v.callPath().Push("Contains", value))
}
func (v *clearExpectHeaderValue) Empty() IStep {
return removeStep(v.callPath().Push("Empty", nil))
}
func (v *clearExpectHeaderValue) Equal(value ...interface{}) IStep {
return removeStep(v.callPath().Push("Equal", value))
}
func (v *clearExpectHeaderValue) Len() IClearExpectInt {
return newClearExpectInt(v.callPath().Push("Len", nil))
}
func (v *clearExpectHeaderValue) NotContains(value ...interface{}) IStep {
return removeStep(v.callPath().Push("NotContains", value))
}
func (v *clearExpectHeaderValue) NotEmpty() IStep {
return removeStep(v.callPath().Push("NotEmpty", nil))
}
func (v *clearExpectHeaderValue) NotEqual(value ...interface{}) IStep {
return removeStep(v.callPath().Push("NotEqual", value))
}
func (v *clearExpectHeaderValue) NotOneOf(value ...interface{}) IStep {
return removeStep(v.callPath().Push("NotOneOf", value))
}
func (v *clearExpectHeaderValue) OneOf(value ...interface{}) IStep {
return removeStep(v.callPath().Push("OneOf", value))
}
15 changes: 15 additions & 0 deletions clear_expect_headers_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ type IClearExpectHeaders interface {
Empty() IStep
// Equal clears all matching Equal steps
Equal(value ...interface{}) IStep
// First clears all matching First steps
First() IClearExpectHeaderValue
// Last clears all matching Last steps
Last() IClearExpectHeaderValue
// Len clears all matching Len steps
Len() IClearExpectInt
// NotContains clears all matching NotContains steps
Expand All @@ -25,6 +29,8 @@ type IClearExpectHeaders interface {
NotEqual(value ...interface{}) IStep
// NotOneOf clears all matching NotOneOf steps
NotOneOf(value ...interface{}) IStep
// Nth clears all matching Nth steps
Nth(value ...int) IClearExpectHeaderValue
// OneOf clears all matching OneOf steps
OneOf(value ...interface{}) IStep
}
Expand Down Expand Up @@ -60,6 +66,12 @@ func (v *clearExpectHeaders) Empty() IStep {
func (v *clearExpectHeaders) Equal(value ...interface{}) IStep {
return removeStep(v.callPath().Push("Equal", value))
}
func (v *clearExpectHeaders) First() IClearExpectHeaderValue {
return newClearExpectHeaderValue(v.callPath().Push("First", nil))
}
func (v *clearExpectHeaders) Last() IClearExpectHeaderValue {
return newClearExpectHeaderValue(v.callPath().Push("Last", nil))
}
func (v *clearExpectHeaders) Len() IClearExpectInt {
return newClearExpectInt(v.callPath().Push("Len", nil))
}
Expand All @@ -75,6 +87,9 @@ func (v *clearExpectHeaders) NotEqual(value ...interface{}) IStep {
func (v *clearExpectHeaders) NotOneOf(value ...interface{}) IStep {
return removeStep(v.callPath().Push("NotOneOf", value))
}
func (v *clearExpectHeaders) Nth(value ...int) IClearExpectHeaderValue {
return newClearExpectHeaderValue(v.callPath().Push("Nth", intSliceToInterfaceSlice(value)))
}
func (v *clearExpectHeaders) OneOf(value ...interface{}) IStep {
return removeStep(v.callPath().Push("OneOf", value))
}
Loading

0 comments on commit 29399c4

Please sign in to comment.