commandlineparser / commandlineparser/commandline

Incorrent argument checks in HeadingInfo.cs

Aperta
#109 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C#
Stelle
4.8k
Fork
478
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

**Issue by [zii-dmg](https://github.com/zii-dmg)**
_Friday Jan 20, 2017 at 15:30 GMT_
_Originally opened as https://github.com/gsscoder/commandline/issues/408_

----

[Constructor](https://github.com/gsscoder/commandline/blob/master/src/CommandLine/Text/HeadingInfo.cs#L30):
```
public HeadingInfo(string programName, string version = null)
{
if (string.IsNullOrWhiteSpace("programName")) throw new ArgumentException("programName");
```
Passing string `"programName"` instead of argument `programName` value. But HeadingInfo.Empty is creating object with empty string! So I suppose this check should removed and xml comment with exception description.

[WriteMessage](https://github.com/gsscoder/commandline/blob/master/src/CommandLine/Text/HeadingInfo.cs#L104):
```
if (string.IsNullOrWhiteSpace("message")) throw new ArgumentException("message");
```
Same - `"message"` vs `message`.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.