I have previously developed in Rails. I found writing tests pretty easy, and I have recently moved to a project where MVC .NET is used for our main product.
I have figured out how to work with MVC .NET, but I still am not sure on how I should go around writing unit tests for my models. I will give a really quick dirty example on how I would write my unit test in rails:
describe "user.name_is_newton?"
context "user's name is newton" do
before :each do
@user = User.create(:name => "newton")
end
it { @user.name_is_newton?.should be_true }
end
end
The reason I am finding it hard to switch is because I am used to Rails providing a separate database for testing. It will (apparently) create a User entry in the test database behind the scenes and make it very easy to write the test. I am not sure how write a similar test in MVC .NET. Any help is appreciated! Thanks!