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>()); }
public void WithContainedComponent_SameReferenceAsParent_ShouldThrowArgumentException() { Assert.That(() => DefaultComponent.WithContainedComponent(DefaultComponent), Throws.InstanceOf <ArgumentException>()); }
public void WithContainedComponent_NullComponent_ShouldThrowArgumentNullException() { Assert.That(() => DefaultComponent.WithContainedComponent(null), Throws.InstanceOf <ArgumentNullException>()); }