VideoWorld .NET project (for ThoughtWorks Agile Developer Practices .NET workshop)
Pull request Compare This branch is even with thoughtworks:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
UnitTests
VideoWorld.Features
VideoWorld
lib
.gitignore
README.textile
SeleniumServerStandalone.bat
VideoWorld.sln

README.textile

Frameworks

NUNit
https://launchpad.net/nunitv2

Mock testing library : Moq
http://code.google.com/p/moq/

ASP.NET MVC version 3

http://www.asp.net/mvc/tutorials/creating-unit-tests-for-asp-net-mvc-applications-vb

UI testing

http://www.specflow.org/
http://smnbss.wordpress.com/2010/11/02/unveil-the-power-of-bdd-with-specflow-and-selenium-part-1/

h2 Selenium v2 (Webdriver)

We use selenium for testing the app. This can be kind of slow if you use Firefox or IE.

You can use HtmlUnit via the RemoteDriver by uncommenting the appropriate code in SeleniumSupport.cs.
Note that for this to work the selenium remote driver must be running. This is checked into the lib/test
directory. You can run it by doing:

java -jar lib\test\selenium-server-standalone-2.0b2.jar

Notes on the Code

Code smells

These are code smells that we might want to discuss with the participants

Prices

  • The IPrice.GetCharge method could be given a more descriptive name
  • The unit tests for the IPrice implementations only cover “normal” cases (no edge cases)
  • There are no tests for the frequent renter points in IPrice
h3. Movie
  • Movie has a price, as well as a get and set property
  • Movie allows a null price

Take a look at MovieTests, there is a Law of Demeter violation :

Assert.AreEqual(1, RegularMovieInstance.Price.GetFrequentRenterPoints(1));

This chould be refactored to look like this:

Assert.AreEqual(1, RegularMovieInstance.GetFrequentRenterPoints(1));