Wednesday, December 12, 2012

Windows Azure (Part 1) Migrator Dotnet

I like to use Migrator Dotnet in my projects to manage database changes during development.  I know EF has it's own migration engine and I really should use it, however I just like Migrator Dotnet better.

One thing I was worried about when I was moving a site over to Azure Websites, and Sql Azure, was how to manage database changes.  I new Windows Azure supported Entity Framework Migrations, but the project I was moving over was a little older and I was using Migrator Dotnet.

So I created my new SQL Azure Database, and allowed my IP address to connect to the database using the Azure Management Portal.  Then I was able to connect to the database from my development workstation using SQL Management Studio.  I figured if I could connect that way, I should be able to run my Migrations from my development workstation using the connection string to my Azure database.

I setup my migration script with the proper connection string and I ran my migrations.  After a couple minutes, all my migrations were completed successfully and my Azure database was filled with all my tables and seed data.

I was excited that it worked.  I really did not want to spend time switching over to using Entity Framework Migrations.

Windows Azure (Intro)

I recently signed up for a free Windows Azure account to learn more about the cloud offering from Microsoft.

Windows Azure is a Microsoft product.  Described below by Wikiepedia.
cloud computing platform used to build, deploy and manage applications through a global network of Microsoft-managed datacenters. Windows Azure allows for applications to be built using many different programming languages, tools or frameworks and makes it possible for developers to integrate their public cloud applications in their existing IT environment. Windows Azure provides both Platform as a Service (PaaS) and Infrastructure as a Service (IaaS) services and is classified as the “Public Cloud” in Microsoft's cloud computing strategy, along with its Software as a Service (SaaS) offering, Microsoft Online Services

 So I have been reading online about how easy it is to setup your websites and data driven web applications and I thought I would give it a try.

I am not going to blog about How to publish a site or signup or anything like that.  There are already lots of blogs posts like that.  What I will blog about are some things I was able to do that aren't really talked about anywhere else.

My first azure blog post will be Migrator Dotnet and Azure.

Monday, May 14, 2012

NCrunch

I am back!  OK I really didn't go anywhere I just haven't posted anything in a long time.

So thanks to my buddy Dan, I am going to rave about a new tool called NCrunch.

NCrunch is an automated parallel continuous testing tool.

Holy cow what does that mean?

Well it means that after installing the plugin, Visual Studio will continuously run your unit tests, or any tests you tell it to run.  It will also place indicator dots on every line of code indicating if that line of code is covered by a test and if so if that test is passing.  These dots also give you performance indications as well so you can easily find areas in your methods that run a little slow.

I know what you are saying, I already can run unit tests and find coverage out of the box.  True, and I was skeptical at first as well, but after using NCrunch for one week I am amazed.  I only have to type code and the indicators update automatically.  I do not have to compile, I do not have to run anything myself.  I don't have to wait.  I get instant feedback from tests, and I save time.

Did I mention the tool makes me feel guilty?  Now when I open up a class and see black dots, or white in my case since you can customize the indicator colors, I feel guilty that there are no tests covering the class and the first thing I do is figure out how to write some useful unit tests.  As I write the dots turn Red then to green, assuming the code was correct.

A couple drawbacks, NCrunch still does not work with Silverlight test projects or Silverlight UI projects.  If you have tests that rely on these type of projects then you can tell the tool to ignore them.  I would also recommend ignoring specification tests that invoke the UI, like Specflow with Selenium.

Configuration of the tool is simple with the built in wizard.  you can tell it how many processors to use and if tests should be run in asynchronously or not.

Cost, of Ncrunch.net is currently free.  However judging by the website once they release version 1.0 there will be cost to the tool.  I have a feeling like resharper I will not be able to live with out it.

Now to the screenshots
Untested Code Indicator Dots

Tested Passing Code Indicator Dots