rspec/rules/S2302/compliant.adoc
2022-02-04 16:28:24 +00:00

17 lines
319 B
Plaintext

== Compliant Solution
[source,text]
----
void DoSomething(int someParameter)
{
if (someParameter < 0)
{
throw new ArgumentException("Bad argument", nameof(someParameter));
}
if (anotherParam == null)
{
throw new Exception($"{nameof(anotherParam)} should not be null");
}
}
----