Пример #1
0
        public void WithPlugSlot_NotNullArgument_ShouldAddNewSlot()
        {
            //Arrange
            var componentInterface = CreateInterface(1).Object;

            //Act
            DefaultComponent.WithPlugSlot(componentInterface);

            //Assert
            Assert.That(DefaultComponent.PlugSlots.Contains(componentInterface));
        }
Пример #2
0
        public void WithPlugSlot_SlotAlreadyAdded_ShouldAddDuplicateSlot()
        {
            //Arrange
            var componentInterface = CreateInterface(1).Object;

            DefaultComponent.WithPlugSlot(componentInterface);

            //Act
            DefaultComponent.WithPlugSlot(componentInterface);

            //Assert
            Assert.That(DefaultComponent.PlugSlots.Count(x => x.SameIdentityAs(componentInterface)) == 2);
        }
Пример #3
0
 public void WithPlugSlot_NullArgument_ShouldThrowArgumentNullException()
 {
     Assert.That(() => DefaultComponent.WithPlugSlot(null), Throws.InstanceOf <ArgumentNullException>());
 }