public ITestScriptProvider GetScriptProvider() { if (_scriptProvider == null) { _scriptProvider = _serviceContext.Services.Get <IRedefineTestScriptProvider>("A Test Session", _runPath); } return(_scriptProvider); }
public IList <ITestNode> GetRunnableTest(string testName, ITestScriptProvider scriptProvider) { var runList = new List <ITestNode>(); Hashtable lookupNodes = scriptProvider.LookupNodes; foreach (string key in lookupNodes.Keys) { } return(runList); }
private static void Main(string[] args) { //Console.ReadKey(); try { _launchTime = DateTime.Now; _svcContext = new ServiceContext(); CheckForHelp(args); string addinName = GetAddinName(args); ITestFrameworkAddin addIn = (addinName == null)?new RedefineFrameworkAddin() : TestAddinManager.GetAddIn(ConfigurationManager.AppSettings[addinName]); addIn.RegisterServices(_svcContext); ValidateAddInParameters(args, addIn); _exitOnFail = addIn.ExitOnTestFail; ITestScriptProvider scriptProvider = addIn.GetScriptProvider(); WriteHeader(); scriptProvider.OnAfterCreateNode += OnAfterCreateNode; scriptProvider.OnNotifyLoadErrors += OnLoadErrors; scriptProvider.OnErrorProcessingNodes += OnErrorProcessingNodes; scriptProvider.LoadScripts(); Console.WriteLine(); WriteTestCount(scriptProvider); Console.WriteLine(); Console.WriteLine("Runnning test.."); Console.WriteLine("Add-in loaded: " + addIn.AddinName); Console.WriteLine(); addIn.GetTestEngine().OnTestComplete += OnTestComplete; addIn.GetTestEngine().OnNotifyTestRunErrors += OnNotifyTestRunErrors; addIn.Run(); ITestReportWriter reportWriter = addIn.GetReportWriter(); GenerateReport(reportWriter); Console.WriteLine(); WriteSummaryTestResult(addIn.TestedItems); } finally { ConsoleText.SetColor(ConsoleText.DEFAULT_COLOR); } }
private static void WriteTestCount(ITestScriptProvider scriptProvider) { var list = new List <ITestNode>(); foreach (object item in scriptProvider.LookupNodes.Values) { list.Add(item as ITestNode); } int totalSuites = list.Count( x => x.IsRunnable && x.GetType().GetInterfaces().Contains((typeof(ISuite)))); int totalTestCases = list.Count( x => x.IsRunnable && x.GetType().GetInterfaces().Contains((typeof(ITestCase)))); Console.WriteLine(totalSuites + " runnable suites with " + totalTestCases + " test cases found."); }
public virtual void Load(ITestScriptProvider scriptProvider) { throw new NotImplementedException(); }
public override void Load(ITestScriptProvider scriptProvider) { ScriptProvider = scriptProvider; Load(); }