NConstraints Version 1.0.0 Released

A common unit test assert I need to do is compare all the property values of one object to another.  For example:

[Test]
public void TestSaveWorks()
{
  // Create a value to save.
  var expectedDto = new SomeDto() {ValueOne = 1, ValueTwo = "Blah"};

  // Save the value.
  _someDbService.Save(dtoToSave);

  // Load the value from the database.  The DTO ID
  // should have been set by the save.
  var actualDto = _someDbService.Find(expectedDto.Id);
  
  Assert.That(expectedDto.ValueOne, Is.EqualTo(actualDto.ValueOne));
  Assert.That(expectedDto.ValueTwo, Is.EqualTo(actualDto.ValueTwo));
}

In this test we only have two properties to test but if the object has 10 plus properties to test that would be quite onerous.   I often forget to update the tests after I add a new property to the object.

[Read More]
Categories: code-examples  Tags: nconstraints nunit 

Today I Learned How to Run NUnit Tests for a .NET Core Project in TeamCity

In TeamCity you can’t use the usual NUnit Runner to run .NET Core unit tests.  At least I couldn’t get it to work.  I’m sure this will be fixed in the future but for now the below works for me.  I got lots of inspiration from this TeamCity blog post.

For this example I’ll use the NConstraints project.  It contains a .NET Standard project (SaturdayMP.Constraints) that we want to test and two .NET Core Test projects (SaturdayMP.Constratints.Test and TestClient).

[Read More]

Odds Are you Work for a Small Business

If I was a betting man I would bet you work for a small company (99employees or less).  Odds are I would be right half the time.  How did I come up with those numbers?  Using some math and stats I found on the Internet.

About 24% of the working population are public employees (i.e. employed by government).  The remaining 76% are employed by private companies with just a hair under 70% working for a company of less then 100 employees.

[Read More]
Categories: business-side  Tags: small-business 

Importance of Spouses in Small Businesses

Starting a new business is hard.  In 2010 study just over half of new business in Canada survive 5 years or more and only 30% survive 10 years.  Similar statics for our neighbours in the south.

Canada’s Performance from 2001 to 2006 on Key Indicators of Entrepreneurial Performance

Saturday Morning Productions has been around for 7 1/2 years, if my maths are correct.  Our odds of surviving this long are about 45%.  Another way to look at it is if 100 business opened in 2009 then only 45 are still around today.

[Read More]

My Takeaway from Reading Meatball Sundae

Meatball Sundae CoverBook: Meatball Sundae: Is Your Marketing out of Sync? Author: Seth Godin

My takeaway from Meatball Sundae is don’t use a new marketing trend because it’s the hip new thing to do.  Make sure the marketing you do aligns with your business.  If the new marketing you does not align either change your business or don’t bother with the new marketing.

The book was written in 2007 and focuses mostly on marketing using the web but the basic idea applies to any new marketing technology.  Just because others companies use dream ads doesn’t mean you need too.

[Read More]