Beispiel #1
0
        public RavenTest()
        {
            DatabaseMemoryTarget databaseMemoryTarget = null;

            if (LogManager.Configuration != null && LogManager.Configuration.AllTargets != null)
            {
                databaseMemoryTarget = LogManager.Configuration.AllTargets.OfType <DatabaseMemoryTarget>().FirstOrDefault();
            }
            if (databaseMemoryTarget != null)
            {
                databaseMemoryTarget.ClearAll();
            }

            try
            {
                new Uri("http://fail/first/time?only=%2bplus");
            }
            catch (Exception)
            {
            }

            SystemTime.UtcDateTime = () => DateTime.UtcNow;

            ClearDatabaseDirectory();

            Directory.CreateDirectory(DbDirectory);
        }
Beispiel #2
0
        public RavenTest()
        {
            DatabaseMemoryTarget databaseMemoryTarget = null;

            if (LogManager.Configuration != null && LogManager.Configuration.AllTargets != null)
            {
                databaseMemoryTarget = LogManager.Configuration.AllTargets.OfType <DatabaseMemoryTarget>().FirstOrDefault();
            }
            if (databaseMemoryTarget != null)
            {
                databaseMemoryTarget.ClearAll();
            }

            SystemTime.UtcDateTime = () => DateTime.UtcNow;
        }
Beispiel #3
0
 public void Can_clear_all_logs()
 {
     sut.ClearAll();
     Assert.Equal(0, sut.DatabaseTargetCount);
 }