public void SetUp() { _enemyBar = new Lair(); _agent = new Agent(); _dice = MockRepository.GenerateStub<IDice>(); _mission = new InfiltrationMission(_dice); Arrange(); }
static void Main(string[] args) { var agent = new Agent(); var lair = new Lair(); var dice = new Dice(m => new Random(DateTime.Now.Millisecond).Next(100)); var mission = new InfiltrationMission(dice); var timer = new MissionTimer(new LocatorImp()); timer.Subscribe(mission); //wire up the mission complete event mission.AsObservable<MissionOutcome>() .Subscribe(outcome => { Console.WriteLine("Mission complete"); mission.Begin(agent, lair); }); mission.Begin(agent, lair); Console.ReadLine(); }