예제 #1
0
        public async Task Load_ShouldLoadTheXmlFile()
        {
            XamlOnDiskLedgerBookRepository subject = CreateSubject();
            var book = await subject.LoadAsync(LoadFileName, false);

            Assert.IsNotNull(book);
        }
예제 #2
0
        public async Task Load_ShouldCreateBookThatIsValid()
        {
            XamlOnDiskLedgerBookRepository subject = CreateSubject();
            var book = await subject.LoadAsync(LoadFileName, false);

            var builder = new StringBuilder();

            Assert.IsTrue(book.Validate(builder), builder.ToString());
        }
예제 #3
0
        public async Task MustBeAbleToLoadDemoLedgerBookFile()
        {
            XamlOnDiskLedgerBookRepository subject = CreateSubject();

            var book = await subject.LoadAsync(TestDataConstants.DemoLedgerBookFileName, false);

            book.Output(true);
            Assert.IsNotNull(book);
        }
예제 #4
0
        public async Task Load_ShouldCreateBookWithSameNumberOfReconciliations()
        {
            XamlOnDiskLedgerBookRepository subject = CreateSubject();
            var book = await subject.LoadAsync(LoadFileName, false);

            var testData2 = LedgerBookTestData.TestData2();

            Assert.AreEqual(testData2.Reconciliations.Count(), book.Reconciliations.Count());
        }
예제 #5
0
        public async Task Load_ShouldCreateBookWithSameName()
        {
            XamlOnDiskLedgerBookRepository subject = CreateSubject();
            var book = await subject.LoadAsync(LoadFileName, false);

            var testData2 = LedgerBookTestData.TestData2();

            Assert.AreEqual(testData2.Name, book.Name);
        }
예제 #6
0
        public async Task Load_ShouldCreateBookWithFirstLineEqualBankBalances()
        {
            XamlOnDiskLedgerBookRepository subject = CreateSubject();
            var book = await subject.LoadAsync(LoadFileName, false);

            var testData2 = LedgerBookTestData.TestData2();
            var line      = book.Reconciliations.First();

            Assert.AreEqual(testData2.Reconciliations.First().TotalBankBalance, line.TotalBankBalance);
        }
예제 #7
0
        public async Task Load_Output()
        {
            XamlOnDiskLedgerBookRepository subject = CreateSubject();
            var book = await subject.LoadAsync(LoadFileName, false);

            // Visual compare these two - should be the same
            LedgerBookTestData.TestData2().Output();

            book.Output();
        }
예제 #8
0
        public async Task Load_ShouldCreateBookWithFirstLineEqualSurplus()
        {
            XamlOnDiskLedgerBookRepository subject = CreateSubject();
            var book = await subject.LoadAsync(LoadFileName, false);

            book.Output();

            var testData2 = LedgerBookTestData.TestData2();

            testData2.Output();

            var line = book.Reconciliations.First();

            Assert.AreEqual(testData2.Reconciliations.First().CalculatedSurplus, line.CalculatedSurplus);
        }