rspec/rules/S2302/compliant.adoc

16 lines
305 B
Plaintext
Raw Normal View History

2020-06-30 12:48:07 +02:00
== Compliant Solution
----
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");
}
}
----