Skip to content

Commit

Permalink
- Components from any container can now be added to a component view.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbrowndotje committed Apr 26, 2020
1 parent 6b7581d commit cd2d272
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
19 changes: 0 additions & 19 deletions Structurizr.Core.Tests/View/ComponentViewTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,25 +242,6 @@ public void Test_Add_DoesNothing_WhenTheSpecifiedComponentIsAlreadyInTheView()
Assert.Equal(1, view.Elements.Count);
}

[Fact]
public void Test_Add_DoesNothing_WhenTheSpecifiedComponentIsInADifferentContainer()
{
SoftwareSystem softwareSystemA = Model.AddSoftwareSystem("System A", "Description");

Container containerA1 = softwareSystemA.AddContainer("Container A1", "Description", "Tec");
Component componentA1_1 = containerA1.AddComponent("Component A1-1", "Description");

Container containerA2 = softwareSystemA.AddContainer("Container A2", "Description", "Tec");
Component componentA2_1 = containerA2.AddComponent("Component A2-1", "Description");

view = new ComponentView(containerA1, "components", "Description");
view.Add(componentA1_1);
view.Add(componentA2_1);

Assert.Equal(1, view.Elements.Count);
Assert.True(view.Elements.Contains(new ElementView(componentA1_1)));
}

[Fact]
public void Test_Add_DoesNothing_WhenTheContainerOfTheViewIsAdded()
{
Expand Down
5 changes: 1 addition & 4 deletions Structurizr.Core/View/ComponentView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,7 @@ public void Add(Component component)
{
if (component != null)
{
if (Container.Equals(component.Container))
{
AddElement(component, true);
}
AddElement(component, true);
}
}

Expand Down
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Added a 16:10 ratio paper size.
- Added a "Component" element shape.
- Added a "Dotted" element border style.
- Components from any container can now be added to a component view.

## 0.9.6 (29th February 2020)

Expand Down

0 comments on commit cd2d272

Please sign in to comment.