Beispiel #1
0
        public Specification SpecFactory(string description, Action function, Definition suite, string  codeBase, int lineNumber, int column, string fileName, string className)
        {
            var spec = new Specification()
              {
            Id = String.Format("spec://{0}/{1}:{2}", className, lineNumber, column),
               // Id = suite.Parent.Description + ".spec" + string.Format("{0}x{1}", lineNumber, column),  /* it.Id*/
            Description = description,
            Fn = function,
            Parent = suite,
            CodeBase = codeBase,
            LineNumber = lineNumber,
            Column = column,
            FileName = fileName,
            ClassName = className
              };

            if(_executableLookupTable.Any(x=>x.Id == spec.Id))
            {
            var t = (from p in _executableLookupTable
                where p.Id.StartsWith(spec.Id)
                select p).Count();
            spec.Id = spec.Id + string.Format("({0})", t);
            }

              _executableLookupTable.Add(spec);
              return spec;
        }
Beispiel #2
0
        public static DefinitionSource CreateSource(Specification Specification)
        {
            var result = new DefinitionSource();
              result.Id = Specification.Id;

              result.ParentDescription = Specification.Parent.Description;
              result.Description = Specification.Description;
              result.Enabled = Specification.Enabled;
              result.RanSuccesfully = Specification.RanSuccesfully;
              result.ExecutionResult = Specification.ExecutionResult;
              result.EndTime = Specification.EndTime;
              result.StartTime = Specification.StartTime;
              result.CodeBase = Specification.CodeBase;
              result.LineNumber = Specification.LineNumber;
              result.Column = Specification.Column;
              result.FileName = Specification.FileName;
              result.ClassName = Specification.ClassName;
              result.StackTrace = Specification.StackTrace;

              return result;
        }