github.com/agiledragon/gomonkey/v2@v2.11.1-0.20240427155748-d56c6823ec17/dsl/factory.go (about)

     1  package dsl
     2  
     3  import . "github.com/agiledragon/gomonkey/v2"
     4  
     5  func Any() Constraint {
     6  	return &AnyConstraint{}
     7  }
     8  
     9  func Eq(x interface{}) Constraint {
    10  	return &EqConstraint{x: x}
    11  }
    12  
    13  func Return(x ...interface{}) Behavior {
    14  	r := &ReturnBehavior{rets: make([]Params, 0), params: make(Params, 0)}
    15  	r.params = append(r.params, x...)
    16  	return r
    17  }
    18  
    19  func Repeat(behavior Behavior, times int) Behavior {
    20  	return &RepeatBehavior{rets: make([]Params, 0), behavior: behavior, times: times}
    21  }