Exemplo n.º 1
0
        public void WhenAppliedToClassWithExcludeStaticConstructorFlagShouldNotLogStaticConstructor()
        {
            // act
            PersonExcludeStaticConstructor personExcludeStaticConstructor = new PersonExcludeStaticConstructor
            {
                Name = Guid.NewGuid().ToString()
            };

            personExcludeStaticConstructor.Name.Should().NotBeNullOrWhiteSpace();

            // assert
            _logger.DebugCallCount.Should()
            .Be(9, "because we only hit the Entry, Success and Exit methods for the instance constructor and property getter and setter");
        }
Exemplo n.º 2
0
        public void WhenAppliedToClassWithExcludeStaticConstructorFlagShouldNotLogStaticConstructor()
        {
            // act
            PersonExcludeStaticConstructor personExcludeStaticConstructor = new PersonExcludeStaticConstructor
            {
                Name = Guid.NewGuid().ToString()
            };
            personExcludeStaticConstructor.Name.Should().NotBeNullOrWhiteSpace();

            // assert
            _logger.DebugCallCount.Should()
                .Be(9, "because we only hit the Entry, Success and Exit methods for the instance constructor and property getter and setter");
        }