public class when_validating_contact : ContextSpecification { protected ContactService Service; protected bool Result; protected Contact Contact; protected override void Context() { Service = new ContactService(); //initialize the contact with known and valid values Contact = new Contact { Email = "e-mail", FirstName = "fist-name", LastName = "last-name" }; } protected override void Because() { Result = Service.Validate(Contact); } [TestClass] public class with_empty_email : when_validating_contact { protected override void Context() { base.Context(); //set email to an invalid value Contact.Email = string.Empty; } } [TestClass] public class with_empty_firstname : when_validating_contact { protected override void Context() { base.Context(); //set firstname to an invalid value Contact.FirstName = string.Empty; } } [TestClass] public class with_empty_lastname : when_validating_contact { protected override void Context() { base.Context(); //set lastname to an invalid value Contact.LastName = string.Empty; } } //note - this test method is part of the base class [TestMethod] public void should_not_be_valid() { Assert.IsFalse(Result); } }