public MachineSpecificationTest(Specification specification) 
   : base(specification.Name, Reflector.Wrap(specification.FieldInfo))
 {
   this.Kind = TestKinds.Test;
   this.IsTestCase = true;
   _specification = specification;
 }   
    public Result Run(Specification specification)
    {
      _listener.OnSpecificationStart(specification.GetInfo());
      var result = specification.Verify();
      _listener.OnSpecificationEnd(specification.GetInfo(), result);

      return result;
    }
    public Result Run(Specification specification)
    {
      _listener.OnSpecificationStart(specification.GetInfo());
      var result = specification.Verify();
      result = _resultSupplementers.Aggregate(result, (r, supplement) => supplement.SupplementResult(r));
      _listener.OnSpecificationEnd(specification.GetInfo(), result);

      return result;
    }
 private Test ConvertToVisualStudioTest(Context context, Specification specification)
 {
     var test = converter.GetVisualStudioTest(context, specification);
     if (context.Instance == null)
     {
         return test;
     }
     var it = (Delegate) specification.FieldInfo.GetValue(context.Instance);
     if (it == null)
     {
         return test;
     }
     var methodInfo = it.GetMethodInfo();
     var sourceInfo = provider.GetSourceInformation(methodInfo);
     test.CodeFilePath = sourceInfo.Filename;
     test.LineNumber = sourceInfo.LineNumber;
     return test;
 }
 public void AddSpecification(Specification specification)
 {
   _specifications.Add(specification);
 }
 public SpecificationVerificationIteration(Specification current, Result result, Specification next)
 {
   Next = next;
   Current = current;
   Result = result;
 }
 static List<Result> FailSpecification(ISpecificationRunListener listener, Specification specification, Result result)
 {
   listener.OnSpecificationStart(specification.GetInfo());
   listener.OnSpecificationEnd(specification.GetInfo(), result);
   return new List<Result> { result };
 }
 public Test GetVisualStudioTest(Context context, Specification specification)
 {
     return GetVisualStudioTest(context.GetInfo(), specification.GetInfo());
 }
Exemple #9
0
 public void AddSpecification(Specification specification)
 {
     _specifications.Add(specification);
 }
Exemple #10
0
 public SpecificationVerificationIteration(Specification current, Result result, Specification next)
 {
     Next    = next;
     Current = current;
     Result  = result;
 }