concept CodeCampServer in category asp.net

This is an excerpt from Manning's book ASP.NET MVC in Action with MvcContrib, NHibernate, and More.
For most of this book, we’ll be using CodeCampServer in our examples. Along with being included in the downloads for this book, CodeCampServer can be found at http://CodeCampServer.org. It’s an ASP.NET MVC Framework application that can host a conference for a user group. It uses a decoupled Onion Architecture, domain-driven design, the ASP.NET MVC Framework, and NHibernate to show how a real enterprise application would look. It has a complete build process with NAnt, which is monitored by a build server such as CruiseControl.Net or JetBrains TeamCity. The entire application is meant as a living example of how to write a real application with the ASP.NET MVC Framework. Since its inception, more volunteers have joined the project, and now it’s a full community effort. It will live on well past the life of this book, so the copy of the code you receive with this book is a snapshot in time. We invite you to join the project as it continues to progress.
Listing 2.3. Unit test creates mock objects using Rhino Mocks, a .NET mocking library
using System.Web.Mvc; using CodeCampServer.Core.Domain.Model; using CodeCampServer.UI.Controllers; using CodeCampServer.UI.Helpers.Mappers; using CodeCampServer.UI.Models.Forms; using NUnit.Framework; using Rhino.Mocks; using NBehave.Spec.NUnit; namespace CodeCampServer.UnitTests.UI.Controllers { [TestFixture] public class ScheduleControllerTester : TestBase { [Test] public void Should_map_schedule_and_display() { var conference = new Conference(); var scheduleForms = new ScheduleForm[0]; var mapper = S<IScheduleMapper>(); mapper.Stub(x => x.Map(conference)).Return(scheduleForms); var controller = new ScheduleController(mapper); ViewResult result = controller.Index(conference); result.ViewName.ShouldEqual(""); result.ViewData.Model.ShouldEqual(scheduleForms); } } }