コード例 #1
0
        public void AppliesEmpireSystemLoss()
        {
            var starSystem = new StarSystem {
                Id = ObjectId.GenerateNewId()
            };
            var empire = new Empire {
                Id = ObjectId.GenerateNewId(), StarSystemsIds = new ObjectId[0]
            };

            _simulationView.Empires     = new Empire[] { empire };
            _simulationView.StarSystems = new StarSystem[] { starSystem };
            _deltaSet.DeltaObjectIds    = new Delta <ObjectId>[]
            {
                new Delta <ObjectId> {
                    DeltaType = DeltaType.EmpireSystemLoss, ReferenceId = empire.Id, Value = starSystem.Id
                }
            };

            var result         = _deltaApplier.GetForTick(It.IsAny <ObjectId>(), It.IsAny <int>());
            var resultEmpire   = Assert.Single(result.Empires);
            var resultSystemId = Assert.Single(resultEmpire.StarSystemsIds);

            Assert.Equal(starSystem.Id, resultSystemId);
        }