Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ ReqStream/
- `Assert.HasCount(collection, expectedCount)` instead of `Assert.AreEqual(count, collection.Count)`
- `Assert.IsEmpty(collection)` instead of `Assert.AreEqual(0, collection.Count)`
- `Assert.DoesNotContain(item, collection)` for negative checks
- `Assert.StartsWith("prefix", value)` instead of `Assert.IsTrue(value.StartsWith("prefix"))`
Comment thread
Malcolmnixon marked this conversation as resolved.
Outdated
- **Console Testing**: Save and restore `Console.Out` in tests that modify console output:

```csharp
Expand Down
3 changes: 3 additions & 0 deletions src/DemaConsulting.ReqStream/Context.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ private Context()
/// <exception cref="ArgumentException">Thrown when arguments are invalid.</exception>
public static Context Create(string[] args)
{
// Validate input
ArgumentNullException.ThrowIfNull(args);

// Initialize flag variables
var version = false;
var help = false;
Expand Down
16 changes: 14 additions & 2 deletions src/DemaConsulting.ReqStream/DemaConsulting.ReqStream.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<LangVersion>12</LangVersion>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down Expand Up @@ -50,13 +50,25 @@
<PackageReference Include="DemaConsulting.TestResults" Version="1.5.0" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="10.0.3" />
<PackageReference Include="YamlDotNet" Version="16.3.0" />
<!-- PrivateAssets="All" prevents these build-time-only packages from becoming transitive dependencies -->
<PackageReference Include="Microsoft.Sbom.Targets" Version="4.1.5" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.103" PrivateAssets="All" />
<!--
Analyzer and source-only packages require both PrivateAssets and IncludeAssets:
PrivateAssets="all" - prevents these build-time assets from flowing to consumers
IncludeAssets - explicitly enables contentfiles (source injection) and
analyzers/buildtransitive (Roslyn analyzers at compile time)
-->
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="10.0.103">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.19.0.132793">
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.20.0.135146">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<!-- Polyfill is a source-only package; contentfiles delivers the polyfill source into this project -->
<PackageReference Include="Polyfill" Version="9.12.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
3 changes: 3 additions & 0 deletions src/DemaConsulting.ReqStream/Validation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public static class Validation
/// <param name="context">The context containing command line arguments and program state.</param>
public static void Run(Context context)
{
// Validate input
ArgumentNullException.ThrowIfNull(context);

// Print validation header
PrintValidationHeader(context);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="MSTest.TestAdapter" Version="4.1.0" />
<PackageReference Include="MSTest.TestFramework" Version="4.1.0" />
</ItemGroup>
Expand All @@ -35,14 +35,16 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.19.0.132793">
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.20.0.135146">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<!-- Implicit Usings -->
<ItemGroup>
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
<Using Include="Polyfills" />
</ItemGroup>

<!-- Project References -->
Expand Down