public void OnSpecificationStart(SpecificationInfo specification)
 {
     if (!this._specificationTimer.IsRunning)
     {
         this._specificationTimer.Restart();
     }
 }
        public long GetSpecificationTime(SpecificationInfo specificationInfo)
        {
            if (this._specificationTimes.ContainsKey(specificationInfo))
            {
                return this._specificationTimes[specificationInfo];
            }

            return -1;
        }
Esempio n. 3
0
        public IMessage SyncProcessMessage(IMessage msg)
        {
            if (msg is IMethodCallMessage methodCall)
            {
                return(RemotingServices.ExecuteMessage(this, methodCall));
            }

            // This is all a bit ugly but gives us version independance for the moment
            var value    = (string)msg.Properties["data"];
            var doc      = XDocument.Load(new StringReader(value));
            var element  = doc.XPathSelectElement("/listener/*");
            var listener = (ISpecificationRunListener)this;

            switch (element?.Name.ToString())
            {
            case "onassemblystart":
                listener.OnAssemblyStart(AssemblyInfo.Parse(element.XPathSelectElement("//onassemblystart/*")?.ToString()));
                break;

            case "onassemblyend":
                listener.OnAssemblyEnd(AssemblyInfo.Parse(element.XPathSelectElement("//onassemblyend/*")?.ToString()));
                break;

            case "onrunstart":
                listener.OnRunStart();
                break;

            case "onrunend":
                listener.OnRunEnd();
                break;

            case "oncontextstart":
                listener.OnContextStart(ContextInfo.Parse(element.XPathSelectElement("//oncontextstart/*")?.ToString()));
                break;

            case "oncontextend":
                listener.OnContextEnd(ContextInfo.Parse(element.XPathSelectElement("//oncontextend/*")?.ToString()));
                break;

            case "onspecificationstart":
                listener.OnSpecificationStart(SpecificationInfo.Parse(element.XPathSelectElement("//onspecificationstart/*")?.ToString()));
                break;

            case "onspecificationend":
                listener.OnSpecificationEnd(
                    SpecificationInfo.Parse(element.XPathSelectElement("//onspecificationend/specificationinfo")?.ToString()),
                    Result.Parse(element.XPathSelectElement("//onspecificationend/result")?.ToString()));
                break;

            case "onfatalerror":
                listener.OnFatalError(ExceptionResult.Parse(element.XPathSelectElement("//onfatalerror/*")?.ToString()));
                break;
            }

            return(null);
        }
        public static void Run(this ISpecificationRunListener adapter, AssemblyInfo assemblyInfo,
                               SpecificationInfo specificationInfo, Result failure, ExceptionResult exceptionResult,
                               ContextInfo contexInfo)
        {
            adapter.OnAssemblyStart(assemblyInfo);
            adapter.OnAssemblyEnd(assemblyInfo);

            adapter.OnSpecificationStart(specificationInfo);
            adapter.OnSpecificationEnd(specificationInfo, failure);

            adapter.OnFatalError(exceptionResult);

            adapter.OnContextStart(contexInfo);
            adapter.OnContextEnd(contexInfo);

            adapter.OnRunStart();
            adapter.OnRunEnd();
        }
Esempio n. 5
0
 public void OnSpecificationStart(SpecificationInfo specificationInfo)
 {
     listeners.Each(listener => listener.OnSpecificationStart(specificationInfo));
 }
Esempio n. 6
0
 public void OnSpecificationEnd(SpecificationInfo specificationInfo, Result result)
 {
     reversedListeners.Each(listener => listener.OnSpecificationEnd(specificationInfo, result));
 }
 public void OnSpecificationEnd(SpecificationInfo specificationInfo, Result result)
 {
     specificationEnd = specificationInfo;
     specificationEndResult = result;
 }
 public void OnSpecificationStart(SpecificationInfo specificationInfo)
 {
     specificationStart = specificationInfo;
 }
 public void OnSpecificationEnd(SpecificationInfo specification, Result result)
 {
     _reporter.OnSpecificationEnd(specification, result);
 }
        public static void Run(this ISpecificationRunListener adapter, AssemblyInfo assemblyInfo, SpecificationInfo specificationInfo, Result failure, ExceptionResult exceptionResult, ContextInfo contexInfo)
        {
            adapter.OnAssemblyStart(assemblyInfo);
            adapter.OnAssemblyEnd(assemblyInfo);

            adapter.OnSpecificationStart(specificationInfo);
            adapter.OnSpecificationEnd(specificationInfo, failure);

            adapter.OnFatalError(exceptionResult);

            adapter.OnContextStart(contexInfo);
            adapter.OnContextEnd(contexInfo);

            adapter.OnRunStart();
            adapter.OnRunEnd(); 
        }
 public void OnSpecificationStart(SpecificationInfo specificationInfo)
 {
     this.listeners.Each(listener => listener.OnSpecificationStart(specificationInfo));
 }
 public virtual void OnSpecificationEnd(SpecificationInfo specificationInfo, Result result)
 {
     _runListener.OnSpecificationEnd(specificationInfo, result);
 }
 public void OnSpecificationEnd(SpecificationInfo specification, Result result)
 {
     LastSpecification = specification;
     LastResult = result;
     SpecCount++;
 }
 public void OnSpecificationEnd(SpecificationInfo specificationInfo, Result result)
 {
     specificationEnd       = specificationInfo;
     specificationEndResult = result;
 }
 public void OnSpecificationStart(SpecificationInfo specification)
 {
 }
Esempio n. 16
0
 public virtual void OnSpecificationEnd(SpecificationInfo specificationInfo, Result result)
 {
     _runListener.OnSpecificationEnd(specificationInfo, result);
 }
Esempio n. 17
0
 public virtual void OnSpecificationStart(SpecificationInfo specificationInfo)
 {
     _runListener.OnSpecificationStart(specificationInfo);
 }
 public void OnSpecificationEnd(SpecificationInfo specification, Result result)
 {
     specificationTimer.Stop();
     specificationTimes[specification] = specificationTimer.ElapsedMilliseconds;
 }
 public void OnSpecificationEnd(SpecificationInfo specification, Result result)
 {
     this._specificationTimer.Stop();
     this._specificationTimes[specification] = this._specificationTimer.ElapsedMilliseconds;
 }
 public void OnSpecificationStart(SpecificationInfo specification)
 {
 }
 public virtual void OnSpecificationStart(SpecificationInfo specificationInfo)
 {
     _runListener.OnSpecificationStart(specificationInfo);
 }
 public void OnSpecificationStart(SpecificationInfo specificationInfo)
 {
     specificationStart = specificationInfo;
 }
 public void OnSpecificationEnd(SpecificationInfo specification, Result result)
 {
     LastSpecification = specification;
     LastResult        = result;
     SpecCount++;
 }
 public void OnSpecificationEnd(SpecificationInfo specificationInfo, Result result)
 {
     this.reversedListeners.Each(listener => listener.OnSpecificationEnd(specificationInfo, result));
 }
 public void OnSpecificationStart(SpecificationInfo specification)
 {
     _reporter.OnSpecificationStart(specification);
 }