public void TestInitialise()
        {
            var accountTypeRepo = new InMemoryAccountTypeRepository();
            var subject = new Mapper_LedgerEntryDto_LedgerEntry(new LedgerBucketFactory(new BucketBucketRepoAlwaysFind(), accountTypeRepo), new LedgerTransactionFactory(), accountTypeRepo);

            Result = subject.ToDto(TestData);
        }
Ejemplo n.º 2
0
        partial void ToModelPreprocessing(LedgerEntryDto dto, LedgerEntry model)
        {
            // Transactions must be done first otherwise balance will be changed by adding transactions and the balance should be read from the Dto.
            var transactionMapper = new Mapper_LedgerTransactionDto_LedgerTransaction(this.transactionFactory, this.accountTypeRepo);

            foreach (var txn in dto.Transactions)
            {
                model.AddTransactionForPersistenceOnly(transactionMapper.ToModel(txn));
            }
        }
Ejemplo n.º 3
0
 partial void ToModelPostprocessing(LedgerEntryDto dto, ref LedgerEntry model)
 {
     model.LedgerBucket = this.bucketFactory.Build(dto.BucketCode, dto.StoredInAccount);
 }
Ejemplo n.º 4
0
 partial void ToDtoPostprocessing(ref LedgerEntryDto dto, LedgerEntry model)
 {
     dto.BucketCode      = model.LedgerBucket.BudgetBucket.Code;
     dto.StoredInAccount = model.LedgerBucket.StoredInAccount.Name;
 }
Ejemplo n.º 5
0
 partial void ToModelPreprocessing(LedgerEntryDto dto, LedgerEntry model)
 {
     // Transactions must be done first otherwise balance will be changed by adding transactions and the balance should be read from the Dto.
     var transactionMapper = new Mapper_LedgerTransactionDto_LedgerTransaction(this.transactionFactory, this.accountTypeRepo);
     foreach (var txn in dto.Transactions)
     {
         model.AddTransaction(transactionMapper.ToModel(txn));
     }
 }
Ejemplo n.º 6
0
 partial void ToModelPostprocessing(LedgerEntryDto dto, ref LedgerEntry model)
 {
     model.LedgerBucket = this.bucketFactory.Build(dto.BucketCode, dto.StoredInAccount);
 }
Ejemplo n.º 7
0
 partial void ToDtoPostprocessing(ref LedgerEntryDto dto, LedgerEntry model)
 {
     dto.BucketCode = model.LedgerBucket.BudgetBucket.Code;
     dto.StoredInAccount = model.LedgerBucket.StoredInAccount.Name;
 }