Skip to content

Commit c35d2ca

Browse files
committed
Corrected dictionary type in tests and readme
1 parent 5714eab commit c35d2ca

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ Operands
182182
## Parsing
183183

184184
Argument key-value pairs can be parsed from any string using the ```Parse(string)``` method. This method returns a
185-
```Dictionary<string, string>``` containing all argument-value pairs.
185+
```Dictionary<string, object>``` containing all argument-value pairs.
186186

187187
If the string parameter is omitted, the value of ```Environment.CommandLine``` is used.
188188

@@ -192,7 +192,7 @@ from property handling quoted strings. There are generally very few instance in
192192
#### Example
193193

194194
```c#
195-
Dictionary<string, string> args = Arguments.Parse("-ab --foo bar");
195+
Dictionary<string, object> args = Arguments.Parse("-ab --foo bar");
196196
```
197197

198198
The example above would result in a dictionary ```args``` containing:

Utility.CommandLine.Arguments.Tests/Arguments.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public void Indexer()
162162
[Fact]
163163
public void Parse()
164164
{
165-
Dictionary<string, string> test = CommandLine.Arguments.Parse().ArgumentDictionary;
165+
Dictionary<string, object> test = CommandLine.Arguments.Parse().ArgumentDictionary;
166166

167167
Assert.NotEmpty(test);
168168
}
@@ -174,7 +174,7 @@ public void Parse()
174174
[Fact]
175175
public void ParseCaseSensitive()
176176
{
177-
Dictionary<string, string> test = CommandLine.Arguments.Parse("--TEST -aBc").ArgumentDictionary;
177+
Dictionary<string, object> test = CommandLine.Arguments.Parse("--TEST -aBc").ArgumentDictionary;
178178

179179
Assert.True(test.ContainsKey("TEST"));
180180
Assert.False(test.ContainsKey("test"));
@@ -219,7 +219,7 @@ public void ParseEmpty()
219219
[Fact]
220220
public void ParseInnerQuotedStrings()
221221
{
222-
Dictionary<string, string> test = CommandLine.Arguments.Parse("--test1 \"test \'1\'\" --test2 \'test \"2\"\'").ArgumentDictionary;
222+
Dictionary<string, object> test = CommandLine.Arguments.Parse("--test1 \"test \'1\'\" --test2 \'test \"2\"\'").ArgumentDictionary;
223223

224224
Assert.Equal("test \'1\'", test["test1"]);
225225
Assert.Equal("test \"2\"", test["test2"]);
@@ -232,7 +232,7 @@ public void ParseInnerQuotedStrings()
232232
[Fact]
233233
public void ParseLongAndShortMix()
234234
{
235-
Dictionary<string, string> test = CommandLine.Arguments.Parse("--one=1 -ab 2 /three:3 -4 4").ArgumentDictionary;
235+
Dictionary<string, object> test = CommandLine.Arguments.Parse("--one=1 -ab 2 /three:3 -4 4").ArgumentDictionary;
236236

237237
Assert.Equal("1", test["one"]);
238238
Assert.True(test.ContainsKey("a"));
@@ -262,7 +262,7 @@ public void ParseMixedArgumentsAndOperands()
262262
[Fact]
263263
public void ParseMultipleQuotes()
264264
{
265-
Dictionary<string, string> test = CommandLine.Arguments.Parse("--test1 \"1\" --test2 \"2\" --test3 \'3\' --test4 \'4\'").ArgumentDictionary;
265+
Dictionary<string, object> test = CommandLine.Arguments.Parse("--test1 \"1\" --test2 \"2\" --test3 \'3\' --test4 \'4\'").ArgumentDictionary;
266266

267267
Assert.Equal("1", test["test1"]);
268268
Assert.Equal("2", test["test2"]);
@@ -328,7 +328,7 @@ public void ParseOperands()
328328
[Fact]
329329
public void ParseShorts()
330330
{
331-
Dictionary<string, string> test = CommandLine.Arguments.Parse("-abc 'hello world'").ArgumentDictionary;
331+
Dictionary<string, object> test = CommandLine.Arguments.Parse("-abc 'hello world'").ArgumentDictionary;
332332

333333
Assert.True(test.ContainsKey("a"));
334334
Assert.Equal(string.Empty, test["a"]);
@@ -420,7 +420,7 @@ public void ParseStrictOperandsStart()
420420
[Fact]
421421
public void ParseStringOfLongs()
422422
{
423-
Dictionary<string, string> test = CommandLine.Arguments.Parse("--one 1 --two=2 /three:3 --four \"4 4\" --five='5 5'").ArgumentDictionary;
423+
Dictionary<string, object> test = CommandLine.Arguments.Parse("--one 1 --two=2 /three:3 --four \"4 4\" --five='5 5'").ArgumentDictionary;
424424

425425
Assert.NotEmpty(test);
426426
Assert.Equal(5, test.Count);
@@ -438,7 +438,7 @@ public void ParseStringOfLongs()
438438
[Fact]
439439
public void ParseValueWithQuotedPeriod()
440440
{
441-
Dictionary<string, string> test = CommandLine.Arguments.Parse("--test \"test.test\" --test2 'test2.test2'").ArgumentDictionary;
441+
Dictionary<string, object> test = CommandLine.Arguments.Parse("--test \"test.test\" --test2 'test2.test2'").ArgumentDictionary;
442442

443443
Assert.Equal("test.test", test["test"]);
444444
Assert.Equal("test2.test2", test["test2"]);
@@ -477,7 +477,7 @@ public void PopulateCaseSensitive()
477477
[Fact]
478478
public void PopulateDictionary()
479479
{
480-
Dictionary<string, string> dict = new Dictionary<string, string>();
480+
Dictionary<string, object> dict = new Dictionary<string, object>();
481481
dict.Add("i", "1");
482482

483483
CommandLine.Arguments.Populate(dict);

0 commit comments

Comments
 (0)