Fixup after merging missed commit from master

This commit is contained in:
Ben Wallis 2018-09-28 17:58:16 +01:00
commit 7d8b32b2e7
3 changed files with 758 additions and 678 deletions

View File

@ -1308,6 +1308,86 @@ namespace Filtration.Parser.Tests.Services
Assert.AreEqual(ItemRarity.Magic, (ItemRarity)rarityBlockItem.FilterPredicate.PredicateOperand); Assert.AreEqual(ItemRarity.Magic, (ItemRarity)rarityBlockItem.FilterPredicate.PredicateOperand);
} }
[Test]
public void TranslateStringToItemFilterBlock_CustomSoundDocumentsFile()
{
// Arrange
var inputString = @"Show" + Environment.NewLine +
"CustomAlertSound \"test.mp3\"";
// Act
var result = _testUtility.Translator.TranslateStringToItemFilterBlock(inputString, _testUtility.MockItemFilterScript);
// Assert
Assert.AreEqual(1, result.BlockItems.Count(b => b is CustomSoundBlockItem));
var customSoundBlockItem = result.BlockItems.OfType<CustomSoundBlockItem>().First();
Assert.AreEqual("test.mp3", customSoundBlockItem.Value);
}
[Test]
public void TranslateStringToItemFilterBlock_CustomSoundDocumentsRelativeFile()
{
// Arrange
var inputString = @"Show" + Environment.NewLine +
"CustomAlertSound \"Sounds\test.mp3\"";
// Act
var result = _testUtility.Translator.TranslateStringToItemFilterBlock(inputString, _testUtility.MockItemFilterScript);
// Assert
Assert.AreEqual(1, result.BlockItems.Count(b => b is CustomSoundBlockItem));
var customSoundBlockItem = result.BlockItems.OfType<CustomSoundBlockItem>().First();
Assert.AreEqual("Sounds\test.mp3", customSoundBlockItem.Value);
}
[Test]
public void TranslateStringToItemFilterBlock_CustomSoundFullBackSlashPath()
{
// Arrange
var inputString = @"Show" + Environment.NewLine +
"CustomAlertSound \"C:\\Sounds\\test.mp3\"";
// Act
var result = _testUtility.Translator.TranslateStringToItemFilterBlock(inputString, _testUtility.MockItemFilterScript);
// Assert
Assert.AreEqual(1, result.BlockItems.Count(b => b is CustomSoundBlockItem));
var customSoundBlockItem = result.BlockItems.OfType<CustomSoundBlockItem>().First();
Assert.AreEqual("C:\\Sounds\\test.mp3", customSoundBlockItem.Value);
}
[Test]
public void TranslateStringToItemFilterBlock_CustomSoundFullForwardSlashPath()
{
// Arrange
var inputString = @"Show" + Environment.NewLine +
"CustomAlertSound \"C:/Sounds/test.mp3\"";
//Act
var result = _testUtility.Translator.TranslateStringToItemFilterBlock(inputString, _testUtility.MockItemFilterScript);
// Assert
Assert.AreEqual(1, result.BlockItems.Count(b => b is CustomSoundBlockItem));
var customSoundBlockItem = result.BlockItems.OfType<CustomSoundBlockItem>().First();
Assert.AreEqual("C:/Sounds/test.mp3", customSoundBlockItem.Value);
}
[Test]
public void TranslateStringToItemFilterBlock_CustomSoundFullMixedPath()
{
// Arrange
var inputString = @"Show" + Environment.NewLine +
"CustomAlertSound \"C:\\Sounds/test.mp3\"";
// Act
var result = _testUtility.Translator.TranslateStringToItemFilterBlock(inputString, _testUtility.MockItemFilterScript);
// Assert
Assert.AreEqual(1, result.BlockItems.Count(b => b is CustomSoundBlockItem));
var customSoundBlockItem = result.BlockItems.OfType<CustomSoundBlockItem>().First();
Assert.AreEqual("C:\\Sounds/test.mp3", customSoundBlockItem.Value);
}
[Test] [Test]
public void TranslateItemFilterBlockToString_NothingPopulated_ReturnsCorrectString() public void TranslateItemFilterBlockToString_NothingPopulated_ReturnsCorrectString()
{ {

View File

@ -382,7 +382,7 @@ namespace Filtration.Parser.Services
RemoveExistingBlockItemsOfType<SoundBlockItem>(block); RemoveExistingBlockItemsOfType<SoundBlockItem>(block);
RemoveExistingBlockItemsOfType<PositionalSoundBlockItem>(block); RemoveExistingBlockItemsOfType<PositionalSoundBlockItem>(block);
var match = Regex.Match(trimmedLine, @"\S+\s+""(\S+)"""); var match = Regex.Match(trimmedLine, @"\S+\s+""([^\*\<\>\?|]+)""");
if (match.Success) if (match.Success)
{ {

View File

@ -2,10 +2,10 @@
Filtration is an editor for Path of Exile item filter scripts. Filtration is an editor for Path of Exile item filter scripts.
## Current Release (Released 2018-08-30) ## Current Release (Released 2018-09-01)
<b>Installer</b> <a href="https://github.com/ben-wallis/Filtration/releases/download/0.19/filtration_0.19_setup.exe">filtration_0.19_setup.exe</a> <b>Installer</b> <a href="https://github.com/ben-wallis/Filtration/releases/download/0.20/filtration_0.20_setup.exe">filtration_0.20_setup.exe</a>
<b>Zip File</b> <a href="https://github.com/ben-wallis/Filtration/releases/download/0.19/filtration_0.19.zip">filtration_0.19.zip</a> <b>Zip File</b> <a href="https://github.com/ben-wallis/Filtration/releases/download/0.20/filtration_0.20.zip">filtration_0.20.zip</a>
## System Requirements ## System Requirements
Filtration requires .NET Framework 4.6.1 installed. Filtration requires .NET Framework 4.6.1 installed.