Development
Coming soon. This page will document the local development workflow: building, testing, regenerating FlatBuffers code, and running benchmarks.
Build
# Build the entire solution
dotnet build Virtufin.slnx
# Build in Release mode
dotnet build Virtufin.slnx -c Release
# Build a single project
dotnet build src/Virtufin.Core/Virtufin.Core.csproj
Test
# Run all tests
dotnet test Virtufin.slnx
# Run a single test project
dotnet test tests/Virtufin.Core.Test/Virtufin.Core.Test.csproj
dotnet test tests/Virtufin.Data.Test/Virtufin.Data.Test.csproj
# Run a single test by fully-qualified name
dotnet test tests/Virtufin.Core.Test/Virtufin.Core.Test.csproj \
--filter "FullyQualifiedName=Virtufin.Core.Test.RegistryTest.TestValues"
# Run tests matching a display name pattern
dotnet test Virtufin.slnx --filter "DisplayName~Registry"
# With code coverage (Cobertura format)
dotnet test Virtufin.slnx --collect:"XPlat Code Coverage"
Test framework: xUnit 2.9.3 with FluentAssertions 8.8.0. Always use FluentAssertions style:
value.Should().Be(expected);
result.Should().BeNull();
list.Should().BeEquivalentTo(expected);
Test suite coverage
The test suite covers four dimensions:
| Area | What's tested | Coverage |
|---|---|---|
DecimalAmount arithmetic |
All operators (+, -, *, /), checked overflow, CompareTo, Equals, GetHashCode, ToString round-trip, cross-precision comparisons |
Unit (100+ cases) |
Variant construction & equality |
All 6 cases, implicit conversions (safe and overflow), Equals/GetHashCode, factory vs implicit |
Unit (50+ cases) |
Variant FlatBuffers round-trip |
Serialize → deserialize → equality for every case, cross-language (C# ↔ Python ↔ TypeScript) byte-identical output | Unit + integration |
| Registry (EAV) | Entity registration, value-provider attach, GetValue/GetAllValues with and without providers, null semantics |
Unit (30+ cases) |
DecimalAmount arithmetic uses checked semantics throughout — overflow throws OverflowException, never silently wraps. Round-trip tests verify that a Variant produced on one language's SDK deserializes to an equal value on another.
Regenerate FlatBuffers code
The variant.fbs, cloud_event.fbs, and worker_response.fbs schemas live in src/Virtufin.Data/Schemas/. The C# code is generated into src/Virtufin.Data/Generated/ (gitignored).
# From the repo root
flatc --csharp -o src/Virtufin.Data/Generated \
src/Virtufin.Data/Schemas/variant.fbs
You need flatc installed locally. On macOS: brew install flatbuffers.
Regenerate proto stubs
If the C# protobuf stubs in src/Virtufin.Data/Protos/Generated/ (or similar) are stale, run buf generate (per repo convention).
CI
- Build + test on push to
master(and PRs): runs the full test suite. - Docs lint on
workflow_dispatch: validates that all public types have XML doc comments. - Docs deploy on push to
master(ifdocs/**changed): builds MkDocs, deploys tolib.docs.virtufin.com.
Conventions
See Architecture for the project file conventions and C# style guide.
See also
- Architecture — project structure and dependency direction
- FlatBuffers — schema and codegen
- Core EAV — for examples of the EAV types