Beispiel #1
0
        public void DoesNotDeclareWarIfAlreadyEngagedInOne()
        {
            _warRepository.Setup(x => x.GetWarsForEmpire(It.IsAny <ObjectId>()))
            .Returns(new War[] { new War() });
            _diplomacyCalculator.Setup(x => x.DeclareWar(It.IsAny <Empire>(), It.IsAny <Empire>()))
            .Returns(true);

            _diplomacySimulator.RunEmpire(It.IsAny <DeltaMetadata>(), It.IsAny <ObjectId>());

            _warRepository.Verify(
                x => x.BeginWar(It.IsAny <DeltaMetadata>(), It.IsAny <ObjectId>(), It.IsAny <ObjectId>()),
                Times.Never);
        }
Beispiel #2
0
 private void RunForTick(Simulation simulation, DeltaMetadata deltaMetadata)
 {
     _militarySimulator.Run(deltaMetadata, simulation.Id);
     foreach (var id in simulation.EmpireIds)
     {
         _economicSimulator.RunEmpire(deltaMetadata, id);
         _diplomacySimulator.RunEmpire(deltaMetadata, id);
     }
 }