コード例 #1
0
        public static ExplorationStage <T> PrependPath <T>(
            this ExplorationStage <T> explorationStage,
            IEnumerable <int> path) => explorationStage.Match(

            onNonCounterexampleExploration: nonCounterexample => ExplorationStage <T> .Factory.NonCounterexample(
                nonCounterexample.ExampleSpace,
                Enumerable.Concat(path, nonCounterexample.Path)),

            onCounterexampleExploration: counterexample => ExplorationStage <T> .Factory.Counterexample(
                counterexample.ExampleSpace,
                Enumerable.Concat(path, counterexample.Path),
                counterexample.Exception),

            onDiscardExploration: (discard) => ExplorationStage <T> .Factory.Discard(discard.ExampleSpace));
コード例 #2
0
 public static IExampleSpace <T> ExampleSpace <T>(this ExplorationStage <T> explorationStage) =>
 explorationStage.Match(
     onCounterexampleExploration: counterexample => counterexample.ExampleSpace,
     onNonCounterexampleExploration: nonCounterexample => nonCounterexample.ExampleSpace,
     onDiscardExploration: discard => discard.ExampleSpace);
コード例 #3
0
 public static T Value <T>(this ExplorationStage <T> explorationStage) =>
 explorationStage.Example().Value;
コード例 #4
0
 public static bool IsCounterexample <T>(this ExplorationStage <T> explorationStage) =>
 explorationStage.Match(
     onCounterexampleExploration: (_) => true,
     onNonCounterexampleExploration: (_) => false,
     onDiscardExploration: (_) => false);
コード例 #5
0
 public static IExample <T> Example <T>(this ExplorationStage <T> explorationStage) =>
 explorationStage.ExampleSpace().Current;