예제 #1
0
        private void SetupAndTestAssertAndReturn(Action action, TestResult expected)
        {
            using (var engine = new MockedTestEngine(MockedTestEngine.GetTestMethod(1)))
            {
                var completionEvents = new List <TestCompletedEventArgs>();

                engine.SetupAssertCompleted(action);
                engine.TestEngine.TestCompleted += (source, args) => completionEvents.Add(args);
                engine.ParserState.OnParseRequested(engine);

                if (engine.ParserState.Status != ParserState.Ready)
                {
                    Assert.Inconclusive("Parser Error");
                }

                engine.TestEngine.Run(engine.TestEngine.Tests);
                Thread.SpinWait(25);

                Mock.Verify(engine.Dispatcher, engine.VbeInteraction, engine.WrapperProvider, engine.TypeLib);
                Assert.AreEqual(1, completionEvents.Count);
                Assert.AreEqual(expected, completionEvents.First().Result);
            }
        }
예제 #2
0
 public MockedTestExplorerModel(MockedTestEngine engine)
 {
     Engine = engine;
     Model  = new TestExplorerModel(Engine.TestEngine);
 }