public void RunTests(IEnumerable<IConeTest> tests) { sessionLog.BeginSession(); var singleTest = new IConeTest[1]; foreach (var item in tests){ var log = sessionLog.BeginSuite(item.Suite); singleTest[0] = item; CollectResults(singleTest, item.Suite.Fixture, log); log.EndSuite(); } sessionLog.EndSession(); }
public void Run(IConeTest test, ITestResult result, ITestExecutionContext context) { var ignore = test.Attributes.GetCustomAttributes(typeof(IPendingAttribute)).Cast<IPendingAttribute>().FirstOrDefault(x => x.NoExecute); if(ignore != null) { result.Pending(ignore.Reason); return; } var wrap = CombineEstablish(new FixtureContext(fixture, test.Attributes)); var next = ExecutionContext .Concat(fixtureContext) .Concat(GetTestContexts(test.Attributes)) .Aggregate((t, r) => t.Run(r), wrap); var testContext = test as ITestExecutionContext; if(testContext != null) next = wrap(next, testContext); wrap(next, context)(test, result); }
public static void WithTestLog(this ISuiteLogger log, IConeTest test, Action<ITestLogger> action) { var testLog = log.BeginTest(test); action(testLog); testLog.EndTest(); }
public ConsoleLogger(IConeTest test, ConsoleLoggerWriter writer) { this.test = test; this.writer = writer; }
public ConsoleLogger(IConeTest test, IConsoleResultWriter writer) { this.test = test; this.writer = writer; this.time = new Stopwatch(); }
public void Run(IConeTest test, ITestResult result) { result.Success(); }
public void Run(IConeTest test, ITestResult result) { Run(test, result, new NullContext()); }
public bool IncludeTest(IConeTest test) { return filters.Include(test); }
public virtual void WriteSuccess(IConeTest test) { Write(SuccessColor, "."); }
public virtual void WritePending(IConeTest test) { Write(SuccessColor, "?"); }
public bool IncludeTest(IConeTest test) { return CategoryCheck(test) && testFilter(test); }
public XmlLogger(XmlWriter xml, IConeTest test) { this.xml = xml; this.test = test; xml.WriteStartElement("test-case"); }
public ITestLogger BeginTest(IConeTest test) { return new XmlLogger(xml, test); }
public TestResult(IConeTest test, ITestLogger log) { this.test = test; this.log = log; }
public ITestLogger BeginTest(IConeTest test) { var log = new MulticastLogger(); children.ForEach(x => log.Add(x.BeginTest(test))); return log; }
public ITestLogger BeginTest(IConeTest test) { return new ConsoleLogger(test, writer); }
public bool Include(IConeTest test) { return CategoryCheck(test) && (testFilter == null || testFilter(test)); }
public override void WritePending(IConeTest test) { WriteTestName(PendingColor, test); }
ITestLogger ISuiteLogger.BeginTest(IConeTest test) { activeTest = test; WriteLine("##teamcity[testStarted name='{0}']", activeTest.TestName.Name); return this; }
public override void WriteSuccess(IConeTest test) { WriteTestName(SuccessColor, test); }
public void Run(IConeTest test, ITestResult result, ITestExecutionContext context) { var wrap = CombineEstablish(new FixtureContext(fixture, test.Attributes)); var next = ExecutionContext .Concat(fixtureContext) .Concat(GetTestContexts(test.Attributes)) .Aggregate((t, r) => t.Run(r), wrap); var testContext = test as ITestExecutionContext; if(testContext != null) next = wrap(next, testContext);; wrap(next, context)(test, result); }
void WriteTestName(ConsoleColor color, IConeTest test) { WriteTestName(color, test.TestName.Context, test.TestName.Name); }
public ITestLogger BeginTest(IConeTest test) { return this; }
public ConsoleResult(IConeTest test) { this.Context = test.TestName.Context; this.TestName = test.TestName.Name; }