예제 #1
0
 public void SetUp()
 {
     _enemyBar = new Lair();
     _agent = new Agent();
     _dice = MockRepository.GenerateStub<IDice>();
     _mission = new InfiltrationMission(_dice);
     Arrange();
 }
예제 #2
0
파일: Program.cs 프로젝트: brocksamson/Evil
        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();
        }
예제 #3
0
 private void AssertStartupBase(Lair lair)
 {
     Assert.IsNotNull(lair);
     Assert.AreEqual(lair.Name, _view.BaseName);
     Assert.AreEqual(lair.Location.Latitude, _latitude);
     Assert.AreEqual(lair.Location.Longitude, _longitude);
     //Assert.AreEqual(@base.Sections.Count(), Is.EqualTo(4));
     //Assert.AreEqual(@base.Sections.Any(m => m.GetType() == typeof(BarSection)), Is.True, "No bar section found");
     //Assert.AreEqual(@base.Sections.Where(m => m.GetType() == typeof(EmptySection)).Count(), Is.EqualTo(3), "Base should have 3 empty sections");
 }
예제 #4
0
 public void SetUp()
 {
     _bar = new Lair();
 }
예제 #5
0
 private static Lair CreateNewBar()
 {
     var lair = new Lair();
     lair.SetProperty(m => m.Id, _lairId);
     return lair;
 }
예제 #6
0
 public void SetUp()
 {
     _newLair = CreateNewBar();
     _baseRepository = new InMemoryRepository<Lair>(_newLair);
     _controller = new LairController(Mapper.Engine, _baseRepository);
 }