public async Task Load_ShouldLoadTheXmlFile() { XamlOnDiskLedgerBookRepository subject = CreateSubject(); var book = await subject.LoadAsync(LoadFileName, false); Assert.IsNotNull(book); }
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()); }
public async Task MustBeAbleToLoadDemoLedgerBookFile() { XamlOnDiskLedgerBookRepository subject = CreateSubject(); var book = await subject.LoadAsync(TestDataConstants.DemoLedgerBookFileName, false); book.Output(true); Assert.IsNotNull(book); }
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()); }
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); }
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); }
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(); }
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); }