All rules

Uncaught Exception Path

Fires when throw new is added without a corresponding Assert.Throws or Should().Throw assertion in the test suite.

Why this rule exists

An exception added without a test is a contract change with no safety net. Callers that relied on the old behavior break silently; future refactors cannot tell whether the throw is intentional.

Code example

Triggers the rule
+ if (amount < 0) throw new ArgumentOutOfRangeException(nameof(amount));
  // no test added
Passes the rule
+ if (amount < 0) throw new ArgumentOutOfRangeException(nameof(amount));
+ // tests/PaymentTests.cs
+ [Fact] public void Charge_NegativeAmount_Throws() =>
+     Assert.Throws<ArgumentOutOfRangeException>(() => svc.Charge(-1));

Configuration

Disable or adjust the severity of this rule in .gauntletci.json:

{
  "rules": {
    "GCI0032": { "enabled": true, "severity": "Warn" }
  }
}

See Configuration for the full schema.

Related rules

Discussed in

Implemented in src/GauntletCI.Core/Rules/Implementations/GCI0032_*.cs.

About the author

Eric Cogen -- Founder, GauntletCI

Twenty years as a senior technical consultant building and modernizing enterprise platforms across .NET, AWS, serverless, microservices, and AI-driven systems.