public void BadArgsInGetValue()
        {
            SimpleContainerEntry <Object> entry = new SimpleContainerEntry <Object>(new Object());

            Assert.Throws <ArgumentNullException>(() => entry.GetValue(null));
            Assert.Throws <ArgumentNullException>(() => ((IContainerEntry)entry).GetValue(null));
        }
 public void TestHasComponentByNameWithDuplicates()
 {
     IContainerEntry entry = new SimpleContainerEntry<String>(EntryValue);
     IContainerEntry otherEntry = new SimpleContainerEntry<String>(OtherEntryValue);
     _subContainer1.AddComponent(Name, entry);
     _innerSubContainer.AddComponent(Name, otherEntry);
     Assert.IsTrue(_mainContainer.HasComponent(Name));
     Assert.IsTrue(_subContainer1.HasComponent(Name));
     Assert.IsTrue(_innerSubContainer.HasComponent(Name));
     Assert.IsFalse(_subContainer2.HasComponent(Name));
 }
Exemplo n.º 3
0
        public void TestHasComponentByNameWithDuplicates()
        {
            IContainerEntry entry      = new SimpleContainerEntry <String>(EntryValue);
            IContainerEntry otherEntry = new SimpleContainerEntry <String>(OtherEntryValue);

            _subContainer1.AddComponent(Name, entry);
            _innerSubContainer.AddComponent(Name, otherEntry);
            Assert.IsTrue(_mainContainer.HasComponent(Name));
            Assert.IsTrue(_subContainer1.HasComponent(Name));
            Assert.IsTrue(_innerSubContainer.HasComponent(Name));
            Assert.IsFalse(_subContainer2.HasComponent(Name));
        }
 public void BadArgsInGetValue()
 {
     SimpleContainerEntry<Object> entry = new SimpleContainerEntry<Object>(new Object());
     Assert.Throws<ArgumentNullException>(() => entry.GetValue(null));
     Assert.Throws<ArgumentNullException>(() => ((IContainerEntry) entry).GetValue(null));
 }