Exemplo n.º 1
0
        public void WithContainedComponent_ComponentWithSameIdentityAdded_ShouldThrowArgumentException()
        {
            //Arrange
            var commonId        = Guid.NewGuid();
            var firstComponent  = CreateComponent(1).WithId(commonId);
            var secondComponent = CreateComponent(2).WithId(commonId);

            DefaultComponent.WithContainedComponent(firstComponent);

            Assert.That(() => DefaultComponent.WithContainedComponent(secondComponent),
                        Throws.InstanceOf <DuplicateElementException>());
        }
Exemplo n.º 2
0
 public void WithContainedComponent_SameReferenceAsParent_ShouldThrowArgumentException()
 {
     Assert.That(() => DefaultComponent.WithContainedComponent(DefaultComponent),
                 Throws.InstanceOf <ArgumentException>());
 }
Exemplo n.º 3
0
 public void WithContainedComponent_NullComponent_ShouldThrowArgumentNullException()
 {
     Assert.That(() => DefaultComponent.WithContainedComponent(null), Throws.InstanceOf <ArgumentNullException>());
 }