|
|
|
|
@@ -1306,6 +1306,86 @@ namespace Filtration.Parser.Tests.Services
|
|
|
|
|
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]
|
|
|
|
|
public void TranslateItemFilterBlockToString_NothingPopulated_ReturnsCorrectString()
|
|
|
|
|
{
|
|
|
|
|
|