Below and example of unit test


        [TestMethod]
        public void TestMethod()
        {
            // Create message and pipeline context
            IBaseMessage msgIn = MockMessageFactory.CreateMessageFromXml("xml message here");
            IPipelineContext pipelineContext = new MockPipelneContext() { ComponentIndex = 1, PipelineName = "MyPipelineName", StageID = new Guid(), StageIndex = 2 };

            // Set message context properties that are required by test
            msgIn.Context.Write("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", "c:\\mytest\\file.xml");
            msgIn.Context.Promote("MessageType",  "http://schemas.microsoft.com/BizTalk/2003/system-properties", "test");

            // Create the pipeline component to test as normal class instance
            SamplePipelineComponent pipelineComponent = new SamplePipelineComponent();

            // Set custom properties if present
            //pipelineComponent.CustomeProperty = "property value as passed from configuration";

            // Call Execute as BizTalk messaging engine
            IBaseMessage msgOut = pipelineComponent.Execute(pipelineContext, msgIn);

            // Asserts
            Assert.IsNotNull(msgOut.BodyPart);
        }