Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public void WithContainedSlot_NullSlot_ShouldThrowArgumentNullException()
 {
     Assert.That(() => DefaultComponent.WithContainedSlot(null), Throws.InstanceOf <ArgumentNullException>());
 }