public void TestInitialise()
        {
            var todoCollection = new ToDoCollection();
            todoCollection.Add(new ToDoTask("Foo1"));
            todoCollection.Add(new ToDoTask("Foo2", false, false));
            this.testData = new ApplicationDatabase();
            PrivateAccessor.SetProperty(this.testData, "BudgetCollectionStorageKey", "Budget.xml");
            PrivateAccessor.SetProperty(this.testData, "FileName", "C:\\Foo\\TestData.bax");
            PrivateAccessor.SetProperty(this.testData, "LedgerBookStorageKey", "Ledger.xml");
            PrivateAccessor.SetProperty(this.testData, "MatchingRulesCollectionStorageKey", "Rules.xml");
            PrivateAccessor.SetProperty(this.testData, "StatementModelStorageKey", "Statement.xml");
            PrivateAccessor.SetProperty(this.testData, "LedgerReconciliationToDoCollection", todoCollection);

            var subject = new Mapper_BudgetAnalyserStorageRoot_ApplicationDatabase();
            this.result = subject.ToDto(this.testData);
        }
Example #2
0
        public void TestInitialise()
        {
            var todoCollection = new ToDoCollection();

            todoCollection.Add(new ToDoTask("Foo1"));
            todoCollection.Add(new ToDoTask("Foo2", false, false));
            this.testData = new ApplicationDatabase();
            PrivateAccessor.SetProperty(this.testData, "BudgetCollectionStorageKey", "Budget.xml");
            PrivateAccessor.SetProperty(this.testData, "FileName", "C:\\Foo\\TestData.bax");
            PrivateAccessor.SetProperty(this.testData, "LedgerBookStorageKey", "Ledger.xml");
            PrivateAccessor.SetProperty(this.testData, "MatchingRulesCollectionStorageKey", "Rules.xml");
            PrivateAccessor.SetProperty(this.testData, "StatementModelStorageKey", "Statement.xml");
            PrivateAccessor.SetProperty(this.testData, "LedgerReconciliationToDoCollection", todoCollection);

            var subject = new Mapper_BudgetAnalyserStorageRoot_ApplicationDatabase();

            this.result = subject.ToDto(this.testData);
        }
        public ToDoCollection ToModel([NotNull] List <ToDoTaskDto> dto)
        {
            if (dto == null)
            {
                throw new ArgumentNullException(nameof(dto));
            }

            var model  = new ToDoCollection();
            var mapper = new Mapper_ToDoTaskDto_ToDoTask();

            dto.ForEach(d => model.Add(mapper.ToModel(d)));
            return(model);
        }