public void WithContainedSlot_NotNullSlot_ShouldAddSlotToContainedSLots()
        {
            //Arrange
            var slotToAdd = CreateInterface(1);

            DefaultComponent.WithContainedSlot(slotToAdd.Object);

            Assert.That(DefaultComponent.ContainedSlots.Count, Is.EqualTo(1));
            Assert.That(DefaultComponent.ContainedSlots.Contains(slotToAdd.Object));
        }
        public void WithContainedSlot_DifferentSlotWithSameIdentityAdded_ShouldThrowDuplicateElementException()
        {
            //Arrange
            var commonId  = Guid.NewGuid();
            var firstSlot = CreateInterface(1).WithId(commonId).Object;

            DefaultComponent.WithContainedSlot(firstSlot);

            //Act
            var secondSlot = CreateInterface(2).WithId(commonId).Object;

            DefaultComponent.WithContainedSlot(secondSlot);

            //Assert
            Assert.That(DefaultComponent.ContainedSlots.Count(x => x.SameIdentityAs(firstSlot)) == 2);
        }
 public void WithContainedSlot_NullSlot_ShouldThrowArgumentNullException()
 {
     Assert.That(() => DefaultComponent.WithContainedSlot(null), Throws.InstanceOf <ArgumentNullException>());
 }