Fix tests

This commit is contained in:
azakhi 2018-08-10 17:22:55 +03:00
parent 71b7a45f84
commit 3aa2bf488c
2 changed files with 7 additions and 5 deletions

View File

@ -541,8 +541,8 @@ namespace Filtration.Parser.Tests.Services
var result = _testUtility.Translator.TranslateStringToItemFilterBlock(inputString, _testUtility.MockItemFilterScript);
// Assert
Assert.AreEqual(1, result.BlockItems.Count(b => b is BaseTypeBlockItem));
var blockItem = result.BlockItems.OfType<BaseTypeBlockItem>().First();
Assert.AreEqual(1, result.BlockItems.Count(b => b is HasExplicitModBlockItem));
var blockItem = result.BlockItems.OfType<HasExplicitModBlockItem>().First();
Assert.Contains("Test Mod 1", blockItem.Items);
Assert.Contains("TestOneWordModInQuotes", blockItem.Items);
Assert.Contains("TestOneWordModNotInQuotes", blockItem.Items);
@ -1848,6 +1848,8 @@ namespace Filtration.Parser.Tests.Services
_testUtility.TestBlock.BlockItems.Add(new ItemLevelBlockItem(FilterPredicateOperator.GreaterThan, 70));
_testUtility.TestBlock.BlockItems.Add(new ItemLevelBlockItem(FilterPredicateOperator.LessThanOrEqual, 85));
_testUtility.TestBlock.BlockItems.Add(new DropLevelBlockItem(FilterPredicateOperator.GreaterThan, 56));
_testUtility.TestBlock.BlockItems.Add(new GemLevelBlockItem(FilterPredicateOperator.LessThan, 15));
_testUtility.TestBlock.BlockItems.Add(new StackSizeBlockItem(FilterPredicateOperator.GreaterThanOrEqual, 4));
_testUtility.TestBlock.BlockItems.Add(new QualityBlockItem(FilterPredicateOperator.GreaterThan, 2));
_testUtility.TestBlock.BlockItems.Add(new RarityBlockItem(FilterPredicateOperator.Equal, (int)ItemRarity.Unique));
var classItemblockItem = new ClassBlockItem();

View File

@ -156,7 +156,7 @@ namespace Filtration.Parser.Tests.Services
script.ItemFilterBlocks.Add(block2);
var expectedOutput = "# Script edited with Filtration - https://github.com/ben-wallis/Filtration" + Environment.NewLine +
"# Test Filter 1" + Environment.NewLine +
"# Test Filter 1" + Environment.NewLine + Environment.NewLine +
"Show" + Environment.NewLine +
" ItemLevel > 5" + Environment.NewLine +
"Show" + Environment.NewLine +
@ -194,7 +194,7 @@ namespace Filtration.Parser.Tests.Services
script.ItemFilterBlocks.Add(block1);
script.ItemFilterBlocks.Add(block2);
var expectedOutput = "# Script edited with Filtration - https://github.com/ben-wallis/Filtration" + Environment.NewLine +
var expectedOutput = "# Script edited with Filtration - https://github.com/ben-wallis/Filtration" + Environment.NewLine + Environment.NewLine +
"# Test script description" + Environment.NewLine +
"# This is a really great script!" + Environment.NewLine +
"# Multiple line script descriptions are fun!" + Environment.NewLine +
@ -228,7 +228,7 @@ namespace Filtration.Parser.Tests.Services
};
var expectedOutput = "# Script edited with Filtration - https://github.com/ben-wallis/Filtration" +
Environment.NewLine +
Environment.NewLine + Environment.NewLine +
"# Test script description" + Environment.NewLine + Environment.NewLine;
var translator = CreateItemFilterScriptTranslator();