예제 #1
0
 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();
 }
예제 #2
0
        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);
        }
예제 #3
0
파일: IConeLogger.cs 프로젝트: kitofr/Cone
 public static void WithTestLog(this ISuiteLogger log, IConeTest test, Action<ITestLogger> action)
 {
     var testLog = log.BeginTest(test);
     action(testLog);
     testLog.EndTest();
 }
예제 #4
0
 public ConsoleLogger(IConeTest test, ConsoleLoggerWriter writer)
 {
     this.test = test;
     this.writer = writer;
 }
예제 #5
0
 public ConsoleLogger(IConeTest test, IConsoleResultWriter writer)
 {
     this.test = test;
     this.writer = writer;
     this.time = new Stopwatch();
 }
예제 #6
0
파일: TestExecutor.cs 프로젝트: kitofr/Cone
 public void Run(IConeTest test, ITestResult result)
 {
     result.Success();
 }
예제 #7
0
파일: TestExecutor.cs 프로젝트: kitofr/Cone
 public void Run(IConeTest test, ITestResult result)
 {
     Run(test, result, new NullContext());
 }
예제 #8
0
 public bool IncludeTest(IConeTest test)
 {
     return filters.Include(test);
 }
예제 #9
0
 public virtual void WriteSuccess(IConeTest test)
 {
     Write(SuccessColor, ".");
 }
예제 #10
0
 public virtual void WritePending(IConeTest test)
 {
     Write(SuccessColor, "?");
 }
예제 #11
0
파일: Program.cs 프로젝트: kitofr/Cone
 public bool IncludeTest(IConeTest test)
 {
     return CategoryCheck(test) && testFilter(test);
 }
예제 #12
0
파일: XmlLogger.cs 프로젝트: kitofr/Cone
 public XmlLogger(XmlWriter xml, IConeTest test)
 {
     this.xml = xml;
     this.test = test;
     xml.WriteStartElement("test-case");
 }
예제 #13
0
파일: XmlLogger.cs 프로젝트: kitofr/Cone
 public ITestLogger BeginTest(IConeTest test)
 {
     return new XmlLogger(xml, test);
 }
예제 #14
0
 public TestResult(IConeTest test, ITestLogger log)
 {
     this.test = test;
     this.log = log;
 }
예제 #15
0
 public ITestLogger BeginTest(IConeTest test)
 {
     var log = new MulticastLogger();
     children.ForEach(x => log.Add(x.BeginTest(test)));
     return log;
 }
예제 #16
0
 public ITestLogger BeginTest(IConeTest test)
 {
     return new ConsoleLogger(test, writer);
 }
예제 #17
0
 public bool Include(IConeTest test)
 {
     return CategoryCheck(test) && (testFilter == null || testFilter(test));
 }
예제 #18
0
 public override void WritePending(IConeTest test)
 {
     WriteTestName(PendingColor, test);
 }
예제 #19
0
 ITestLogger ISuiteLogger.BeginTest(IConeTest test)
 {
     activeTest = test;
     WriteLine("##teamcity[testStarted name='{0}']", activeTest.TestName.Name);
     return this;
 }
예제 #20
0
 public override void WriteSuccess(IConeTest test)
 {
     WriteTestName(SuccessColor, test);
 }
예제 #21
0
파일: TestExecutor.cs 프로젝트: kitofr/Cone
 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);
 }
예제 #22
0
 void WriteTestName(ConsoleColor color, IConeTest test)
 {
     WriteTestName(color, test.TestName.Context, test.TestName.Name);
 }
예제 #23
0
파일: ConePad.cs 프로젝트: kitofr/Cone
 public ITestLogger BeginTest(IConeTest test)
 {
     return this;
 }
예제 #24
0
 public ConsoleResult(IConeTest test)
 {
     this.Context = test.TestName.Context;
     this.TestName = test.TestName.Name;
 }