public static void Start_WhenAlreadyStarted_ShouldDoNothing() { var connectionFactory = Mock.Of <IDbConnectionFactory>(MockBehavior.Strict); var logger = Mock.Of <ILogger>(); const string sql = "select 1"; var connection = new SchematicConnection(connectionFactory, Mock.Of <IDatabaseDialect>()); Logging.AddLogging(connection, logger, LogLevel.Information); var loggingContext = new QueryLoggingContext(connectionFactory, sql, null); Assert.That(() => loggingContext.Start(), Throws.Nothing); Assert.That(() => loggingContext.Start(), Throws.Nothing); }
public static void Start_WhenNotConfigured_ShouldDoNothing() { var connectionFactory = Mock.Of <IDbConnectionFactory>(MockBehavior.Strict); const string sql = "select 1"; var loggingContext = new QueryLoggingContext(connectionFactory, sql, null); Assert.That(() => loggingContext.Start(), Throws.Nothing); }