public void Add_GetAll_RoundTrip() { // Arrange var mockSpell0 = new Mock <ISpell>(); mockSpell0.Setup(s => s.Level) .Returns(0); var mockSla0 = new Mock <ISpellLikeAbility>(); mockSla0.Setup(c => c.Spell) .Returns(mockSpell0.Object); var sla0 = mockSla0.Object; var mockSpell1 = new Mock <ISpell>(); mockSpell1.Setup(s => s.Level) .Returns(1); var mockSla1 = new Mock <ISpellLikeAbility>(); mockSla1.Setup(c => c.Spell) .Returns(mockSpell1.Object); var sla1 = mockSla1.Object; SpellLikeAbilityCollection slaCollections = new SpellLikeAbilityCollection(); slaCollections.Add(sla0); slaCollections.Add(sla1); // Act var result = slaCollections.GetAllSpells(); // Assert Assert.AreEqual(2, result.Length, "Collection should only have a single element inside of it."); Assert.Contains(sla0, result, "Collection should contain a reference to the object added using the Add() method."); Assert.Contains(sla1, result, "Collection should contain a reference to the object added using the Add() method."); }