MVP 2010, 4th Year in a row.

Every year 1st of July is a bit of a panic day for me. I check my email more frequently than I normally do. Because that’s my MVP renewal day. I?m very pleased to say, I been re-awarded the MVP status for 2010 4th year in a row. I would like to thank everyone who worked behind the scene (honestly I don’t have a clue.). I also noticed lot of existing BizTalk Server MVP like Jan Eliasen, Thiago Almeida renewed on the same day and some new ones like Steef-Jan Wiggers. I would like to congratulate all of them.

Nandri!

Saravana

Intro to PLINQ

I recently had the opportunity to attend the Microsoft launch event for the new Visual Studio 2010. I was impressed with everything 2010 is bringing to the table, but what really caught my eye is the new Parallel FX library. Parallel FX provides developers with a set of tools which promises faster and […]

Awarded MVP BizTalk Server 1st July 2010

This is an exciting moment, before summer holidays will start. I have been awarded by Microsoft with 2010 Microsoft%u00ae MVP Award. I was working today and after finishing diner with the family I opened my mailbox and found the ’Congratulations 2010 Microsoft MVP!’ email from Microsoft. I cannot describe how happy I am and how rewarding it feels to receive such an award.

I would like to thank all people at Microsoft (ones that nominated me), community members and other involved. My wife and children for enduring the long hours without me, while I was blogging, writing or participating on forums. I would dedicated this to them.

Finally I also would like to thank my dear friend and buddy Joost Smit, who always believed in me and support me last couple of years in my career.

P.S. No logo yet as I have to wait for my logo kit.

Technorati: biztalk

WF Tip: Use a StringWriter to capture WriteLine Activity output when testing

Question: Suppose you want to test an activity that uses WriteLine and you want to verify the output.  How do you do it?

Answer: Add a StringWriter to the Extensions collection before running your test

Testing this activity

Use this test

[TestMethod]

public void ShouldSayHelloWorld()
{

var wi = new WorkflowInvoker(new HelloWorld());

// The WriteLine activity will use an extension
// of type TextWriter instead of the Console
// if it finds one
var writer = new StringWriter();
wi.Extensions.Add(writer);

wi.Invoke();

Assert.AreEqual("Hello\r\nWorld\r\n", writer.ToString());
}

But… what if you had 100 lines of text?  It would get pretty tricky to deal with the writer text.  In that case, you could split the buffer into an array of strings using Regex which makes it much easier to work with.

[TestMethod]

public void ShouldSayHelloWorldUsingRegex()
{
var writer = new StringWriter();

var wi = new WorkflowInvoker(new HelloWorld());
wi.Extensions.Add(writer);

wi.Invoke();

// If you have a lot of text to verify
// splitting the writer into an array of strings
// makes it easier to deal with
string[] lines = Regex.Split(writer.ToString(), Environment.NewLine);

Assert.AreEqual(3, lines.Length);
Assert.AreEqual("Hello", lines[0]);
Assert.AreEqual("World", lines[1]);
// There is always 1 blank line at the end
Assert.AreEqual(string.Empty, lines[2]);
}