commandlineparser / commandlineparser/commandline
Incorrent argument checks in HeadingInfo.cs
- Linguagem predominante
- C#
- Estrelas
- 4.8k
- Forks
- 478
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
**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`.
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
Start in src/CommandLine/Text/HeadingInfo.cs at the HeadingInfo constructor and WriteMessage method, then inspect how HeadingInfo.Empty creates its object. Done means the argument checks and XML exception documentation consistently reflect the actual arguments and the empty heading behavior.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- csharp
- Domínio
- cli
- Tipo de issue
- Bug
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Status de atividade
- Estagnada
- Clareza
- Claramente especificada
- Facilidade para iniciantes
- 35/100