Ejemplo n.º 1
0
        private void Report()
        {
            reportBuilder = new StringBuilder();
            reportBuilder.AppendLine();
            Verifying = false;
            Shrinking = false;
            Reporting = true;

            Failed = false;
            var failingSpec = FailingSpec;
            var exception   = Exception;

            foreach (var run in Runs.ToList())
            {
                RunNumber = run;
                Runner(this);
            }

            Failed      = true;
            FailingSpec = failingSpec;
            Exception   = exception;

            if (Exception != null)
            {
                throw new FalsifiableException(reportBuilder.ToString(), exception);
            }

            throw new FalsifiableException(reportBuilder.ToString());
        }
Ejemplo n.º 2
0
        private void ShrinkActions()
        {
            Verifying = true;
            Shrinking = false;
            Reporting = false;
            BreakRun  = false;

            Failed = false;
            var failingSpec = FailingSpec;
            var exception   = Exception;

            var max     = Runs.Max();
            var current = 0;

            while (current <= max)
            {
                Failed      = false;
                TempMemory  = new TempMemory();
                FailingSpec = failingSpec;
                Exception   = exception;

                foreach (var run in Runs.ToList())
                {
                    RunNumber = run;
                    if (run != current)
                    {
                        Runner(this);
                    }
                    if (BreakRun)
                    {
                        break;
                    }
                }
                if (Failed && !BreakRun)
                {
                    Runs.Remove(current);
                }
                current++;
            }

            Failed      = true;
            FailingSpec = failingSpec;
            Exception   = exception;
        }
Ejemplo n.º 3
0
        private void ShrinkInputs()
        {
            Verifying = false;
            Shrinking = true;
            Reporting = false;

            Failed     = false;
            TempMemory = new TempMemory();

            var failingSpec = FailingSpec;
            var exception   = Exception;

            foreach (var run in Runs.ToList())
            {
                RunNumber = run;
                Runner(this);
            }

            Failed      = true;
            FailingSpec = failingSpec;
            Exception   = exception;
        }