public void Children_ShouldBeEmptyAfterConstruction() { //Arrange LoggingSection loggingSection = new LoggingSection(this); //Act //Assert Assert.NotNull(loggingSection.GetChildren()); Assert.True(loggingSection.GetChildren().Count == 0); }
public void GetChildren_ShouldReturnNullAfterDisposal() { //Arrange LoggingSection loggingSection = new LoggingSection(this); //Act loggingSection.Dispose(); //Assert Assert.Null(loggingSection.GetChildren()); }
public void CreateChild_ShouldAddChildToParentsChildrenList() { //Arrange LoggingSection loggingSection = new LoggingSection(this); //Act LoggingSection child1 = new LoggingSection(this, loggingSection); LoggingSection child2 = new LoggingSection(this, loggingSection); IReadOnlyCollection <LoggingSection> children = loggingSection.GetChildren(); //Assert Assert.Equal(2, children.Count); Assert.Contains(child1, children); Assert.Contains(child2, children); }