Skip to main content

Posts

Showing posts from November, 2010

Bob the builder

I recently started a new project which is very focused on having good test coverage which is great goal to have.  However, looking through their tests I started to notice a lot of setup code which was very similar and looked a lot like the following: 1: [TestMethod] 2: public void WhenTheAddressRepositoryIsAskedToAPersistAddressesItShouldCorrectlyPersistThoseAddresses() 3: { 4: // Arrange 5: var addressesToPersist = new List<Address>(); 6:   7: var address = new Address 8: { 9: AddressLine1 = Guid.NewGuid().ToString(), 10: AddressLine2 = Guid.NewGuid().ToString(), 11: AddressLine3 = Guid.NewGuid().ToString(), 12: AddressLine4 = Guid.NewGuid().ToString(), 13: