BTDBTest.KeyValueDBTest.ReportTransactionLeak C# (CSharp) Méthode

ReportTransactionLeak() private méthode

private ReportTransactionLeak ( ) : void
Résultat void
        public void ReportTransactionLeak()
        {
            using (var fileCollection = new InMemoryFileCollection())
            {
                using (var db = new KeyValueDB(fileCollection, new NoCompressionStrategy(), 1024))
                {
                    var logger = new LoggerMock();
                    db.Logger = logger;
                    using (var tr = db.StartTransaction())
                    {
                        tr.CreateOrUpdateKeyValue(_key1, new byte[1]);
                        tr.Commit();
                    }
                    StartLeakingTransaction(db);
                    GC.Collect(GC.MaxGeneration);
                    GC.WaitForPendingFinalizers();
                    Assert.NotNull(logger.Leaked);
                    Assert.Equal("Leak", logger.Leaked.DescriptionForLeaks);
                }
            }
        }