Category Archives: Unit tests

Why Microsoft Makes Bad Programmers

After the LIDNUG presentation, we stayed online to discuss unit testing experiences. A couple of things stayed with me from that talk. One: we’re (we developers) are obsessed with tooling and technology (you didn’t expect hard news here, right?). Our main focus should be about solving the business problem first. But, us geeks, we like

Read More

Battle of the framework: Testing a Webpart

Time to see the difference between Moles and Isolator code. Let’s start with the code under test (a webpart): public class NewMessagesCountWebPart : WebPart{    private Label lblNewMessages;    protected void CreateChildControls(int i)    {        CreateChildControls();    }       protected override void CreateChildControls()    {        lblNewMessages = new Label();        lblNewMessages.Text = GetMessageNumberText();        this.Controls.Add(lblNewMessages);        base.CreateChildControls();    }    private string GetMessageNumberText()    {        using (SPSite site = new SPSite(“http://sharepoint.typemock.com”))        {            using (SPWeb web

Read More

Battle of the frameworks: The SharePoint arena

Last week, I gave a presentation at the Israeli SharePoint user group on unit testing SharePoint applications. Slides below. Me closer (lurking in the shadows). As an objective observer, I compared the two and only alternatives for Isolation frameworks for SharePoint: Typemock Isolator and Microsoft Moles. And here’s my objective decision: Isolator wins by a

Read More