-
Notifications
You must be signed in to change notification settings - Fork 0
docs: Add design introduction with software structure and folder layout #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,100 @@ | ||||||||||
| # Introduction | ||||||||||
|
|
||||||||||
| This document provides the detailed design for the FileAssert tool, a .NET command-line application | ||||||||||
| for asserting file properties using YAML-defined test suites. | ||||||||||
|
|
||||||||||
| ## Purpose | ||||||||||
|
|
||||||||||
| The purpose of this document is to describe the internal design of each software unit that comprises | ||||||||||
| FileAssert. It captures data models, algorithms, key methods, and inter-unit interactions at a level | ||||||||||
| of detail sufficient for formal code review, compliance verification, and future maintenance. The | ||||||||||
| document does not restate requirements; it explains how they are realized. | ||||||||||
|
|
||||||||||
| ## Scope | ||||||||||
|
|
||||||||||
| This document covers the detailed design of the following software units: | ||||||||||
|
|
||||||||||
| - **Program** — entry point and execution orchestrator (`Program.cs`) | ||||||||||
| - **Context** — command-line argument parser and I/O owner (`Context.cs`) | ||||||||||
| - **FileAssertConfig** — top-level configuration loader and test runner (`FileAssertConfig.cs`) | ||||||||||
| - **FileAssertData** — YAML data transfer objects for configuration deserialization (`FileAssertData.cs`) | ||||||||||
| - **FileAssertTest** — named test with file assertions and tag filtering (`FileAssertTest.cs`) | ||||||||||
| - **FileAssertFile** — glob pattern matcher with count constraints and content rules (`FileAssertFile.cs`) | ||||||||||
| - **FileAssertRule** — abstract content validation rule hierarchy (`FileAssertRule.cs`) | ||||||||||
| - **PathHelpers** — safe path-combination utility (`PathHelpers.cs`) | ||||||||||
| - **Validation** — self-validation test runner (`Validation.cs`) | ||||||||||
|
|
||||||||||
| The following topics are out of scope: | ||||||||||
|
|
||||||||||
| - External library internals (YamlDotNet, Microsoft.Extensions.FileSystemGlobbing, | ||||||||||
| DemaConsulting.TestResults) | ||||||||||
| - Build pipeline configuration | ||||||||||
| - Deployment and packaging | ||||||||||
|
|
||||||||||
| ## Software Structure | ||||||||||
|
|
||||||||||
| The following tree shows how the FileAssert software items are organized across the system, | ||||||||||
| subsystem, and unit levels: | ||||||||||
|
|
||||||||||
| ```text | ||||||||||
| FileAssert (System) | ||||||||||
| ├── Program (Unit) | ||||||||||
| ├── Cli (Subsystem) | ||||||||||
| │ └── Context (Unit) | ||||||||||
| ├── Configuration (Subsystem) | ||||||||||
| │ ├── FileAssertConfig (Unit) | ||||||||||
| │ └── FileAssertData (Unit) | ||||||||||
| ├── Modeling (Subsystem) | ||||||||||
| │ ├── FileAssertTest (Unit) | ||||||||||
| │ ├── FileAssertFile (Unit) | ||||||||||
| │ └── FileAssertRule (Unit) | ||||||||||
| ├── Utilities (Subsystem) | ||||||||||
| │ └── PathHelpers (Unit) | ||||||||||
| └── SelfTest (Subsystem) | ||||||||||
| └── Validation (Unit) | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| Each unit is described in detail in its own chapter within this document. | ||||||||||
|
|
||||||||||
| ## Folder Layout | ||||||||||
|
|
||||||||||
| The source code folder structure mirrors the top-level subsystem breakdown above, giving | ||||||||||
| reviewers an explicit navigation aid from design to code: | ||||||||||
|
|
||||||||||
|
Comment on lines
+61
to
+63
|
||||||||||
| ```text | ||||||||||
| src/DemaConsulting.FileAssert/ | ||||||||||
| ├── Program.cs — entry point and execution orchestrator | ||||||||||
| ├── Cli/ | ||||||||||
| │ └── Context.cs — command-line argument parser and I/O owner | ||||||||||
| ├── Configuration/ | ||||||||||
| │ ├── FileAssertConfig.cs — top-level configuration loader and test runner | ||||||||||
| │ └── FileAssertData.cs — YAML data transfer objects | ||||||||||
| ├── Modeling/ | ||||||||||
| │ ├── FileAssertTest.cs — named test with file assertions and tag filtering | ||||||||||
| │ ├── FileAssertFile.cs — glob pattern matcher with count constraints and rules | ||||||||||
| │ └── FileAssertRule.cs — abstract content validation rule hierarchy | ||||||||||
| ├── Utilities/ | ||||||||||
| │ └── PathHelpers.cs — safe path-combination utility | ||||||||||
| └── SelfTest/ | ||||||||||
| └── Validation.cs — self-validation test runner | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| The test project mirrors the same layout under `test/DemaConsulting.FileAssert.Tests/`. | ||||||||||
|
||||||||||
| The test project mirrors the same layout under `test/DemaConsulting.FileAssert.Tests/`. | |
| The test project currently uses a flat folder structure under `test/DemaConsulting.FileAssert.Tests/`, with tests organized logically by subsystem but not yet split into `Cli/`, `Configuration/`, `Modeling/`, `Utilities/`, or `SelfTest` subfolders. |
Copilot
AI
Mar 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The “Document Conventions” bullet about unit chapter headings (“overview, data model, methods/algorithms, …”) doesn’t match the existing unit chapters in this doc set, which currently use sections like “Overview”, “Class Structure”, “YAML Configuration”, and “Design Decisions”. Update this convention to reflect the current structure, or adjust the existing chapters to follow the stated structure so the document is internally consistent.
| - Section headings within each unit chapter follow a consistent structure: overview, data model, | |
| methods/algorithms, and interactions with other units. | |
| - Section headings within each unit chapter typically follow a consistent structure using sections | |
| such as **Overview**, **Class Structure**, **YAML Configuration**, and **Design Decisions**. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“Each unit is described in detail in its own chapter within this document” doesn’t match the current document composition:
docs/design/definition.yamlonly includes chapters for rule/file/test/config (not Program/Context/FileAssertData/PathHelpers/Validation). Please either change this to future tense (e.g., “will be described…”) or add stubs/chapters and include them indefinition.yaml.