Fix the existing tests.

This commit is contained in:
GlenCFL
2017-12-07 11:57:36 -05:00
parent 342487f800
commit e5bd994164
2 changed files with 34 additions and 23 deletions

View File

@@ -223,26 +223,20 @@ namespace Filtration.Parser.Services
RemoveExistingBlockItemsOfType<SoundBlockItem>(block);
RemoveExistingBlockItemsOfType<PositionalSoundBlockItem>(block);
var match = Regex.Match(trimmedLine, @"\S+\s+(\S+)\s+(\d+)?");
var match = Regex.Match(trimmedLine, @"\S+\s+(\S+)\s?(\d+)?");
if (match.Success)
{
string firstValue;
string firstValue = match.Groups[1].Value;
int secondValue;
if (match.Groups.Count == 2)
if (match.Groups[2].Success)
{
firstValue = match.Groups[1].Value;
secondValue = 79;
}
else if (match.Groups.Count == 3)
{
firstValue = match.Groups[1].Value;
secondValue = Convert.ToInt16(match.Groups[2].Value);
}
else
{
break;
secondValue = 79;
}
if (lineOption == "PlayAlertSound")