Beispiel #1
0
        protected ITestingEngine AssertSucceeded(Configuration configuration, Action <PSharpRuntime> test)
        {
            InMemoryLogger   logger = new InMemoryLogger();
            BugFindingEngine engine = null;

            try
            {
                engine = BugFindingEngine.Create(configuration, test);
                engine.SetLogger(logger);
                engine.Run();

                var numErrors = engine.TestReport.NumOfFoundBugs;
                Assert.True(numErrors == 0, GetBugReport(engine));
            }
            catch (Exception ex)
            {
                Assert.False(true, ex.Message + "\n" + ex.StackTrace);
            }
            finally
            {
                logger.Dispose();
            }

            return(engine);
        }
Beispiel #2
0
        private ITestingEngine Test(BugFindingEngine engine)
        {
            var logger = new Common.TestOutputLogger(this.TestOutput);

            try
            {
                engine.SetLogger(logger);
                engine.Run();

                var numErrors = engine.TestReport.NumOfFoundBugs;
                Assert.True(numErrors == 0, GetBugReport(engine));
            }
            catch (Exception ex)
            {
                Assert.False(true, ex.Message + "\n" + ex.StackTrace);
            }
            finally
            {
                logger.Dispose();
            }

            return(engine);
        }