public void AfterAdding_CanBeRetrieved() { var type = typeof(Node <SpriteRenderer>); var family = Substitute.For <IFamily>(); _container.Add(type, family); Assert.IsTrue(_container.Get(type) == family); }
public INodeList <T> GetNodes <T>() where T : Node { var type = typeof(T); IFamily <T> family; if (_families.Contains(type)) { family = _families.Get(type) as IFamily <T>; } else { family = _familyFactory.Produce <T>(); _families.Add(type, family); foreach (var entity in _entities) { family.EntityAdded(entity); } } return(family.Nodes); }