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); }
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); }
private void SetContainerHandlers(StarSystemContainer container) { container.ColonizedCountChanged += this.Container_ColonizedCountChanged; container.BodiesCountChanged += this.Container_BodiesCountChanged; }