using System; using System.Linq; using Should; using TechTalk.SpecFlow; namespace DWH.Pricing.Tests { [Binding] public class PlanRoomSteps { [Given(@"an initial plan room of ""(.*)""")] public void GivenAnInitialPlanRoomOf(string room) { if (room == null) throw new ArgumentNullException("room"); TestPriceRequest.Current.AddPlanRoom(new PlanRoom() { OptionNumber = null, Change = PlanRoom.Changes.AddRoom, Room = room }); } [Given(@"an option plan room for (.*) that adds ""(.*)""")] public void GivenAnOptionPlanRoomForThatAdds(string optionNumber, string room) { if (optionNumber == null) throw new ArgumentNullException("optionNumber"); if (room == null) throw new ArgumentNullException("room"); TestPriceRequest.Current.AddPlanRoom(new PlanRoom() { Change = PlanRoom.Changes.AddRoom, OptionNumber = optionNumber, Room = room }); } [Given(@"an option plan room for (.*) that removes ""(.*)""")] public void GivenAnOptionPlanRoomForThatRemoves(string optionNumber, string room) { if (optionNumber == null) throw new ArgumentNullException("optionNumber"); if (room == null) throw new ArgumentNullException("room"); TestPriceRequest.Current.AddPlanRoom(new PlanRoom() { Change = PlanRoom.Changes.RemoveRoom, OptionNumber = optionNumber, Room = room }); } [Then(@"the plan contains (.*) rooms")] [Then(@"the plan contains (.*) room")] public void ThenThePlanContainsRooms(int numberOfRooms) { PriceSteps.Response.PlanRoomResponse.ActiveRooms.Count().ShouldEqual(numberOfRooms); } [Then(@"the plan contains room ""(.*)""")] public void ThenThePlanContainsRoom(string room) { PriceSteps.Response.PlanRoomResponse.ActiveRooms.ShouldContain(room); } } }