public void CanAddDocumentSpecByName()
      {
         PipelineContext context = new PipelineContext();
         DocSpecLoader loader = new DocSpecLoader();
         context.AddDocSpecByName("spec1", loader.LoadDocSpec(typeof(Schema1_NPP)));

         Assert.IsNotNull(context.GetDocumentSpecByName("spec1"));
      }
 public void ThrowExceptionIfNoDocSpecFoundByName()
 {
    string specName = "non-existant-spec";
    try
    {
       IPipelineContext context = new PipelineContext();
       context.GetDocumentSpecByName(specName);
    } catch ( COMException ex )
    {
       Assert.That(ex.Message, new EndsWithConstraint(specName));
    }
 }
      public void CanCreateDefaultContext()
      {
         PipelineContext context = new PipelineContext();
         Assert.AreEqual(0, context.ComponentIndex);
         Assert.AreEqual(Guid.Empty, context.PipelineID);
         Assert.IsFalse(String.IsNullOrEmpty(context.PipelineName));
         Assert.IsNotNull(context.ResourceTracker);
         Assert.AreEqual(Guid.Empty, context.StageID);
         Assert.AreEqual(0, context.StageIndex);

         Assert.IsNotNull(context.GetMessageFactory());
         Assert.IsFalse(context.AuthenticationRequiredOnReceivePort);
      }
 public void HasEventStream()
 {
    PipelineContext context = new PipelineContext();
    Assert.IsNotNull(context.GetEventStream());
 }
      public void CanEnableTransactionSupport()
      {
         PipelineContext context = new PipelineContext();
         Assert.IsNull(context.GetTransaction());

         context.EnableTransactionSupport();
         object transaction = context.GetTransaction();
         Assert.IsNotNull(transaction);

         object transaction2 = context.GetTransaction();
         Assert.AreSame(transaction, transaction2);
      }
      public void CanSetGroupSigningCertificate()
      {
         string certificate = 
            "ee a5 bc 5f 19 14 3c 01 b0 41 d2 83 e6 92 68 a0 51 3d fb a1"; 
         
         PipelineContext context = new PipelineContext();
         Assert.IsNull(context.GetGroupSigningCertificate());

         context.SetGroupSigningCertificate(certificate);
         Assert.AreEqual(certificate, context.GetGroupSigningCertificate());
      }
      public void CanSetReceivePortAuthentication()
      {
         PipelineContext context = new PipelineContext();
         Assert.IsFalse(context.AuthenticationRequiredOnReceivePort);

         context.SetAuthenticationRequiredOnReceivePort(true);
         Assert.IsTrue(context.AuthenticationRequiredOnReceivePort);
      }