Skip to content

Lab5 architecture rules#41

Open
slavik22 wants to merge 19 commits into
lenagrin:masterfrom
slavik22:lab5
Open

Lab5 architecture rules#41
slavik22 wants to merge 19 commits into
lenagrin:masterfrom
slavik22:lab5

Conversation

@slavik22
Copy link
Copy Markdown

Screenshot 2026-05-24 at 13 10 07

Lab 5 — Architecture Rules (NetArchTest)

Goal: enforce layer dependency rules via automated tests that break the build on violations.


Changes

Added NetArchTest.Rules package to NetSdrClientAppTests.csproj

Added ArchitectureTests.cs with 4 rules:

Rule What it checks
Messages_Should_Not_Depend_On_Networking Messages layer (protocol encoding) must not reference Networking
Networking_Should_Not_Depend_On_Messages Networking layer (TCP/UDP transport) must not reference Messages
Networking_Interfaces_Should_Start_With_I Interface naming convention in Networking namespace
Networking_Types_Should_Be_Public All types in Networking are part of the public injection contract

Red → Green flow

Commit 13ff71f (RED) — added MessageDispatcher.cs inside NetSdrClientApp.Messages that depends on ITcpClient from NetSdrClientApp.Networking, violating Rule 1:

Failed Messages_Should_Not_Depend_On_Networking — 1 failed / 17 total

Commit 7d8aba5 (GREEN) — removed MessageDispatcher.cs:

Passed — 17 / 17

Enforced dependency structure

NetSdrClientApp.Messages    →  no dependency on Networking  ✅
NetSdrClientApp.Networking  →  no dependency on Messages    ✅
NetSdrClientApp (root)      →  may depend on both           ✅

@slavik22 slavik22 changed the title Lab5 Lab5 Architecture rules May 24, 2026
@slavik22 slavik22 changed the title Lab5 Architecture rules Lab5 architecture rules May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant