markdown in WordPress – AT LAST!!!!!

Here’s some normal text interspersed with some Code, some italics and bold.

a quote

some sql

select
    a.FILEID,
    [FILE_SIZE_MB] = 
        convert(decimal(12,2),round(a.size/128.000,2)),
    [SPACE_USED_MB] =
        convert(decimal(12,2),round(fileproperty(a.name,'SpaceUsed')/128.000,2)),
    [FREE_SPACE_MB] =
        convert(decimal(12,2),round((a.size-fileproperty(a.name,'SpaceUsed'))/128.000,2)) ,
    NAME = left(a.NAME,15),
    FILENAME = left(a.FILENAME,30)
from
    dbo.sysfiles a

some code

[TestFixture]
public class ScrewdriverTests
{
    [Test]
    public void Container_ExplicitRegistration1_ReturnsExpectedClass()
    {
        Container container = new Container();

        container.Register(typeof(IScrewdriver<FlatHead>), typeof(FlatHeadScrewdriver));

        var screwdriver = container.GetInstance(typeof(IScrewdriver<FlatHead>));

        Assert.That(screwdriver, Is.Not.Null);
    }

    [Test]
    public void Container_ExplicitRegistration2_ReturnsExpectedClass()
    {
        Container container = new Container();

        container.Register<IScrewdriver<FlatHead>, FlatHeadScrewdriver>();

        var screwdriver = container.GetInstance<IScrewdriver<FlatHead>>();

        Assert.That(screwdriver, Is.Not.Null);
    }

    [Test]
    public void Container_ExplicitRegistration_ExceptionForUnregisteredClass()
    {
        Container container = new Container();

        container.Register<IScrewdriver<FlatHead>, FlatHeadScrewdriver>();

        Assert.Throws<ActivationException>(() =>
            {
                var screwdriver = container.GetInstance<IScrewdriver<Torx>>();
            });
    }

    [TestCase(typeof(IScrewdriver<FlatHead>))]
    [TestCase(typeof(IScrewdriver<Phillips>))]
    [TestCase(typeof(IScrewdriver<Torx>))]
    public void Container_BatchRegistration_ReturnsExpectedClass(Type registeredType)
    {
        Container container = new Container();

        container.RegisterManyForOpenGeneric(
            typeof(IScrewdriver<>), 
            typeof(IScrewdriver<>).Assembly);

        var screwdriver = container.GetInstance(registeredType);
        Assert.That(screwdriver, Is.Not.Null);
    }
}

and some xml too

<?xml version="1.0"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
  </configSections>
  <connectionStrings>
    <add name="PPContext" connectionString="Data Source=.;Initial Catalog=PP;Integrated Security=True;MultipleActiveResultSets=True"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
  </entityFramework>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>

Leave a Reply