• Aws S3 Library changed to NS3Library

    I did some major refactoring to the AwsS3Library including renaming it to NS3Library and setting up a new project at http://code.google.com/p/ns3library/

    The major changes were around adding interfaces to the public objects to allow different implementations. I hope to add a Sql Lite Implementation soon.

  • Moving from Castle RC3 to Trunk

    Today I moved from Castle Project RC3 to Trunk there were a couple changes that I needed to make. The IFilter interface has changed, The ExecuteEnum has changed to ExecuteWhen. The IRailsEngineContext name has changed to IEngineContext. I think there’s been a fair amount of refactoring around the Controller, I think the IController interface is new and there is now an IControllerContext interface. The EngineContextModule has been removed, so I needed to remove that from the web.config. and the Windsor integration facility name has changed from RailsFacility to MonoRailFacility, which also required a web.config change. The upgrade seems to be working well.

  • Send Email using RenderViewAndSend on Monorail


    When sending an email using RenderMessageAndSend the following will be parsed for the message and removed what’s left is sent as the body.

    from: name <address> or address
    to: address,address
    cc: address,address
    bcc: address,address
    subject: value
    X-header: value
    body text

    </span>If the body text contains ‘’ it will be sent as html.

    By default layouts will not be applied. It looks for views stored in
    Common if the view name starts with a /. Otherwise it looks for
    views in the Mail folder.

    • /MailTemplate.brail should be stored in views/common/MailTemplate.brail</li>

    • MailTemplate.brail should be stored in views/mail/MailTemplate.brail
    • </ul>


      The test support doesn’t currently render the message, but you can check for the number of message sent and the template name and properties.

      Assert.That(MessagesSent.Length, Is.EqualTo(2));
      Assert.That(RenderedEmailTemplates[0].Name, Is.EqualTo(“MailTemplate”));
      Assert.That(RenderedEmailTemplates[0].Parameters[“to”], Is.EqualTo(emails[0]));

      </span>In the MessageSent Collection all the messages are hard coded as

      new Message(“from”, “to”, “subject”, “body”);

      </span>Also added to using.castleproject.org Sending Email With RenderViewAndSend


  • Unit Testing Castle Monorail Filters

    I’m really liking the unit test support in the Castle Monorail project. Here’s an example to create a simple test for testing filters.

    public class AdminAuthorizationFilterTest : BaseControllerTest
    private Controller _controller;

    public void Setup()
    _controller = new TestController();

    public void Perform_No_User_Expect_False()
    AdminAuthorizationFilter filter = new AdminAuthorizationFilter();
    bool perform = filter.Perform(ExecuteEnum.BeforeAction, Context, _controller);
    Assert.That(perform, Is.False);
    Assert.That(Response.WasRedirected, Is.True);

    internal class TestController : Controller {}


    Setup is the same as testing a controller, but I needed to create an basic test controller. I attempted to use Rhino Mocks to partial mock the controller, but that disconnected the BaseControllerTest resulting in things like checking the Response object not working. Creating the class is one less line of code anyway.

    More on test support here.
    And Here.

  • Testing filters and the using.castleproject.org site

    Opps, I guess there’s already some documentation on Testing Filters here. There is a lot of good info on the using.castleproject.org site, I’ll be checking and adding info there.

  • Storing DateTime objects in Amazon Simple DB

    I’m working with the Amazon Simple DB web service. It stores everything in strings as such I needed to store a DateTime in ISO 8601 format for later sorting the strings in correct order. The frameworks has at least three formating strings. Either s or u or o. The s format seems like a good choice as it’s called the sortable format. However it doesn’t store any sub second data or timezone info. The u format is s in universal time, but still lacks the sub second data. Lastly the o format for round trip stores all the DateTime info in ISO 8601 format and should remain sortable as long as all dates are stored in the same time zone. MSDN DateTime format strings{#uww6}

    Here’s more good info on storing data as a string in ways that are sortable later and useful Simple DB info.


  • Castle monorail brail view template

    I finally spent two minutes to create a view.brail VS template today. It’s really basic, but at least I won’t end up with a class definition every time I try to add a new view. Below is the zip file, just drop in into My Documents\Visual Studio 2005\Templates\ItemTemplates.

    View.zip (5.12 KB)