Ejemplo n.º 1
0
        public void Log_InitializedProvider_Succeeds()
        {
            // Arrange
            var provider = new FakeAspNetSqlLoggingProvider();

            provider.Initialize("Valid name", CreateValidAspNetSqlLoggingSettings().BuildConfiguration());

            // Act
            provider.Log("Some message");
        }
Ejemplo n.º 2
0
        public void Log_CodeConfiguredFailingProvider_LogsToFallbackProvider()
        {
            // Arrange
            var fallbackProvider = new MemoryLoggingProvider();

            var provider = new FakeAspNetSqlLoggingProvider(fallbackProvider);

            provider.ExceptionToThrowFromLogInternal = new Exception();

            // Act
            provider.Log("Message");

            // Assert
            Assert.AreEqual(2, fallbackProvider.GetLoggedEntries().Length, "Logging failed.");
        }