Beispiel #1
0
 public void CanStoreAndRetrieveMultipleComponents()
 {
     var component1 = new MockComponent();
     _entity.Add(component1);
     var component2 = new MockComponent2();
     _entity.Add(component2);
     Assert.AreSame(_entity.Get(typeof(MockComponent)), component1);
     Assert.AreSame(_entity.Get(typeof(MockComponent2)), component2);
 }
Beispiel #2
0
        public void CanStoreAndRetrieveMultipleComponents()
        {
            var component1 = new MockComponent();

            _entity.Add(component1);
            var component2 = new MockComponent2();

            _entity.Add(component2);
            Assert.AreSame(_entity.Get(typeof(MockComponent)), component1);
            Assert.AreSame(_entity.Get(typeof(MockComponent2)), component2);
        }
Beispiel #3
0
        public void WillRetrieveAllComponents()
        {
            var component1 = new MockComponent();

            _entity.Add(component1);
            var component2 = new MockComponent2();

            _entity.Add(component2);
            var all = _entity.GetAll();

            Assert.AreEqual(new List <object> {
                component1, component2
            }, all);
        }
Beispiel #4
0
 public void WillRetrieveAllComponents()
 {
     var component1 = new MockComponent();
     _entity.Add(component1);
     var component2 = new MockComponent2();
     _entity.Add(component2);
     var all = _entity.GetAll();
     Assert.AreEqual(new List<object> { component1, component2 }, all);
 }