コード例 #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);
 }