コード例 #1
0
 public PingRule Succeeds(RuleOption <TimesHelper.AllTimes, int> times, int?validResponseCode = 200)
 {
     Self.Times    = times;
     Self.Succeeds = true;
     Self.Return   = validResponseCode;
     return(this);
 }
コード例 #2
0
 public PingRule Fails(RuleOption <TimesHelper.AllTimes, int> times, RuleOption <Exception, int> errorState = null)
 {
     Self.Times    = times;
     Self.Succeeds = false;
     Self.Return   = errorState;
     return(this);
 }
コード例 #3
0
 public ClientCallRule Fails(RuleOption <TimesHelper.AllTimes, int> times, RuleOption <Exception, int> errorState = null)
 {
     Self.Times    = times;
     Self.Succeeds = false;
     Self.Return   = errorState ?? new TheException();
     return(this);
 }
コード例 #4
0
 public SniffRule Succeeds(RuleOption <TimesHelper.AllTimes, int> times, VirtualCluster cluster = null)
 {
     Self.Times           = times;
     Self.Succeeds        = true;
     Self.NewClusterState = cluster;
     Self.Return          = 200;
     return(this);
 }
コード例 #5
0
 public PingRule FailAlways(RuleOption <Exception, int> errorState = null) => Fails(TimesHelper.Always, errorState);
コード例 #6
0
 public ClientCallRule AfterSucceeds(RuleOption <Exception, int> errorState = null)
 {
     Self.AfterSucceeds = errorState;
     return(this);
 }