Example #1
0
        public void AddStarSystem_SystemIsValid_SystemAdded()
        {
            var mockSystem = new Mock <StarSystem>("name", new List <Star>(), new List <Planet>()).Object;
            var container  = new StarSystemContainer();

            Assert.AreEqual(0, container.StarSystemsCount);

            container.AddStarSystem(mockSystem);

            Assert.AreEqual(1, container.StarSystemsCount);
        }
Example #2
0
        public void RemoveStarSystem_SystemIsNotInContainer_NoChanges()
        {
            var mockInContainer    = new Mock <StarSystem>("name", new List <Star>(), new List <Planet>()).Object;
            var mockNotInContainer = new Mock <StarSystem>("name", new List <Star>(), new List <Planet>()).Object;
            var container          = new StarSystemContainer();

            Assert.AreEqual(0, container.StarSystemsCount);

            container.AddStarSystem(mockInContainer);

            Assert.AreEqual(1, container.StarSystemsCount);

            container.RemoveStarSystem(mockNotInContainer);

            Assert.AreEqual(1, container.StarSystemsCount);
        }
Example #3
0
 private void SetContainerHandlers(StarSystemContainer container)
 {
     container.ColonizedCountChanged += this.Container_ColonizedCountChanged;
     container.BodiesCountChanged    += this.Container_BodiesCountChanged;
 }