Ejemplo n.º 1
0
        public void Children_ShouldBeEmptyAfterConstruction()
        {
            //Arrange
            LoggingSection loggingSection = new LoggingSection(this);

            //Act

            //Assert
            Assert.NotNull(loggingSection.GetChildren());
            Assert.True(loggingSection.GetChildren().Count == 0);
        }
Ejemplo n.º 2
0
        public void GetChildren_ShouldReturnNullAfterDisposal()
        {
            //Arrange
            LoggingSection loggingSection = new LoggingSection(this);

            //Act
            loggingSection.Dispose();

            //Assert
            Assert.Null(loggingSection.GetChildren());
        }
Ejemplo n.º 3
0
        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);
        }