public void ItemBlockItemMatch_ClassBlockItem_SingleBlockItemValue_ReturnsCorrectResult(string testInputBlockItemItemClass, bool expectedResult)
        {
            //Arrange
            var testInputItem = Mock.Of<IItem>(i => i.ItemClass == "Test Item Class");
            var testInputBlockItem = new ClassBlockItem();
            testInputBlockItem.Items.Add(testInputBlockItemItemClass);

            //Act
            var result = _testUtility.BlockItemMatcher.ItemBlockItemMatch(testInputBlockItem, testInputItem);

            //Assert
            Assert.AreEqual(expectedResult, result);
        }
        public void TranslateItemFilterBlockToString_Everything_ReturnsCorrectString()
        {
            // Arrange
            var expectedResult = "Show" + Environment.NewLine +
                                 "    ItemLevel > 70" + Environment.NewLine +
                                 "    ItemLevel <= 85" + Environment.NewLine +
                                 "    DropLevel != 56" + Environment.NewLine +
                                 "    Quality > 2" + Environment.NewLine +
                                 "    Rarity = Unique" + Environment.NewLine +
                                 "    Sockets <= 6" + Environment.NewLine +
                                 "    LinkedSockets >= 4" + Environment.NewLine +
                                 "    Width = 3" + Environment.NewLine +
                                 "    Height <= 6" + Environment.NewLine +
                                 "    Height >= 2" + Environment.NewLine +
                                 "    Class \"Body Armour\" \"Gloves\" \"Belt\" \"Two Hand Axes\"" + Environment.NewLine +
                                 "    BaseType \"Greater Life Flask\" \"Simple Robe\" \"Full Wyrmscale\"" +
                                 Environment.NewLine +
                                 "    SetTextColor 255 89 0 56" + Environment.NewLine +
                                 "    SetBackgroundColor 0 0 0" + Environment.NewLine +
                                 "    SetBorderColor 255 1 254" + Environment.NewLine +
                                 "    SetFontSize 50" + Environment.NewLine +
                                 "    PlayAlertSound 6 90";

            _testUtility.TestBlock.BlockItems.Add(new ActionBlockItem(BlockAction.Show));
            _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.NotEqual, 56));
            _testUtility.TestBlock.BlockItems.Add(new QualityBlockItem(FilterPredicateOperator.GreaterThan, 2));
            _testUtility.TestBlock.BlockItems.Add(new RarityBlockItem(FilterPredicateOperator.Equal, (int)ItemRarity.Unique));
            var classItemblockItem = new ClassBlockItem();
            classItemblockItem.Items.Add("Body Armour");
            classItemblockItem.Items.Add("Gloves");
            classItemblockItem.Items.Add("Belt");
            classItemblockItem.Items.Add("Two Hand Axes");
            _testUtility.TestBlock.BlockItems.Add(classItemblockItem);
            var baseTypeItemblockItem = new BaseTypeBlockItem();
            baseTypeItemblockItem.Items.Add("Greater Life Flask");
            baseTypeItemblockItem.Items.Add("Simple Robe");
            baseTypeItemblockItem.Items.Add("Full Wyrmscale");
            _testUtility.TestBlock.BlockItems.Add(baseTypeItemblockItem);
            _testUtility.TestBlock.BlockItems.Add(new SocketsBlockItem(FilterPredicateOperator.LessThanOrEqual, 6));
            _testUtility.TestBlock.BlockItems.Add(new LinkedSocketsBlockItem(FilterPredicateOperator.GreaterThanOrEqual, 4));
            _testUtility.TestBlock.BlockItems.Add(new WidthBlockItem(FilterPredicateOperator.Equal, 3));
            _testUtility.TestBlock.BlockItems.Add(new HeightBlockItem(FilterPredicateOperator.LessThanOrEqual, 6));
            _testUtility.TestBlock.BlockItems.Add(new HeightBlockItem(FilterPredicateOperator.GreaterThanOrEqual, 2));
            _testUtility.TestBlock.BlockItems.Add(new TextColorBlockItem(new Color {A = 56, R = 255, G = 89, B = 0}));
            _testUtility.TestBlock.BlockItems.Add(new BackgroundColorBlockItem(new Color { A = 255, R = 0, G = 0, B = 0 }));
            _testUtility.TestBlock.BlockItems.Add(new BorderColorBlockItem(new Color { A = 255, R = 255, G = 1, B = 254 }));
            _testUtility.TestBlock.BlockItems.Add(new FontSizeBlockItem(50));
            _testUtility.TestBlock.BlockItems.Add(new SoundBlockItem(6, 90));

            // Act
            var result = _testUtility.Translator.TranslateItemFilterBlockToString(_testUtility.TestBlock);

            // Assert
            Assert.AreEqual(expectedResult, result);
        }
        public void TranslateItemFilterBlockToString_Classes_ReturnsCorrectString()
        {
            // Arrange
            var expectedResult = "Show" + Environment.NewLine +
                                 "    Class \"Test Class\" \"Another Class\" \"Yet Another Class\"";

            var classBlockItem = new ClassBlockItem();
            classBlockItem.Items.Add("Test Class");
            classBlockItem.Items.Add("Another Class");
            classBlockItem.Items.Add("Yet Another Class");
            _testUtility.TestBlock.BlockItems.Add(classBlockItem);

            // Act
            var result = _testUtility.Translator.TranslateItemFilterBlockToString(_testUtility.TestBlock);

            // Assert
            Assert.AreEqual(expectedResult, result);
        }
        public void TranslateItemFilterBlockToString_Classes_DoesNotDuplicateApostraphes()
        {
            // Arrange
            var expectedResult = "Show" + Environment.NewLine +
                                 "    Class \"Test Cl'ass\"";

            var classBlockItem = new ClassBlockItem();
            classBlockItem.Items.Add("Test Cl'ass");
            _testUtility.TestBlock.BlockItems.Add(classBlockItem);

            // Act
            var result = _testUtility.Translator.TranslateItemFilterBlockToString(_testUtility.TestBlock);

            // Assert
            Assert.AreEqual(expectedResult, result);
        }