MachineSpecificationTest GetSpecificationTest(Context context, Specification specification)
    {
      MachineSpecificationTest specificationTest = new MachineSpecificationTest( specification);

      if (specification.IsIgnored)
      {
        string reason = context.IsIgnored ? "The parent context has the IgnoreAttribute" : "The specification has the IgnoreAttribute";
        specificationTest.Metadata.Add(MetadataKeys.IgnoreReason, reason);
      }

      AddXmlComment(specificationTest, Reflector.Wrap(specification.FieldInfo));

      return specificationTest;
    }
    private bool RunSpecificationTest(MachineSpecificationTest specification, ITestCommand testCommand, ITestStep parentTestStep)
    {
      ITestContext testContext = testCommand.StartPrimaryChildStep(parentTestStep);
      testContext.LifecyclePhase = LifecyclePhases.Execute;

      var result = specification.Execute();

      if (result.Passed)
      {
        testContext.FinishStep(TestOutcome.Passed, null);
      }
      else
      {
        testContext.FinishStep(TestOutcome.Failed, null);
      }

      return result.Passed;
    }