Commit Graph
3 Commits
Author SHA1 Message Date
mostalive b012d0aaa0 em 01: scaffold ExtractMethod tool + Demo fixture
- tools/ExtractMethod: net10.0 console app (Microsoft.CodeAnalysis.CSharp
  5.9.0, pinned latest stable). CLI: <file.cs> <startLine> <endLine>.
  Parses the file, builds a scratch compilation with refs from
  TRUSTED_PLATFORM_ASSEMBLIES, and reports how many whole statements the
  line range covers (clean error otherwise; exit codes: 0 ok, 1
  resolution error, 2 usage).
- Tooling/CompilationLoader: shared parse + compilation path for CLI and
  tests (tests exercise the exact loading path the CLI uses).
- Tooling/SelectionResolver: snaps a 1-based inclusive line range to
  whole statements in the enclosing method body block; boundary checks
  never split a statement; nested/blank-line ranges handled cleanly.
- tests/: ExtractMethod/Fixtures/Demo.cs checked-in fixture exercising
  every bucket of the parent spec (read-only local, written+read-later
  return, scratch local, param read, field+property access, indexer +
  method invocation, multi-statement range incl. a for-loop); excluded
  from project compilation, copied to output as data.
- Tests: Demo.cs compiles with no diagnostics; range 68..72 resolves to
  2 statements (LocalDeclarationStatement, ForStatement); AnalyzeDataFlow
  succeeds on the fixture's for-loop node; mid-statement range fails
  cleanly. 30/30 green.
2026-09-12 15:28:14 +01:00
mostalive c22a1e2ffa Yak: csharp after situation (Yak 02) — plain domain + DTOs + mappers
After/: plain Client/Order (no DbBase), ClientDto/OrderDto records
carrying the relations both ways, hand-written Mappers with a
reference-identity cache for the back-reference cycle, DbContext with
explicit Save(domain) via shadow entities (flipped dependency), and a
WebApp that consumes only DTOs. AfterTests cover the 7 required
behaviours; full solution builds with 0 warnings, 26/26 tests pass.
2026-09-11 15:02:35 +01:00
mostalive 463245288a Yak: csharp before situation (Yak 01) — DB-backed domain classes
Add the C# BEFORE situation: a fake-EF DbContext + DbBase that Client/Order
inherit, the active-record DbContext back-reference (the dependency leak),
navigation fix-up on Client.Orders, and a WebApp that consumes the domain
classes directly. Adds an empty After project so the solution shape is final,
and an xUnit BeforeTests suite covering the required assertions.

- db-subclass-to-dto.sln (classic .sln; SDK 10 defaults to .slnx which breaks run-tests.sh)
- src/Before: DbBase, DbContext, Client (+ClientOrders fix-up), Order, WebApp
- src/After: empty placeholder (filled in Yak 02)
- tests/BeforeAfter.Tests/BeforeTests.cs: 8 tests (7 required + 1 companion)
2026-09-11 13:03:09 +01:00