Test Driven Development Built Name Generator Part 3(adronbhall.com)

submitted by adronadron(835) 3 years, 3 months ago

Now it is time finally for the random name generation. I’ve gotten everything into place, so it’s just a matter of grabbing the names and randomizing among them. Just as a check, after Part 2 was finished I had a total of 98,572 rows of data, or simply 98,572 names. Many times I would not write actual unit tests against the database as it breaks isolation. This time though, I'm making an exception. First I added a reference to Generator.Core, System.Data, and System.Data.Entity. I then created a new unit test class called DatabaseTests and added the following test to get things rolling. Keep in mind, since these tests break isolation, I don't write them in the red light green light idea of TDD. My assumption is that they only prove the database is setup, running, the connection string is correct, and other minor configuration based and server based components. In addition, yes, these are somewhat silly tests, such as the RetrieveFirstName() test has a bit of redundancy to it, but the point is to have an automated test to assure that the data has been moved into the database and is returning appropriately.

add a comment |category: |Views: 4

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story