BTDBTest.FindUnusedKeysTest.HandlesCorrectlyIIndirect C# (CSharp) Method

HandlesCorrectlyIIndirect() private method

private HandlesCorrectlyIIndirect ( bool deleteCorrectly ) : void
deleteCorrectly bool
return void
        public void HandlesCorrectlyIIndirect(bool deleteCorrectly)
        {
            using (var tr = _db.StartTransaction())
            {
                var duty = tr.Singleton<IndirectDuty>();
                duty.Duty.Value = new Duty { Name = "Read" };
                tr.Commit();
            }
            using (var tr = _db.StartTransaction())
            {
                var duty = tr.Singleton<IndirectDuty>();
                if (deleteCorrectly)
                    tr.Delete(duty.Duty.Value);
                duty.Duty.Value = new Duty { Name = "Write" };
                tr.Store(duty);
                tr.Commit();
            }
            if (deleteCorrectly)
                AssertNoLeaksInDb();
            else
                AssertLeaksInDb();
        }