BudgetAnalyser.Engine.UnitTest.TestData.LedgerBookDtoTestData.TestData2 C# (CSharp) Метод

TestData2() публичный статический Метод

public static TestData2 ( ) : LedgerBookDto
Результат BudgetAnalyser.Engine.Ledger.Data.LedgerBookDto
        public static LedgerBookDto TestData2()
        {
            var book = new LedgerBookDto
            {
                Modified = new DateTime(2013, 12, 14),
                Name = "Test Budget Ledger Book 2",
                StorageKey = "C:\\Folder\\FooBook2.xml"
            };

            var lines = new List<LedgerEntryLineDto>();

            LedgerEntryLineDto line1 = AddEntryLineForTestData2(lines, new DateTime(2013, 12, 20));
            line1.Entries.AddRange(
                new[]
                {
                    new LedgerEntryDto
                    {
                        Balance = 0, // because would go into negative
                        BucketCode = TestDataConstants.RatesBucketCode,
                        Transactions = new List<LedgerTransactionDto>
                        {
                            new LedgerTransactionDto
                            {
                                Id = id1,
                                Amount = 75,
                                Narrative = "Budgeted Amount",
                                TransactionType = typeof(BudgetCreditLedgerTransaction).FullName
                            }
                        }
                    },
                    new LedgerEntryDto
                    {
                        Balance = 21.15M,
                        BucketCode = TestDataConstants.RegoBucketCode,
                        Transactions = new List<LedgerTransactionDto>
                        {
                            new LedgerTransactionDto
                            {
                                Id = id2,
                                Amount = 21.15M,
                                Narrative = "Budgeted Amount",
                                TransactionType = typeof(BudgetCreditLedgerTransaction).FullName
                            }
                        }
                    },
                    new LedgerEntryDto
                    {
                        Balance = 0, // because would go into negative
                        BucketCode = TestDataConstants.CarMtcBucketCode,
                        Transactions = new List<LedgerTransactionDto>
                        {
                            new LedgerTransactionDto
                            {
                                Id = id3,
                                Amount = 95,
                                Narrative = "Budgeted Amount",
                                TransactionType = typeof(BudgetCreditLedgerTransaction).FullName
                            }
                        }
                    }
                });

            LedgerEntryLineDto line2 = AddEntryLineForTestData2(lines, new DateTime(2014, 1, 20));
            line2.Entries.AddRange(
                new[]
                {
                    new LedgerEntryDto
                    {
                        BucketCode = TestDataConstants.RatesBucketCode,
                        Transactions = new List<LedgerTransactionDto>
                        {
                            new LedgerTransactionDto
                            {
                                Id = id4,
                                Amount = 75,
                                Narrative = "Budgeted Amount",
                                TransactionType = typeof(BudgetCreditLedgerTransaction).FullName
                            }
                        }
                    },
                    new LedgerEntryDto
                    {
                        BucketCode = TestDataConstants.RegoBucketCode,
                        Transactions = new List<LedgerTransactionDto>
                        {
                            new LedgerTransactionDto
                            {
                                Id = id5,
                                Amount = 21.15M,
                                Narrative = "Budgeted Amount",
                                TransactionType = typeof(BudgetCreditLedgerTransaction).FullName
                            }
                        }
                    },
                    new LedgerEntryDto
                    {
                        BucketCode = TestDataConstants.CarMtcBucketCode,
                        Transactions = new List<LedgerTransactionDto>
                        {
                            new LedgerTransactionDto
                            {
                                Id = id6,
                                Amount = 95,
                                Narrative = "Budgeted Amount",
                                TransactionType = typeof(BudgetCreditLedgerTransaction).FullName
                            }
                        }
                    }
                });

            LedgerEntryLineDto line3 = AddEntryLineForTestData2(lines, new DateTime(2014, 02, 20));
            line3.Entries.AddRange(
                new[]
                {
                    new LedgerEntryDto
                    {
                        BucketCode = TestDataConstants.RatesBucketCode,
                        Transactions = new List<LedgerTransactionDto>
                        {
                            new LedgerTransactionDto
                            {
                                Id = id7,
                                Amount = 75,
                                Narrative = "Budgeted Amount",
                                TransactionType = typeof(BudgetCreditLedgerTransaction).FullName
                            },
                            new LedgerTransactionDto
                            {
                                Id = id8,
                                Amount = -195,
                                Narrative = "Rates payment",
                                TransactionType = typeof(CreditLedgerTransaction).FullName
                            }
                        }
                    },
                    new LedgerEntryDto
                    {
                        BucketCode = TestDataConstants.RegoBucketCode,
                        Transactions = new List<LedgerTransactionDto>
                        {
                            new LedgerTransactionDto
                            {
                                Id = id9,
                                Amount = 21.15M,
                                Narrative = "Budgeted Amount",
                                TransactionType = typeof(BudgetCreditLedgerTransaction).FullName
                            }
                        }
                    },
                    new LedgerEntryDto
                    {
                        BucketCode = TestDataConstants.CarMtcBucketCode,
                        Transactions = new List<LedgerTransactionDto>
                        {
                            new LedgerTransactionDto
                            {
                                Id = id10,
                                Amount = 95,
                                Narrative = "Budgeted Amount",
                                TransactionType = typeof(BudgetCreditLedgerTransaction).FullName
                            },
                            new LedgerTransactionDto
                            {
                                Id = id11,
                                Amount = -295.45M,
                                Narrative = "Fix car",
                                TransactionType = typeof(CreditLedgerTransaction).FullName
                            }
                        }
                    }
                });

            UpdateLineBalances(line1, null, 1999.25M);
            UpdateLineBalances(line2, line1, 2001.15M);
            UpdateLineBalances(line3, line2, 1801.45M);
            book.Reconciliations = lines.OrderByDescending(e => e.Date).ToList();
            book.Ledgers.Add(new LedgerBucketDto { BucketCode = TestDataConstants.RegoBucketCode, StoredInAccount = TestDataConstants.ChequeAccountName });
            book.Ledgers.Add(new LedgerBucketDto { BucketCode = TestDataConstants.CarMtcBucketCode, StoredInAccount = TestDataConstants.ChequeAccountName });
            book.Ledgers.Add(new LedgerBucketDto { BucketCode = TestDataConstants.RatesBucketCode, StoredInAccount = TestDataConstants.ChequeAccountName });
            return book;
        }