Add HasFields property to LineParser.
This commit is contained in:
parent
cfbf3c7859
commit
9e0f8a85ae
@ -60,5 +60,14 @@ namespace Tests
|
|||||||
Assert.AreEqual("a , simple ;", lp.Fields[1]);
|
Assert.AreEqual("a , simple ;", lp.Fields[1]);
|
||||||
Assert.AreEqual("line", lp.Fields[2]);
|
Assert.AreEqual("line", lp.Fields[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void ParseLineWithoutFields()
|
||||||
|
{
|
||||||
|
LineParser lp = new LineParser("# no fields");
|
||||||
|
Assert.IsFalse(lp.HasFields);
|
||||||
|
lp.Line = "two fields";
|
||||||
|
Assert.IsTrue(lp.HasFields);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,18 @@ namespace zaaReloaded2.Dictionaries
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string[] Fields { get; private set; }
|
public string[] Fields { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates whether the parsed <see cref="Line"/>
|
||||||
|
/// contains fields.
|
||||||
|
/// </summary>
|
||||||
|
public bool HasFields
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Fields.Length > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
|
Loading…
Reference in New Issue
Block a user