Exemplo n.º 1
0
        public void Initialize_WithNullConfiguration_ThrowsException()
        {
            // Arrange
            var provider = new AspNetTraceLoggingProvider();
            NameValueCollection invalidConfiguration = null;

            // Act
            provider.Initialize("Valid provider name", invalidConfiguration);
        }
Exemplo n.º 2
0
        public void Initialize_WithValidArguments_Succeeds()
        {
            // Arrange
            var provider = new AspNetTraceLoggingProvider();
            NameValueCollection validConfiguration = CreateValidConfiguration();

            // Act
            provider.Initialize("Valid provider name", validConfiguration);
        }
Exemplo n.º 3
0
        public void Initialize_ConfigurationWithoutDescription_SetsDefaultDescription()
        {
            // Arrange
            var expectedDescription = "ASP.NET trace logging provider";
            var provider            = new AspNetTraceLoggingProvider();
            var validConfiguration  = CreateValidConfiguration();

            // Act
            provider.Initialize("Valid provider name", validConfiguration);

            // Assert
            Assert.AreEqual(expectedDescription, provider.Description);
        }
Exemplo n.º 4
0
        public void Initialize_ConfigurationWithCustomDescription_SetsSpecifiedDescription()
        {
            // Arrange
            var expectedDescription = "My web app trace logging provider";
            var provider            = new AspNetTraceLoggingProvider();
            var validConfiguration  = CreateValidConfiguration();

            validConfiguration["description"] = expectedDescription;

            // Act
            provider.Initialize("Valid provider name", validConfiguration);

            // Assert
            Assert.AreEqual(expectedDescription, provider.Description);
        }