UnlockMostRecentLine() private method

Used to unlock the most recent LedgerEntryLine. Lines are locked as soon as they are saved after creation to prevent changes. Use with caution, this is intended to keep data integrity intact and prevent accidental changes. After financial records are completed for the month, they are not supposed to change.
private UnlockMostRecentLine ( ) : LedgerEntryLine
return LedgerEntryLine
コード例 #1
0
        public void UnlockMostRecentLineShouldNotThrowIfBookIsEmpty()
        {
            var subject = new LedgerBook(new FakeLogger())
            {
                Name = "Foo", Modified = new DateTime(2011, 12, 4), FileName = @"C:\TestLedgerBook.xml",
            };
            LedgerEntryLine result = subject.UnlockMostRecentLine();

            Assert.IsNull(result);
        }
コード例 #2
0
        public LedgerEntryLine UnlockCurrentMonth(LedgerBook ledgerBook)
        {
            if (ledgerBook == null)
            {
                throw new ArgumentNullException(nameof(ledgerBook));
            }

            return ledgerBook.UnlockMostRecentLine();
        }