AccountingNext/Schaad.Accounting.Tests/AccountingAnalysisTestShould.cs
Claudio Schaad 9138f08287 Analyse page: income, net and assets views; narrow-screen layout (#6)
## Summary
Step 4 of the analytics plan, items 2, 4 and 5: **income, net and assets views** on the Analyse page (replacing the old Vermögen chart page) and a **narrow-screen layout** pass.

### Views
A switch at the top selects **Ausgaben | Einnahmen | Netto | Vermögen**, stored in the URL as `view=`. Switching starts the drill-down from the top, because the subclasses differ per view.

- **Einnahmen:** works like Ausgaben. Bookings *from* an income account count positive, bookings *to* one (corrections) negative.
- **Netto:** income minus expenses. Income subclasses are positive and expense subclasses negative.
  - The bar chart stacks income up and expenses down, with a black line for the net result per period; the tooltip total is left out there.
  - Categories are ordered by size, so the big expense groups aren't folded into "Andere".
  - The fourth tile shows the **savings rate** (net / income).
  - No treemap, since areas can't show negative amounts.
- **Vermögen:** month-end balances of the asset accounts (class 1) in CHF. It is a stock, not a flow:
  - A month, quarter or year shows the balance at its end, and the total is the balance at the end of the range.
  - Tiles show that balance, the change since the start of the range (with the opening balance), and the comparison with the same month a year earlier.
  - The year table shows year-end balances; the drill-down ends at the account.
  - The year comparison shows month-end balances, without the cumulative switch.
  - Foreign-currency balances are computed like the balance sheet (`ViewService`): kept in the account currency and converted with `IFxConverter`, which is asked once per currency.
- **Colours follow the view:** more expenses are red; more income, surplus or assets green. The CSS classes are now `worse` / `better` instead of `up` / `down`.

### Code
- `ExpenseAnalysis` → **`AccountingAnalysis`** with `AnalyticsView` (Expenses, Income, Net, Assets), and `GetExpenseAnalysisAsync` → `GetAnalysisAsync`. The running year's last month now comes from all bookings, not just expenses.
- `AnalyticsResult.Opening` gives the balance at the start of the range for Vermögen.
- `charts.js`: the stacked bar chart takes an optional `totalLine`.

### Removed
- The **Vermögen** chart page (`/Assets`) and its menu entry. Plotly is now only used by the booking-text charts on the Transactions page.

### Narrow screens
At 400 px the page was wider than the screen.

- **App-wide:** the side menu took half the screen. It now starts collapsed to icons below 700 px (`wwwroot/js/viewport.js`); the ☰ toggle still opens it. The header dropdowns are narrower, and the app name hides below 520 px.
- **Analyse page:** button groups wrap, the tiles sit two per row, and in the year table the name column is narrower and pinned while the years scroll, with the full name as a tooltip.

## Test plan
- [x] `dotnet build`: no warnings
- [x] `dotnet test`: 88/88 pass, including 7 new `AccountingAnalysisTestShould` tests (income signs, net ordering, month-end balances with opening, balance at period end, FX conversion asked once, comparison at the same month, assets drill-down ends at the account)
- [x] Against a copy of the real data, all matching the app's own reports:
  - Einnahmen 2026 = 109'865.13 ("Total Einkünfte" in the profit-and-loss report)
  - Netto 2026 = 32'859.06 (= 109'865.13 − 77'006.07)
  - Vermögen end of Oct 2026 = 263'994.98 ("Total Aktiven" in the Bilanz)
- [x] Headless Chrome at 400, 820 and 1500 px: no horizontal overflow; menu collapsed at 400 px and expanded at 820 / 1500 px; pinned table column scrolls correctly; all charts render without console errors

## Note on the data (not a code issue)
The Vermögen view shows each year as its books say. In the real data, some closing balances don't match the next year's opening balances. These are probably bookings added to a year after the next one was opened:
- End of 2024 → 2025: Bargeld CHF (+40.75)
- End of 2025 → 2026: Bargeld CHF (+98.50), TKB Privatkonto (+200.00), account 1042 (2'030.40 at the end of 2025, missing in 2026), Durchlaufskonto (−7.29)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Reviewed-on: #6
Co-authored-by: Claudio Schaad <c.schaad@pog.ch>
Co-committed-by: Claudio Schaad <c.schaad@pog.ch>
2026-10-22 16:42:43 +00:00

477 lines
19 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Schaad.Accounting.Datasets.Analytics;
using Schaad.Accounting.Models;
using Schaad.Accounting.Services;
using Shouldly;
namespace Schaad.Accounting.Tests;
public class AccountingAnalysisTestShould
{
private static readonly Account Bank = new() { Id = "bank", Number = 1020, Name = "Bank" };
private static readonly Account Salary = new() { Id = "salary", Number = 3000, Name = "Lohn" };
private static readonly Account Food = new() { Id = "food", Number = 4000, Name = "Lebensmittel" };
private static readonly Account Restaurant = new() { Id = "restaurant", Number = 4010, Name = "Restaurant" };
private static readonly Account Rent = new() { Id = "rent", Number = 4100, Name = "Miete" };
private static readonly SubClass[] SubClasses =
[
new() { Number = 10, Name = "Bargeld, Konten" },
new() { Number = 30, Name = "Lohn" },
new() { Number = 40, Name = "Verpflegung" },
new() { Number = 41, Name = "Wohnen" }
];
private static Transaction Booking(string date, Account from, Account to, decimal value, string text = "Text") => new()
{
ValueDate = DateTime.Parse(date),
OriginAccountId = from.Id,
TargetAccountId = to.Id,
Value = value,
Text = text
};
private static YearData Year(int year, params Transaction[] transactions)
=> new(year, [Bank, Salary, Food, Restaurant, Rent], SubClasses, transactions);
private static AnalyticsQuery Query(int from, int to, AnalyticsNode? node = null, AnalyticsPeriod period = AnalyticsPeriod.Month)
=> new(from, to, period, node ?? AnalyticsNode.All);
[Fact]
public void SumExpensesPerSubClassWhenQueryingAll()
{
var sut = new AccountingAnalysis([Year(2025,
Booking("2025-01-10", Bank, Food, 100),
Booking("2025-01-20", Bank, Restaurant, 50),
Booking("2025-02-01", Bank, Rent, 1000))]);
var result = sut.Query(Query(2025, 2025));
result.Total.ShouldBe(1150);
result.Categories.Select(c => (c.Name, c.Total)).ShouldBe([("Wohnen", 1000m), ("Verpflegung", 150m)]);
result.Categories[0].Node.ShouldBe(new AnalyticsNode(SubClass: 41));
result.Categories[0].Share.ShouldBe(1000m / 1150m);
}
[Fact]
public void SubtractRefundsWhenSummingExpenses()
{
var sut = new AccountingAnalysis([Year(2025,
Booking("2025-01-10", Bank, Food, 100),
Booking("2025-01-15", Food, Bank, 30))]);
var result = sut.Query(Query(2025, 2025));
result.Total.ShouldBe(70);
}
[Fact]
public void IgnoreBookingsWithoutExpenseAccountWhenQuerying()
{
var sut = new AccountingAnalysis([Year(2025,
Booking("2025-01-25", Salary, Bank, 5000),
Booking("2025-01-26", Bank, Food, 100))]);
var result = sut.Query(Query(2025, 2025));
result.Total.ShouldBe(100);
}
[Fact]
public void CancelTransfersWithinSubClassWhenQueryingAll()
{
// Reclassifying 20 from food to restaurant changes neither the total nor the subclass.
var sut = new AccountingAnalysis([Year(2025,
Booking("2025-01-10", Bank, Food, 100),
Booking("2025-01-11", Food, Restaurant, 20))]);
var all = sut.Query(Query(2025, 2025));
var subClass = sut.Query(Query(2025, 2025, new AnalyticsNode(SubClass: 40)));
all.Total.ShouldBe(100);
all.Categories.Single().Total.ShouldBe(100);
subClass.Categories.Select(c => (c.Name, c.Total)).ShouldBe([("Lebensmittel", 80m), ("Restaurant", 20m)]);
}
[Fact]
public void GroupAccountsByNumberWithLatestNameWhenAccountChangedOverYears()
{
var oldRent = new Account { Id = "rent-old-id", Number = 4100, Name = "Miete alt" };
var sut = new AccountingAnalysis(
[
new YearData(2024, [Bank, oldRent], SubClasses, [Booking("2024-03-01", Bank, oldRent, 900)]),
Year(2025, Booking("2025-03-01", Bank, Rent, 1000))
]);
var result = sut.Query(Query(2024, 2025, new AnalyticsNode(SubClass: 41)));
result.Categories.Single().Name.ShouldBe("Miete");
result.Categories.Single().Total.ShouldBe(1900);
}
[Fact]
public void ShowBookingTextGroupsWhenDrillingIntoAccount()
{
var sut = new AccountingAnalysis([Year(2025,
Booking("2025-01-10", Bank, Food, 100, "Migros Zürich"),
Booking("2025-01-11", Bank, Food, 40, "Migros Bern"),
Booking("2025-01-12", Bank, Food, 30, "Coop"))]);
var result = sut.Query(Query(2025, 2025, new AnalyticsNode(SubClass: 40, Account: 4000)));
result.Categories.Select(c => (c.Name, c.Total)).ShouldBe([("Migros", 140m), ("Coop", 30m)]);
result.Categories[0].Node.ShouldBe(new AnalyticsNode(40, 4000, "Migros"));
result.Categories.ShouldAllBe(c => c.CanDrillDown == false);
}
[Fact]
public void ReturnItselfAsOnlyCategoryWhenQueryingBookingTextGroup()
{
var node = new AnalyticsNode(40, 4000, "Migros");
var sut = new AccountingAnalysis([Year(2025,
Booking("2025-01-10", Bank, Food, 100, "Migros"),
Booking("2025-01-12", Bank, Food, 30, "Coop"))]);
var result = sut.Query(Query(2025, 2025, node));
result.Categories.Single().Node.ShouldBe(node);
result.Total.ShouldBe(100);
}
[Fact]
public void BuildBreadcrumbWithNamesWhenQueryingBookingTextGroup()
{
var sut = new AccountingAnalysis([Year(2025, Booking("2025-01-10", Bank, Food, 100, "Migros"))]);
var result = sut.Query(Query(2025, 2025, new AnalyticsNode(40, 4000, "Migros")));
result.Breadcrumb.Select(b => b.Name).ShouldBe(["Ausgaben", "Verpflegung", "Lebensmittel", "Migros"]);
result.Breadcrumb[2].Node.ShouldBe(new AnalyticsNode(40, 4000));
}
[Fact]
public void CountBookingsInTheirBookYearWhenDatedOutsideIt()
{
var sut = new AccountingAnalysis(
[
Year(2024, Booking("2023-12-29", Bank, Food, 10), Booking("2025-01-02", Bank, Food, 20)),
Year(2025, Booking("2025-03-10", Bank, Food, 30))
]);
var result = sut.Query(Query(2024, 2025, period: AnalyticsPeriod.Month));
result.Total.ShouldBe(60);
var values = result.Categories.Single().Values;
values[0].ShouldBe(10); // Jan 2024
values[11].ShouldBe(20); // Dec 2024
values[14].ShouldBe(30); // Mar 2025
}
[Fact]
public void StopAtLastMonthWithDataWhenRangeIncludesRunningYear()
{
var sut = new AccountingAnalysis([Year(2026,
Booking("2026-01-10", Bank, Food, 100),
Booking("2026-03-10", Bank, Food, 200))]);
var result = sut.Query(Query(2026, 2026));
result.Periods.ShouldBe([new DateOnly(2026, 1, 1), new DateOnly(2026, 2, 1), new DateOnly(2026, 3, 1)]);
result.Categories.Single().Values.ShouldBe([100m, 0m, 200m]);
result.Months.ShouldBe(3);
result.AveragePerMonth.ShouldBe(100);
}
[Fact]
public void SumIntoQuartersAndYearsWhenPeriodIsCoarser()
{
var sut = new AccountingAnalysis(
[
Year(2024, Booking("2024-02-10", Bank, Food, 10), Booking("2024-11-10", Bank, Food, 20)),
Year(2025, Booking("2025-05-10", Bank, Food, 30), Booking("2025-12-10", Bank, Food, 40))
]);
var quarters = sut.Query(Query(2024, 2025, period: AnalyticsPeriod.Quarter));
var years = sut.Query(Query(2024, 2025, period: AnalyticsPeriod.Year));
quarters.Periods.Count.ShouldBe(8);
quarters.Categories.Single().Values.ShouldBe([10m, 0m, 0m, 20m, 0m, 30m, 0m, 40m]);
years.Periods.ShouldBe([new DateOnly(2024, 1, 1), new DateOnly(2025, 1, 1)]);
years.Categories.Single().Values.ShouldBe([30m, 70m]);
}
[Fact]
public void LeaveOutYearsOutsideRangeWhenQuerying()
{
var sut = new AccountingAnalysis(
[
Year(2024, Booking("2024-02-10", Bank, Food, 10)),
Year(2025, Booking("2025-02-10", Bank, Food, 30))
]);
var result = sut.Query(Query(2025, 2025));
result.Total.ShouldBe(30);
result.Months.ShouldBe(2);
}
[Fact]
public void CompareSameMonthsOfPreviousYearWhenYearIsRunning()
{
var sut = new AccountingAnalysis(
[
Year(2025, Booking("2025-01-10", Bank, Food, 100), Booking("2025-09-10", Bank, Food, 500)),
Year(2026, Booking("2026-01-10", Bank, Food, 150), Booking("2026-02-10", Bank, Food, 50))
]);
// Range is 2026 only, but the comparison still looks at 2025.
var comparison = sut.Query(Query(2026, 2026)).Comparison;
comparison.ShouldNotBeNull();
comparison.Year.ShouldBe(2026);
comparison.Months.ShouldBe(2);
comparison.Current.ShouldBe(200);
comparison.Previous.ShouldBe(100);
comparison.ChangePercent.ShouldBe(100);
}
[Fact]
public void ReturnNoComparisonWhenPreviousYearHasNoData()
{
var sut = new AccountingAnalysis([Year(2025, Booking("2025-01-10", Bank, Food, 100))]);
sut.Query(Query(2025, 2025)).Comparison.ShouldBeNull();
}
[Fact]
public void ReturnEmptyResultWhenThereIsNoData()
{
var sut = new AccountingAnalysis([]);
var result = sut.Query(Query(2025, 2025));
sut.Years.ShouldBeEmpty();
result.Total.ShouldBe(0);
result.Categories.ShouldBeEmpty();
result.Periods.Count.ShouldBe(12);
}
[Fact]
public void LeaveMonthsWithoutDataEmptyWhenBuildingYearProfiles()
{
var sut = new AccountingAnalysis(
[
Year(2025, Booking("2025-01-10", Bank, Food, 100), Booking("2025-12-10", Bank, Food, 50)),
Year(2026, Booking("2026-02-10", Bank, Food, 70))
]);
var profiles = sut.Query(Query(2025, 2026)).YearProfiles;
profiles.Select(p => p.Year).ShouldBe([2025, 2026]);
profiles[0].Months.Count.ShouldBe(12);
profiles[0].Months[0].ShouldBe(100);
profiles[0].Months[1].ShouldBe(0);
profiles[0].Total.ShouldBe(150);
profiles[1].Months[0].ShouldBe(0);
profiles[1].Months[1].ShouldBe(70);
profiles[1].Months[2].ShouldBeNull();
}
[Fact]
public void CompareSameMonthsWithPreviousYearWhenBuildingCategoryYears()
{
var sut = new AccountingAnalysis(
[
Year(2024, Booking("2024-01-10", Bank, Food, 100), Booking("2024-06-10", Bank, Rent, 400)),
Year(2025, Booking("2025-01-10", Bank, Food, 150), Booking("2025-06-10", Bank, Rent, 500), Booking("2025-11-10", Bank, Rent, 999)),
Year(2026, Booking("2026-01-10", Bank, Food, 120), Booking("2026-02-10", Bank, Rent, 300))
]);
// Range starts in 2025, so 2025's change still compares with 2024.
var rows = sut.Query(Query(2025, 2026)).CategoryYears;
var food = rows.Single(r => r.Name == "Verpflegung");
food.Cells.Select(c => (c.Year, c.Value)).ShouldBe([(2025, 150m), (2026, 120m)]);
food.Cells[0].ChangePercent.ShouldBe(50);
food.Cells[1].ChangePercent.ShouldBe(-20); // Jan–Feb 2026 vs. Jan–Feb 2025
var rent = rows.Single(r => r.Name == "Wohnen");
rent.Cells[1].Value.ShouldBe(300);
rent.Cells[1].ChangePercent.ShouldBeNull(); // nothing in Jan–Feb 2025
rows.Select(r => r.Node).ShouldBe(sut.Query(Query(2025, 2026)).Categories.Select(c => c.Node));
}
[Fact]
public void ReturnNoChangeWhenYearBeforeHasNoData()
{
var sut = new AccountingAnalysis([Year(2025, Booking("2025-01-10", Bank, Food, 100))]);
sut.Query(Query(2025, 2025)).CategoryYears.Single().Cells.Single().ChangePercent.ShouldBeNull();
}
[Fact]
public void NestAccountsInSubClassesWhenBuildingComposition()
{
var sut = new AccountingAnalysis([Year(2025,
Booking("2025-01-10", Bank, Food, 100),
Booking("2025-01-11", Bank, Restaurant, 40),
Booking("2025-01-12", Bank, Rent, 1000))]);
var items = sut.Query(Query(2025, 2025)).Composition;
items.Select(i => (i.ParentName, i.ChildName, i.Value)).ShouldBe(
[
("Wohnen", "Miete", 1000m),
("Verpflegung", "Lebensmittel", 100m),
("Verpflegung", "Restaurant", 40m)
]);
items[1].Child.ShouldBe(new AnalyticsNode(40, 4000));
}
[Fact]
public void UseSingleLevelWhenBuildingCompositionForAccount()
{
var sut = new AccountingAnalysis([Year(2025,
Booking("2025-01-10", Bank, Food, 100, "Migros"),
Booking("2025-01-11", Bank, Food, 30, "Coop"))]);
var items = sut.Query(Query(2025, 2025, new AnalyticsNode(40, 4000))).Composition;
items.Select(i => (i.ParentName, i.Child, i.Value)).ShouldBe([("Migros", (AnalyticsNode?)null, 100m), ("Coop", null, 30m)]);
}
[Fact]
public void LeaveOutNegativeAmountsWhenBuildingComposition()
{
var sut = new AccountingAnalysis([Year(2025,
Booking("2025-01-10", Bank, Food, 100),
Booking("2025-01-11", Restaurant, Bank, 40))]);
var items = sut.Query(Query(2025, 2025, new AnalyticsNode(SubClass: 40))).Composition;
items.Single().ParentName.ShouldBe("Lebensmittel");
}
private static AnalyticsQuery ViewQuery(AnalyticsView view, int from, int to, AnalyticsNode? node = null, AnalyticsPeriod period = AnalyticsPeriod.Month)
=> new(from, to, period, node ?? AnalyticsNode.All, view);
[Fact]
public void CountBookingsFromIncomeAccountsWhenViewIsIncome()
{
var sut = new AccountingAnalysis([Year(2025,
Booking("2025-01-25", Salary, Bank, 5000),
Booking("2025-02-01", Bank, Salary, 200),
Booking("2025-02-10", Bank, Food, 100))]);
var result = sut.Query(ViewQuery(AnalyticsView.Income, 2025, 2025));
result.Total.ShouldBe(4800);
result.Breadcrumb.Single().Name.ShouldBe("Einnahmen");
result.Categories.Single().Node.ShouldBe(new AnalyticsNode(SubClass: 30));
}
[Fact]
public void SubtractExpensesFromIncomeWhenViewIsNet()
{
var sut = new AccountingAnalysis([Year(2025,
Booking("2025-01-25", Salary, Bank, 5000),
Booking("2025-01-26", Bank, Food, 100),
Booking("2025-02-01", Bank, Rent, 1000))]);
var result = sut.Query(ViewQuery(AnalyticsView.Net, 2025, 2025));
result.Total.ShouldBe(3900);
// Ordered by size, so big expenses aren't folded into "Andere".
result.Categories.Select(c => (c.Name, c.Total)).ShouldBe([("Lohn", 5000m), ("Wohnen", -1000m), ("Verpflegung", -100m)]);
result.Categories[2].Values.ShouldBe([-100m, 0m]);
}
private static readonly Account Savings = new() { Id = "savings", Number = 1030, Name = "Sparkonto", StartBalance = 1000 };
private static readonly Account Euro = new() { Id = "euro", Number = 1001, Name = "Bargeld EUR", Currency = "EUR", StartBalance = 100 };
private static YearData AssetYear(int year, decimal savingsStart, params Transaction[] transactions)
=> new(year,
[Bank, Salary, Food, new Account { Id = Savings.Id, Number = Savings.Number, Name = Savings.Name, StartBalance = savingsStart }, Euro],
SubClasses,
transactions);
[Fact]
public void ReturnMonthEndBalancesWhenViewIsAssets()
{
var sut = new AccountingAnalysis([AssetYear(2025, 1000,
Booking("2025-01-25", Salary, Savings, 500),
Booking("2025-03-10", Savings, Food, 200))]);
var result = sut.Query(new AnalyticsQuery(2025, 2025, AnalyticsPeriod.Month, new AnalyticsNode(SubClass: 10), AnalyticsView.Assets));
var savings = result.Categories.Single(c => c.Name == "Sparkonto");
savings.Values.ShouldBe([1500m, 1500m, 1300m]);
savings.Total.ShouldBe(1300);
savings.CanDrillDown.ShouldBeFalse();
result.Opening.ShouldBe(1100); // 1000 savings + 100 EUR at a rate of 1
}
[Fact]
public void TakeBalanceAtPeriodEndWhenSummingAssetsByQuarter()
{
var sut = new AccountingAnalysis([AssetYear(2025, 1000,
Booking("2025-01-25", Salary, Savings, 500),
Booking("2025-05-10", Savings, Food, 200),
Booking("2025-07-10", Salary, Bank, 1))]);
var result = sut.Query(new AnalyticsQuery(2025, 2025, AnalyticsPeriod.Quarter, new AnalyticsNode(10, 1030), AnalyticsView.Assets));
// Q1 ends with 1500, Q2 with 1300; Q3 is cut off at July, the last month with data.
result.Categories.Single().Values.ShouldBe([1500m, 1300m, 1300m]);
result.Total.ShouldBe(1300);
}
private static Transaction WithFxRate(Transaction transaction, decimal fxRate)
{
transaction.FxRate = fxRate;
return transaction;
}
[Fact]
public void ConvertForeignBalancesOnceWhenViewIsAssets()
{
var asked = new List<string>();
var sut = new AccountingAnalysis(
[AssetYear(2025, 0, WithFxRate(Booking("2025-02-01", Bank, Euro, 93, "Wechsel"), 0.93m))],
currency => { asked.Add(currency); return 0.9m; });
var result = sut.Query(new AnalyticsQuery(2025, 2025, AnalyticsPeriod.Month, new AnalyticsNode(10, 1001), AnalyticsView.Assets));
// 100 EUR opening + 93 CHF booked at 0.93 = 200 EUR, at 0.9 CHF per EUR.
result.Total.ShouldBe(180);
asked.ShouldBe(["EUR"]);
}
[Fact]
public void CompareBalancesAtSameMonthWhenViewIsAssets()
{
var sut = new AccountingAnalysis(
[
AssetYear(2025, 1000, Booking("2025-02-10", Salary, Savings, 100), Booking("2025-11-10", Salary, Savings, 900)),
AssetYear(2026, 2000, Booking("2026-02-10", Salary, Savings, 300))
]);
var result = sut.Query(new AnalyticsQuery(2025, 2026, AnalyticsPeriod.Year, new AnalyticsNode(10, 1030), AnalyticsView.Assets));
result.Comparison.ShouldNotBeNull();
result.Comparison.Current.ShouldBe(2300); // Feb 2026
result.Comparison.Previous.ShouldBe(1100); // Feb 2025, not Dec
result.YearProfiles.Select(p => p.Total).ShouldBe([2000m, 2300m]);
result.CategoryYears.Single().Cells.Select(c => c.Value).ShouldBe([2000m, 2300m]);
}
[Fact]
public void StopAtAccountWhenDrillingIntoAssets()
{
var sut = new AccountingAnalysis([AssetYear(2025, 1000, Booking("2025-01-25", Salary, Savings, 500, "Lohn Januar"))]);
var result = sut.Query(new AnalyticsQuery(2025, 2025, AnalyticsPeriod.Month, new AnalyticsNode(10, 1030, "Lohn"), AnalyticsView.Assets));
result.Breadcrumb.Select(b => b.Name).ShouldBe(["Vermögen", "Bargeld, Konten", "Sparkonto"]);
result.Categories.Single().Node.ShouldBe(new AnalyticsNode(10, 1030));
result.Composition.Single().Child.ShouldBeNull();
}
}