This post originated from an RSS feed registered with .NET Buzz
by Maruis Marais.
Original Post: Source Formatting for Windows Live Writer
Feed Title: exceptionz
Feed URL: http://feeds.feedburner.com/Exceptionz
Feed Description: I am an XP, TDD, OO and .NET enthusiast. Things like Design Patterns makes my pulse race, I love learning exciting new things and to share my thoughts and techniques with the world. So join me and together we can explore the awesome world of software development
Everyone know what a pain it is to post source code to a blog and having the source code formatted correctly. Wel, Norbert Eder at dotnet-blog created a source formatter plug-in for Windows live writer. It works great and all you need to do is download the plugin and copy it to the plugins-directory of your Windows Live Writer installation.
The plugin supports the following languages:
C#
Java
JavaScript
MSH
Perl
T-SQL
Visual Basic
This is how some code appears on my blog:
[ Initialize() ]
publicvoid Setup()
{
mock = new Mockery();
persist = mock.NewMock( typeof( IPersistance ) ) as IPersistance;
customer = new Customer( 123 );
}
[Cleanup()]
publicvoid Cleanup()
{
mock.VerifyAllExpectationsHaveBeenMet();
}
[ Specification() ]
publicvoid ShouldLoadCustomer()
{
object[] param = newobject[] { 123 };
Expect.Once.On( persist ).Method( "Load" ).WithAnyArguments().Will( Return.Value( customer ) );
Customer expectedCustomer = persist.Load( 123 ) as Customer;
Specify.That(expectedCustomer.Id).Must.Not.Be.Null("The Customer Id must not be null.");
Specify.That(expectedCustomer.Id).Must.Equal(123, "The customer id's aren't equal");
}