# Testing signals — 2dust/v2rayN

> Canonical page: https://codevetter.com/unpack/v2rayn/testing-signals

# Testing signals — 2dust/v2rayN

Scanned commit 28139853a8087d81e1ac7ffaf7013b937958f5d2 (2026-09-20). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

Tests live exclusively in ServiceLib.Tests and use TUnit (not xUnit/NUnit) with TUnit.Assertions.Should fluent assertions. Coverage concentrates on the pure/parsing layers: Fmt share-URI round-trips, V2ray and sing-box config generation, CoreConfigContextBuilder behavior, HTTP request-header parsing, a regex guard, and CoreManager helpers. The CI test workflow runs 'dotnet test' on ubuntu-latest against .NET 10.x and publishes TRX results to PRs. There are no UI tests for either shell and no tests over SQLite persistence, process spawning, sysproxy, or the updater.
- ServiceLib.Tests targets net10.0 with TUnit + TUnit.Assertions.Should packages and ProjectReference to ServiceLib; tests use [Test] attributes and 'await x.Should().BeEqualTo(...)' assertions. — [v2rayN/ServiceLib.Tests/ServiceLib.Tests.csproj](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/v2rayN/ServiceLib.Tests/ServiceLib.Tests.csproj) [v2rayN/ServiceLib.Tests/Fmt/FmtHandlerTests.cs#L24-43](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/v2rayN/ServiceLib.Tests/Fmt/FmtHandlerTests.cs#L24-L43)
- CI test job (.github/workflows/test.yml) runs only when ServiceLib, ServiceLib.UdpTest, ServiceLib.Tests, Directory.Build.*, Directory.Packages.props, global.json or the workflow itself change — edits confined to v2rayN/ or v2rayN.Desktop/ UI code never trigger tests. — [.github/workflows/test.yml#L3-45](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/.github/workflows/test.yml#L3-L45)
- FmtHandlerTests contains a coverage contract: ShareProfileFactories must match Global.ProtocolShares keys exactly, then every exportable protocol is round-tripped ExportThenImport asserting ConfigType/Address/Port survive — so adding a new protocol without a test fails the suite. — [v2rayN/ServiceLib.Tests/Fmt/FmtHandlerTests.cs#L10-43](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/v2rayN/ServiceLib.Tests/Fmt/FmtHandlerTests.cs#L10-L43) [v2rayN/ServiceLib/Global.cs#L238-250](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/v2rayN/ServiceLib/Global.cs#L238-L250)
- Core config generation has dedicated large suites: CoreConfigV2rayServiceTests (~716 lines) and CoreConfigSingboxServiceTests (~755 lines) plus CoreConfigContextBuilderTests and a shared CoreConfigTestFactory for building test configs. — [v2rayN/ServiceLib.Tests/CoreConfig/V2ray/CoreConfigV2rayServiceTests.cs](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/v2rayN/ServiceLib.Tests/CoreConfig/V2ray/CoreConfigV2rayServiceTests.cs) [v2rayN/ServiceLib.Tests/CoreConfig/Singbox/CoreConfigSingboxServiceTests.cs](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/v2rayN/ServiceLib.Tests/CoreConfig/Singbox/CoreConfigSingboxServiceTests.cs) [v2rayN/ServiceLib.Tests/CoreConfig/Context/CoreConfigContextBuilderTests.cs](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/v2rayN/ServiceLib.Tests/CoreConfig/Context/CoreConfigContextBuilderTests.cs) [v2rayN/ServiceLib.Tests/CoreConfig/CoreConfigTestFactory.cs](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/v2rayN/ServiceLib.Tests/CoreConfig/CoreConfigTestFactory.cs)
- Other covered units: per-Fmt tests (InnerFmtTests, WireguardFmtTests, ShareUriQueryTests, Hysteria2FmtTests, HyRealmTests), HttpRequestHeadersHelperTests, RegexGuardTests, DownloadServiceHeadersTests and CoreManagerTests (which can exercise ShouldRunAsSudo logic). — [v2rayN/ServiceLib.Tests/Fmt/InnerFmtTests.cs](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/v2rayN/ServiceLib.Tests/Fmt/InnerFmtTests.cs) [v2rayN/ServiceLib.Tests/Helper/HttpRequestHeadersHelperTests.cs](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/v2rayN/ServiceLib.Tests/Helper/HttpRequestHeadersHelperTests.cs) [v2rayN/ServiceLib.Tests/Helper/RegexGuardTests.cs](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/v2rayN/ServiceLib.Tests/Helper/RegexGuardTests.cs) [v2rayN/ServiceLib.Tests/Services/DownloadServiceHeadersTests.cs](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/v2rayN/ServiceLib.Tests/Services/DownloadServiceHeadersTests.cs) [v2rayN/ServiceLib.Tests/Manager/CoreManagerTests.cs](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/v2rayN/ServiceLib.Tests/Manager/CoreManagerTests.cs)
- Untested surfaces include both UI shells (no test project references v2rayN or v2rayN.Desktop), SQLite migrations in AppManager.MigrateProfileExtra*, SysProxyHandler/PacManager OS integration, ProcessService/WindowsJobService process lifecycle, AmazTool, and UpdateService download/upgrade — none have test files. — [v2rayN/ServiceLib.Tests/ServiceLib.Tests.csproj](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/v2rayN/ServiceLib.Tests/ServiceLib.Tests.csproj) [v2rayN/ServiceLib/Manager/AppManager.cs#L328-475](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/v2rayN/ServiceLib/Manager/AppManager.cs#L328-L475) [v2rayN/AmazTool/UpgradeApp.cs](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/v2rayN/AmazTool/UpgradeApp.cs)
- ServiceLib.UdpTest is a referenced library project (not a test suite despite the name) providing Socks5UdpChannel used by SpeedtestService for UDP testing. — [v2rayN/ServiceLib/ServiceLib.csproj#L100-102](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/v2rayN/ServiceLib/ServiceLib.csproj#L100-L102) [v2rayN/ServiceLib.UdpTest/Socks5UdpChannel.cs](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/v2rayN/ServiceLib.UdpTest/Socks5UdpChannel.cs) [v2rayN/ServiceLib/Services/SpeedtestService.cs#L1](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/v2rayN/ServiceLib/Services/SpeedtestService.cs#L1)
- Test results are published back to PRs as TRX via EnricoMi/publish-unit-test-result-action with comment_mode 'failures'; the test command is 'dotnet test --project ./v2rayN/ServiceLib.Tests -c Release'. — [.github/workflows/test.yml#L44-52](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/.github/workflows/test.yml#L44-L52)
- No lint/static-analysis workflow exists beyond a CodeFactor badge in the README; there is no code-coverage collection in the test workflow (no coverlet/collector packages in the test csproj). — [README.md#L5](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/README.md#L5) [v2rayN/ServiceLib.Tests/ServiceLib.Tests.csproj](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/v2rayN/ServiceLib.Tests/ServiceLib.Tests.csproj) [.github/workflows/test.yml](https://github.com/2dust/v2rayN/blob/28139853a8087d81e1ac7ffaf7013b937958f5d2/.github/workflows/test.yml)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
