Refactored parsing services into separate project
This commit is contained in:
139
Filtration.Parser.Tests/Filtration.Parser.Tests.csproj
Normal file
139
Filtration.Parser.Tests/Filtration.Parser.Tests.csproj
Normal file
@@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{1F30CF6D-A5BF-4777-B8BA-E34F439FE8E5}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Filtration.Parser.Tests</RootNamespace>
|
||||
<AssemblyName>Filtration.Parser.Tests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
||||
<IsCodedUITest>False</IsCodedUITest>
|
||||
<TestProjectType>UnitTest</TestProjectType>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="FluentAssertions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FluentAssertions.4.2.1\lib\net45\FluentAssertions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="FluentAssertions.Core, Version=4.2.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FluentAssertions.4.2.1\lib\net45\FluentAssertions.Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Moq, Version=4.2.1510.2205, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework, Version=3.0.5813.39031, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NUnit.3.0.1\lib\net45\nunit.framework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<Choose>
|
||||
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||
</ItemGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
|
||||
</ItemGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Services\TestBlockGroupHierarchyBuilder.cs" />
|
||||
<Compile Include="Services\TestItemFilterBlockTranslator.cs" />
|
||||
<Compile Include="Services\TestItemFilterScriptTranslator.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Filtration.ObjectModel\Filtration.ObjectModel.csproj">
|
||||
<Project>{4aac3beb-1dc1-483e-9d11-0e9334e80227}</Project>
|
||||
<Name>Filtration.ObjectModel</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Filtration.Parser.Interface\Filtration.Parser.Interface.csproj">
|
||||
<Project>{46383f20-02df-48b4-b092-9088fa4acd5a}</Project>
|
||||
<Name>Filtration.Parser.Interface</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Filtration.Parser\Filtration.Parser.csproj">
|
||||
<Project>{10a7c2bc-ec6f-4a38-bdda-e35935004c02}</Project>
|
||||
<Name>Filtration.Parser</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resources\ThioleItemFilter.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resources\testscript.txt" />
|
||||
</ItemGroup>
|
||||
<Choose>
|
||||
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
</When>
|
||||
</Choose>
|
||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
36
Filtration.Parser.Tests/Properties/AssemblyInfo.cs
Normal file
36
Filtration.Parser.Tests/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Filtration.Parser.Tests")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Filtration.Parser.Tests")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("1f30cf6d-a5bf-4777-b8ba-e34f439fe8e5")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
120
Filtration.Parser.Tests/Properties/Resources.Designer.cs
generated
Normal file
120
Filtration.Parser.Tests/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,120 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Filtration.Parser.Tests.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
public class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
public static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Filtration.Parser.Tests.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
public static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to # Item Filter Script created by Filtration v0.1 - www.github.com/XVar/filtration
|
||||
///# Begin Script Description
|
||||
///# This is a test script
|
||||
///#
|
||||
///# End Script Description
|
||||
///
|
||||
///# First test condition booyah
|
||||
///Show
|
||||
/// ItemLevel = 32
|
||||
/// DropLevel >= 85
|
||||
/// Quality >= 15
|
||||
/// Sockets < 4
|
||||
/// LinkedSockets >= 3
|
||||
/// SetFontSize 12
|
||||
///
|
||||
///# Section: Gud stuff u shud pick up m9
|
||||
///
|
||||
///# Second test condition
|
||||
///Show
|
||||
/// ItemLevel > 50
|
||||
/// Quality >= 15
|
||||
/// Rarity > Magic
|
||||
/// Class "Test Class 1" "Test Class 2" "Test Class [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
public static string testscript {
|
||||
get {
|
||||
return ResourceManager.GetString("testscript", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to ###BETA VERSION 1.0.0.1-8
|
||||
///#Please test and let me know via pm on reddit /u/brute_force or @Thiole in game if i am online
|
||||
///
|
||||
///#------------------------------------------------------------------
|
||||
///#Fishing Rods First OFC
|
||||
///Show
|
||||
/// Class Fishing Rods
|
||||
/// SetTextColor 0 0 0
|
||||
/// SetBorderColor 0 0 0
|
||||
/// SetBackgroundColor 255 255 255
|
||||
///
|
||||
///Show
|
||||
/// Class "Quest Items"
|
||||
///
|
||||
///#####Shows better currency differently from lower currency for efficiency
|
||||
///##### skill gems
|
||||
///Show
|
||||
/// Class "Active Skill Gems" "Support Skil [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
public static string ThioleItemFilter {
|
||||
get {
|
||||
return ResourceManager.GetString("ThioleItemFilter", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
127
Filtration.Parser.Tests/Properties/Resources.resx
Normal file
127
Filtration.Parser.Tests/Properties/Resources.resx
Normal file
@@ -0,0 +1,127 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="ThioleItemFilter" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\ThioleItemFilter.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
<data name="testscript" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\testscript.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
</root>
|
||||
914
Filtration.Parser.Tests/Resources/ThioleItemFilter.txt
Normal file
914
Filtration.Parser.Tests/Resources/ThioleItemFilter.txt
Normal file
@@ -0,0 +1,914 @@
|
||||
###BETA VERSION 1.0.0.1-8
|
||||
#Please test and let me know via pm on reddit /u/brute_force or @Thiole in game if i am online
|
||||
|
||||
#------------------------------------------------------------------
|
||||
#Fishing Rods First OFC
|
||||
Show
|
||||
Class Fishing Rods
|
||||
SetTextColor 0 0 0
|
||||
SetBorderColor 0 0 0
|
||||
SetBackgroundColor 255 255 255
|
||||
|
||||
Show
|
||||
Class "Quest Items"
|
||||
|
||||
#####Shows better currency differently from lower currency for efficiency
|
||||
##### skill gems
|
||||
Show
|
||||
Class "Active Skill Gems" "Support Skill Gems"
|
||||
Quality >= 1
|
||||
SetFontSize 28
|
||||
SetTextColor 0 200 200
|
||||
SetBorderColor 0 200 200
|
||||
|
||||
Show
|
||||
Class "Active Skill Gems" "Support Skill Gems"
|
||||
SetFontSize 30
|
||||
SetTextColor 0 200 200
|
||||
|
||||
# Section: Chance bases
|
||||
|
||||
Show
|
||||
BaseType "Lapis Amulet" "Amber Amulet"
|
||||
SetFontSize 25
|
||||
SetBorderColor 255 0 255
|
||||
|
||||
Show
|
||||
SocketGroup RGB BGR
|
||||
SetFontSize 30
|
||||
SetBorderColor 0 255 0
|
||||
|
||||
#Chance Bases
|
||||
Show
|
||||
BaseType "Prophecy Wand" "Leather Belt" "Occultist's Vestment" "Agate Amulet" "Gavel"
|
||||
SetFontSize 30
|
||||
Rarity Normal
|
||||
SetBorderColor 255 0 255
|
||||
|
||||
|
||||
################currency highlighting
|
||||
Show
|
||||
BaseType "Mirror of Kalandra" "Exalted Orb" "Divine Orb" "Orb of Regret" "Eternal Orb" "Regal Orb"
|
||||
SetTextColor 200 200 130
|
||||
SetBorderColor 200 200 130
|
||||
SetBackgroundColor 0 0 0
|
||||
SetFontSize 32
|
||||
|
||||
Show
|
||||
BaseType "Gemcutter's Prism" "Chaos Orb" "Orb of Fusing" "Orb of Alchemy"
|
||||
SetBorderColor 200 200 130
|
||||
SetTextColor 200 200 130
|
||||
SetFontSize 30
|
||||
|
||||
Show
|
||||
BaseType "Chromatic Orb"
|
||||
SetBorderColor 0 255 0
|
||||
SetTextColor 200 200 130
|
||||
|
||||
Show
|
||||
BaseType "Cartographer's Chisel"
|
||||
SetBorderColor 0 0 255
|
||||
SetTextColor 200 200 130
|
||||
Show
|
||||
Class Currency
|
||||
SetTextColor 200 200 130
|
||||
SetFontSize 30
|
||||
SetBackgroundColor 0 0 0
|
||||
#############################
|
||||
|
||||
#unique Weapon slot start
|
||||
|
||||
#staves / wands
|
||||
|
||||
|
||||
Show
|
||||
BaseType "Judgement Staff" "Long Staff" "Vile Staff" "Imperial Staff" "Prophecy Wand" "Spiraled Wand"
|
||||
Rarity Unique
|
||||
SetTextColor 175 100 40
|
||||
SetBorderColor 175 100 40
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
Show
|
||||
Class "Staves"
|
||||
Rarity Unique
|
||||
DropLevel = 48
|
||||
SetTextColor 175 100 40
|
||||
SetBorderColor 175 100 40
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
#Claws / Daggers
|
||||
|
||||
Show
|
||||
BaseType "Slaughter Knife" "Imperial Skean" "Thresher Claw"
|
||||
Rarity Unique
|
||||
SetTextColor 175 100 40
|
||||
SetBorderColor 175 100 40
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
#Maces / Sceptres / Mauls / Axes
|
||||
|
||||
Show
|
||||
BaseType "Void Sceptre" "Siege Axe" "Gavel"
|
||||
Rarity Unique
|
||||
SetTextColor 175 100 40
|
||||
SetBorderColor 175 100 40
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
#Swords
|
||||
|
||||
|
||||
|
||||
#Bows
|
||||
Show
|
||||
BaseType "Spine Bow" "Imperial Bow"
|
||||
Rarity Unique
|
||||
SetTextColor 175 100 40
|
||||
SetBorderColor 175 100 40
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
#Body Armor
|
||||
Show
|
||||
BaseType "Simple Robe" "Full Wyrmscale" "Varnished Coat" "Occultist's Vestment" "Glorious Plate" "Sacrificial Garb"
|
||||
Rarity Unique
|
||||
SetTextColor 175 100 40
|
||||
SetBorderColor 175 100 40
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
#boots
|
||||
Show
|
||||
BaseType "Conjurer Boots"
|
||||
Rarity Unique
|
||||
SetTextColor 175 100 40
|
||||
SetBorderColor 175 100 40
|
||||
SetBackgroundColor 0 0 0
|
||||
#gloves
|
||||
Show
|
||||
BaseType "Vaal Gauntlets" "Strapped Mitts" "Conjurer Gloves" "Deerskin Gloves" "Murder Mitts"
|
||||
Rarity Unique
|
||||
SetTextColor 175 100 40
|
||||
SetBorderColor 175 100 40
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
|
||||
#helm
|
||||
Show
|
||||
BaseType "Sinner Tricorne" "Ursine Pelt" "Ezomyte Burgonet" "Great Crown"
|
||||
Rarity Unique
|
||||
SetTextColor 175 100 40
|
||||
SetBorderColor 175 100 40
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
#######shields
|
||||
|
||||
Show
|
||||
BaseType "Champion Kite Shield" "Archon Kite Shield" "Titanium Spirit Shield" "Mosaic Kite Shield" "Branded Kite Shield"
|
||||
Rarity Unique
|
||||
SetTextColor 175 100 40
|
||||
SetBorderColor 175 100 40
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
#######Amulet / Ring/ Belt
|
||||
|
||||
|
||||
Show
|
||||
BaseType "Amber Amulet" "Onyx Amulet" "Agate Amulet" "Chain Belt"
|
||||
Rarity Unique
|
||||
SetTextColor 175 100 40
|
||||
SetBorderColor 175 100 40
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
Show
|
||||
BaseType "Gold Ring" "Sapphire Ring" "Prismatic Ring" "Amethyst Ring" "Paua Ring"
|
||||
Rarity Unique
|
||||
SetTextColor 175 100 40
|
||||
SetBorderColor 175 100 40
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
#Utility
|
||||
Show
|
||||
Class Jewel "Utility Flask"
|
||||
Rarity Unique
|
||||
SetTextColor 175 100 40
|
||||
SetBorderColor 175 100 40
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
Show
|
||||
Class Jewel
|
||||
SetBorderColor 255 0 255
|
||||
|
||||
################### LEVEL BASED UNIQUE HIGHLIGHTING #############################
|
||||
Show
|
||||
BaseType "Steelscale Gauntlets" "Prophet Crown" "Leather Cap" "Pine Buckler"
|
||||
Rarity Unique
|
||||
ItemLevel < 70
|
||||
SetTextColor 175 100 40
|
||||
SetBorderColor 0 0 0
|
||||
SetBackgroundColor 175 100 40
|
||||
|
||||
|
||||
####
|
||||
Show
|
||||
Rarity Unique
|
||||
SetFontSize 30
|
||||
SetTextColor 175 100 40
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
|
||||
|
||||
|
||||
###########RARES#####
|
||||
|
||||
#Global Rules
|
||||
|
||||
Show
|
||||
Class Amulets Rings Belt
|
||||
Rarity Rare
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 60 0 200
|
||||
|
||||
Show
|
||||
BaseType "Sai" "Moon Staff" "Maraketh Bow" "Tiger Hook" "Morning Star" "Tornado Wand" "Prophecy Wand" "Imbued Wand" "Infernal Sword" "Void Axe" "Jewelled Foil" "Harpy Rapier" "Judgement Staff" "Void Sceptre" "Midnight Blade" "Eternal Sword" "Harbinger Bow" "Imperial Claw" "Ambusher" "Platinum Kris" "Terror Claw" "Imperial Skean" "Demon Dagger" "Infernal Axe"
|
||||
Rarity Rare
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
|
||||
|
||||
|
||||
##Level Scaling Rules
|
||||
##low 60 bases###############################
|
||||
|
||||
Show
|
||||
BaseType "Terror Maul" "Vaal Rapier" "Imperial Staff" "Carnal Sceptre" "Imperial Bow" "Vaal Claw" "Thicket Bow" "Vaal Hatchet" "Royal Axe" "Nightmare Mace" "Vaal Blade" "Vaal Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 70
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
Show
|
||||
BaseType "Terror Maul" "Vaal Rapier" "Imperial Staff" "Carnal Sceptre" "Imperial Bow" "Vaal Claw" "Thicket Bow" "Vaal Hatchet" "Royal Axe" "Nightmare Mace" "Vaal Blade" "Vaal Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 75
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 100 0 200
|
||||
#####
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 75
|
||||
DropLevel >= 67
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 100 0 200
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
DropLevel >= 68
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
|
||||
|
||||
#######65-68 bases
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 73
|
||||
DropLevel > 65
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 100 0 200
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
DropLevel > 65
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
|
||||
########## 60-65 bases
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 68
|
||||
DropLevel > 60
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 100 0 200
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 73
|
||||
DropLevel > 60
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
##### 55-60 bases
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 64
|
||||
DropLevel > 55
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 100 0 200
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 70
|
||||
DropLevel > 55
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
## 50-55 bases
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 58
|
||||
DropLevel > 50
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 100 0 200
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 65
|
||||
DropLevel > 50
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
#####46-50 bases
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 54
|
||||
DropLevel > 46
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 100 0 200
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 60
|
||||
DropLevel > 46
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
####42 - 48 bases
|
||||
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 48
|
||||
DropLevel > 42
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 100 0 200
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 51
|
||||
DropLevel > 42
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
###38-42
|
||||
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 42
|
||||
DropLevel > 38
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 100 0 200
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 48
|
||||
DropLevel > 38
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
####33-38
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 39
|
||||
DropLevel > 33
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 100 0 200
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 42
|
||||
DropLevel > 33
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
#### 27 - 32
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 32
|
||||
DropLevel > 27
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 100 0 200
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 38
|
||||
DropLevel > 27
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
##### 22- 27
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 27
|
||||
DropLevel > 22
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 100 0 200
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 31
|
||||
DropLevel > 22
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
########18-22
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 22
|
||||
DropLevel > 18
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 100 0 200
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 27
|
||||
DropLevel > 18
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
##12-18
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 18
|
||||
DropLevel > 12
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 100 0 200
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 24
|
||||
DropLevel > 12
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 0 0
|
||||
###### 8-12
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 12
|
||||
DropLevel > 8
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 100 0 200
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 16
|
||||
DropLevel > 8
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 0 0
|
||||
#####1-8
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 8
|
||||
DropLevel >= 0
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 100 0 200
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
Rarity Rare
|
||||
ItemLevel <= 12
|
||||
DropLevel >= 0
|
||||
SetFontSize 30
|
||||
SetTextColor 255 255 0
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 0 0 0
|
||||
|
||||
|
||||
###Rare highlighting
|
||||
|
||||
Show
|
||||
Rarity Rare
|
||||
SetFontSize 27
|
||||
SetTextColor 255 255 0 170
|
||||
SetBorderColor 255 255 0
|
||||
SetBackgroundColor 100 40 40 200
|
||||
|
||||
#### Flask Highlighting
|
||||
|
||||
Show
|
||||
Class Flask
|
||||
Quality > 13
|
||||
SetFontSize 25
|
||||
SetBorderColor 255 255 255
|
||||
|
||||
Show
|
||||
Class Flask
|
||||
Quality > 5
|
||||
SetFontSize 25
|
||||
|
||||
Show
|
||||
Class "Utility Flask"
|
||||
SetFontSize 30
|
||||
|
||||
###### RGB Highlighting
|
||||
|
||||
Show
|
||||
SocketGroup RGB BGR
|
||||
SetFontSize 30
|
||||
SetTextColor 0 255 0
|
||||
SetBorderColor 0 255 0
|
||||
|
||||
########Chisel Recipe Highlighting
|
||||
|
||||
Show
|
||||
BaseType "Gavel" "Rock Breaker" "Stone Hammer"
|
||||
Rarity Normal
|
||||
SetFontSize 25
|
||||
SetBorderColor 0 0 255
|
||||
Show
|
||||
BaseType "Gavel" "Rock Breaker" "Stone Hammer"
|
||||
Rarity Magic
|
||||
Quality > 15
|
||||
SetFontSize 25
|
||||
SetBorderColor 0 0 255
|
||||
|
||||
####### 6S/5L
|
||||
|
||||
Show
|
||||
LinkedSockets >= 5
|
||||
SetBorderColor 255 0 0
|
||||
SetFontSize 30
|
||||
Show
|
||||
Sockets 6
|
||||
SetBorderColor 255 0 0
|
||||
SetFontSize 30
|
||||
|
||||
Show
|
||||
LinkedSockets >= 3
|
||||
ItemLevel < 20
|
||||
|
||||
########################### Normal Show Rules
|
||||
Show
|
||||
BaseType "Sai" "Moon Staff" "Maraketh Bow" "Tiger Hook" "Morning Star" "Tornado Wand" "Prophecy Wand" "Imbued Wand" "Infernal Sword" "Void Axe" "Jewelled Foil" "Harpy Rapier" "Judgement Staff" "Void Sceptre" "Midnight Blade" "Eternal Sword" "Harbinger Bow" "Imperial Claw" "Ambusher" "Platinum Kris" "Terror Claw" "Imperial Skean" "Demon Dagger" "Infernal Axe"
|
||||
SetFontSize 30
|
||||
|
||||
### Show these whites up to 70
|
||||
Show
|
||||
BaseType "Terror Maul" "Vaal Rapier" "Imperial Staff" "Carnal Sceptre" "Imperial Bow" "Vaal Claw" "Thicket Bow" "Vaal Hatchet" "Royal Axe" "Nightmare Mace" "Vaal Blade" "Vaal Sceptre"
|
||||
Rarity Normal
|
||||
SetFontSize 30
|
||||
ItemLevel <= 70
|
||||
|
||||
###### T1 Bases up to forever
|
||||
Show
|
||||
Class "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
DropLevel >= 68
|
||||
Rarity Normal
|
||||
SetFontSize 30
|
||||
|
||||
|
||||
### T2 Bases up to 70
|
||||
Show
|
||||
Class "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
ItemLevel <= 70
|
||||
DropLevel > 64
|
||||
Rarity Normal
|
||||
SetFontSize 30
|
||||
|
||||
###### T3 Bases up to 65
|
||||
Show
|
||||
Class "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
ItemLevel <= 65
|
||||
DropLevel > 59
|
||||
Rarity Normal
|
||||
SetFontSize 30
|
||||
|
||||
#### t4 Bases up to 60
|
||||
Show
|
||||
Class "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
ItemLevel <= 60
|
||||
DropLevel > 53
|
||||
Rarity Normal
|
||||
SetFontSize 30
|
||||
|
||||
###### T5 up to 56
|
||||
|
||||
Show
|
||||
Class "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
ItemLevel <= 56
|
||||
DropLevel > 49
|
||||
Rarity Normal
|
||||
SetFontSize 30
|
||||
|
||||
##### t6 up to 50
|
||||
|
||||
Show
|
||||
Class "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
ItemLevel <= 50
|
||||
DropLevel > 44
|
||||
Rarity Normal
|
||||
SetFontSize 30
|
||||
|
||||
##### t7 up to 45
|
||||
Show
|
||||
Class "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
ItemLevel <= 45
|
||||
DropLevel > 39
|
||||
Rarity Normal
|
||||
SetFontSize 30
|
||||
|
||||
##### t8 up to 39
|
||||
Show
|
||||
Class "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
ItemLevel <= 39
|
||||
DropLevel > 33
|
||||
Rarity Normal
|
||||
SetFontSize 30
|
||||
|
||||
##### t9 up to 34
|
||||
|
||||
Show
|
||||
Class "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
ItemLevel <= 34
|
||||
DropLevel > 28
|
||||
Rarity Normal
|
||||
SetFontSize 30
|
||||
|
||||
#### t10 up to 30
|
||||
Show
|
||||
Class "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
ItemLevel <= 30
|
||||
DropLevel > 27
|
||||
Rarity Normal
|
||||
SetFontSize 30
|
||||
|
||||
#t11 up to 29
|
||||
|
||||
Show
|
||||
Class "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
ItemLevel <= 29
|
||||
DropLevel > 21
|
||||
Rarity Normal
|
||||
SetFontSize 30
|
||||
|
||||
#t12 bases up to 27
|
||||
|
||||
Show
|
||||
Class "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
ItemLevel <= 27
|
||||
DropLevel > 20
|
||||
Rarity Normal
|
||||
SetFontSize 30
|
||||
|
||||
#T13 Bases up to 21
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
ItemLevel <= 21
|
||||
DropLevel > 15
|
||||
Rarity Normal
|
||||
SetFontSize 29
|
||||
|
||||
#### t14 up to 17
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
ItemLevel <= 17
|
||||
DropLevel > 10
|
||||
Rarity Normal
|
||||
SetFontSize 30
|
||||
|
||||
####t15 up to 15
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
ItemLevel <= 14
|
||||
DropLevel > 7
|
||||
Rarity Normal
|
||||
SetFontSize 29
|
||||
|
||||
###t16 up to 10
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
ItemLevel <= 10
|
||||
DropLevel > 5
|
||||
Rarity Normal
|
||||
SetFontSize 29
|
||||
|
||||
####t17 up to 7
|
||||
|
||||
Show
|
||||
Class "Body Armour" "Gloves" "Boots" "Belt" "Helm" "Shield" "Quiver" "Bow" "Staves" "Two Hand Axes" "Claw" "One Hand Axe" "Wands" "One Hand Swords" "Thrusting One Hand Swords" "One Hand Mace" "Two Hand Mace" "Two Hand Sword" "Dagger" "Sceptre"
|
||||
ItemLevel <= 7
|
||||
DropLevel >= 1
|
||||
Rarity Normal
|
||||
SetFontSize 29
|
||||
|
||||
##################### WHITES RULES DONE
|
||||
|
||||
|
||||
#### Show rings at all levels for progression
|
||||
Show
|
||||
Class Ring Amulet
|
||||
ItemLevel < 70
|
||||
|
||||
Show
|
||||
Class Boots Gloves Helmet Shield Belt
|
||||
Rarity Magic
|
||||
SetFontSize 25
|
||||
ItemLevel < 20
|
||||
|
||||
#### Cant get map based level highlighting to work, DropLevel does not work for maps
|
||||
|
||||
Show
|
||||
Class "Map Fragments" "Maps"
|
||||
|
||||
|
||||
##### Flask based level visibility
|
||||
|
||||
### Small Flask to ~ End of A1N, REQ level 0
|
||||
Show
|
||||
BaseType "Small Life Flask" "Small Mana Flask"
|
||||
ItemLevel < 12
|
||||
SetFontSize 30
|
||||
SetBorderColor 255 255 255
|
||||
|
||||
|
||||
#### Medium Ends midway through a2, medium starts dropping around the same time as large, REQ LEVEL 4
|
||||
|
||||
Show
|
||||
BaseType "Medium Life Flask" "Medium Mana Flask"
|
||||
ItemLevel < 19
|
||||
SetFontSize 30
|
||||
SetBorderColor 255 255 255
|
||||
|
||||
#### Large Ends around the same time, these make mediums basically obsolete, i only keep mediums on because of 3x vendor recipe for another large REQ LEVEL 14
|
||||
|
||||
Show
|
||||
BaseType "Large Life Flask" "Large Mana Flask"
|
||||
ItemLevel < 20
|
||||
SetFontSize 30
|
||||
SetBorderColor 255 255 255
|
||||
|
||||
|
||||
#### Greater ends near the end of a2/beginning of a3 REQ LEVEL 18
|
||||
Show
|
||||
BaseType "Greater Life Flask" "Greater Mana Flask"
|
||||
ItemLevel < 24
|
||||
SetFontSize 30
|
||||
SetBorderColor 255 255 255
|
||||
|
||||
|
||||
#### Hides Midway through A3N REQ LEVEL 26
|
||||
Show
|
||||
BaseType "Grand Life Flask" "Grand Mana Flask"
|
||||
ItemLevel < 34
|
||||
SetFontSize 30
|
||||
SetBorderColor 255 255 255
|
||||
|
||||
####Hides Near the end of Normal difficulty REQ LEVEL 34
|
||||
|
||||
Show
|
||||
BaseType "Giant Life Flask" "Giant Mana Flask"
|
||||
ItemLevel < 38
|
||||
SetFontSize 30
|
||||
SetBorderColor 255 255 255
|
||||
|
||||
####Hides somewhere at the start of cruel REQ LEVEL 37
|
||||
Show
|
||||
BaseType "Colossal Life Flask" "Colossal Mana Flask"
|
||||
ItemLevel < 45
|
||||
SetFontSize 30
|
||||
SetBorderColor 255 255 255
|
||||
|
||||
####### Hides Midway through cruel REQ LEVEL 45
|
||||
|
||||
Show
|
||||
BaseType "Sacred Life Flask" "Sacred Mana Flask"
|
||||
ItemLevel < 49
|
||||
SetFontSize 30
|
||||
SetBorderColor 255 255 255
|
||||
|
||||
### REQ LEVEL 53
|
||||
|
||||
Show
|
||||
BaseType "Hallowed Life Flask" "Hallowed Mana Flask"
|
||||
ItemLevel < 58
|
||||
SetFontSize 30
|
||||
SetBorderColor 255 255 255
|
||||
|
||||
##### REQ LEVEL 60
|
||||
|
||||
Show
|
||||
BaseType "Sanctified Life Flask" "Sanctified Mana Flask"
|
||||
ItemLevel < 70
|
||||
SetFontSize 30
|
||||
SetBorderColor 255 255 255
|
||||
|
||||
### REQ LEVEL 65 and 70 Respectively 2 best bases in game, always show
|
||||
|
||||
Show
|
||||
BaseType "Divine Life Flask" "Eternal Life Flask" "Divine Mana Flask" "Eternal Mana Flask"
|
||||
SetFontSize 30
|
||||
SetBorderColor 255 255 255
|
||||
|
||||
Hide
|
||||
SetFontSize 20
|
||||
SetBackgroundColor 0 0 0 50
|
||||
39
Filtration.Parser.Tests/Resources/testscript.txt
Normal file
39
Filtration.Parser.Tests/Resources/testscript.txt
Normal file
@@ -0,0 +1,39 @@
|
||||
# Item Filter Script created by Filtration v0.1 - www.github.com/XVar/filtration
|
||||
# Begin Script Description
|
||||
# This is a test script
|
||||
#
|
||||
# End Script Description
|
||||
|
||||
# First test condition booyah
|
||||
Show
|
||||
ItemLevel = 32
|
||||
DropLevel >= 85
|
||||
Quality >= 15
|
||||
Sockets < 4
|
||||
LinkedSockets >= 3
|
||||
SetFontSize 12
|
||||
|
||||
# Section: Gud stuff u shud pick up m9
|
||||
|
||||
# Second test condition
|
||||
Show
|
||||
ItemLevel > 50
|
||||
Quality >= 15
|
||||
Rarity > Magic
|
||||
Class "Test Class 1" "Test Class 2" "Test Class 3" "Test Class 4" "Test Class 5" "Test Class 6" "Test Class 7" "Test Class 8" "Test Class 9" "Test Class 10"
|
||||
BaseType "Test Base Type 1" "Test Base Type 2"
|
||||
Sockets <= 5
|
||||
LinkedSockets = 2
|
||||
SetFontSize 10
|
||||
|
||||
Show
|
||||
ItemLevel > 50
|
||||
Quality >= 15
|
||||
Rarity > Magic
|
||||
Class "Test Class 1" "Test Class 2" "Test Class 3" "Test Class 4" "Test Class 5" "Test Class 6" "Test Class 7" "Test Class 8" "Test Class 9" "Test Class 10"
|
||||
BaseType "Test Base Type 1" "Test Base Type 2"
|
||||
Sockets <= 5
|
||||
LinkedSockets = 2
|
||||
SetFontSize 10
|
||||
|
||||
Hide
|
||||
@@ -0,0 +1,121 @@
|
||||
using System.Collections.Generic;
|
||||
using Filtration.ObjectModel;
|
||||
using Filtration.Parser.Services;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Filtration.Parser.Tests.Services
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestBlockGroupHierarchyBuilder
|
||||
{
|
||||
[Test]
|
||||
public void IntegrateStringListIntoBlockGroupHierarchy_ReturnsBlockGroupWithCorrectName()
|
||||
{
|
||||
// Arrange
|
||||
var inputStrings = new List<string> {"Block Group", "Sub Block Group"};
|
||||
|
||||
var rootBlock = new ItemFilterBlockGroup("Root", null);
|
||||
var builder = new BlockGroupHierarchyBuilder();
|
||||
|
||||
// Act
|
||||
var result = builder.IntegrateStringListIntoBlockGroupHierarchy(inputStrings, rootBlock);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(1, rootBlock.ChildGroups.Count);
|
||||
Assert.AreEqual("Sub Block Group", result.GroupName);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void IntegrateStringListIntoBlockGroupHierarchy_SingleBlockGroup()
|
||||
{
|
||||
// Arrange
|
||||
var inputStrings = new List<string> { "Block Group" };
|
||||
|
||||
var rootBlock = new ItemFilterBlockGroup("Root", null);
|
||||
var builder = new BlockGroupHierarchyBuilder();
|
||||
|
||||
// Act
|
||||
var result = builder.IntegrateStringListIntoBlockGroupHierarchy(inputStrings, rootBlock);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(1, rootBlock.ChildGroups.Count);
|
||||
Assert.AreEqual("Block Group", result.GroupName);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void IntegrateStringListIntoBlockGroupHierarchy_AdvancedBlockGroup_MarksBlockGroupAsAdvanced()
|
||||
{
|
||||
// Arrange
|
||||
var inputStrings = new List<string> { "~Block Group" };
|
||||
|
||||
var rootBlock = new ItemFilterBlockGroup("Root", null);
|
||||
var builder = new BlockGroupHierarchyBuilder();
|
||||
|
||||
// Act
|
||||
var result = builder.IntegrateStringListIntoBlockGroupHierarchy(inputStrings, rootBlock);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(1, rootBlock.ChildGroups.Count);
|
||||
Assert.AreEqual("Block Group", result.GroupName);
|
||||
Assert.AreEqual(true, result.Advanced);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void IntegrateStringListIntoBlockGroupHierarchy_AdvancedBlockGroup_ChildrenAreCreatedAsAdvanced()
|
||||
{
|
||||
// Arrange
|
||||
var inputStrings = new List<string> { "~Advanced Block Group", "This should be advanced too" };
|
||||
|
||||
var rootBlock = new ItemFilterBlockGroup("Root", null);
|
||||
var builder = new BlockGroupHierarchyBuilder();
|
||||
|
||||
// Act
|
||||
var result = builder.IntegrateStringListIntoBlockGroupHierarchy(inputStrings, rootBlock);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(1, rootBlock.ChildGroups.Count);
|
||||
Assert.AreEqual(true, result.Advanced);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void IntegrateStringListIntoBlockGroupHierarchy_ExistingAdvancedBlockGroup_SetsParentCorrectly()
|
||||
{
|
||||
// Arrange
|
||||
var inputStrings = new List<string> { "~Block Group" };
|
||||
|
||||
var rootBlock = new ItemFilterBlockGroup("Root", null);
|
||||
var subBlock = new ItemFilterBlockGroup("Block Group", rootBlock, true);
|
||||
rootBlock.ChildGroups.Add(subBlock);
|
||||
|
||||
var builder = new BlockGroupHierarchyBuilder();
|
||||
|
||||
// Act
|
||||
var result = builder.IntegrateStringListIntoBlockGroupHierarchy(inputStrings, rootBlock);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(1, rootBlock.ChildGroups.Count);
|
||||
Assert.AreEqual("Block Group", result.GroupName);
|
||||
Assert.AreEqual(true, result.Advanced);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void IntegrateStringListIntoBlockGroupHierarchy_MultipleBlockGroups()
|
||||
{
|
||||
// Arrange
|
||||
var rootBlock = new ItemFilterBlockGroup("Root", null);
|
||||
var builder = new BlockGroupHierarchyBuilder();
|
||||
|
||||
// Act
|
||||
var inputStrings = new List<string> { "Block Group" };
|
||||
builder.IntegrateStringListIntoBlockGroupHierarchy(inputStrings, rootBlock);
|
||||
inputStrings = new List<string> { "Block Group 2" };
|
||||
builder.IntegrateStringListIntoBlockGroupHierarchy(inputStrings, rootBlock);
|
||||
inputStrings = new List<string> { "Block Group", "Sub Block Group" };
|
||||
var result = builder.IntegrateStringListIntoBlockGroupHierarchy(inputStrings, rootBlock);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(2, rootBlock.ChildGroups.Count);
|
||||
Assert.AreEqual("Sub Block Group", result.GroupName);
|
||||
}
|
||||
}
|
||||
}
|
||||
1567
Filtration.Parser.Tests/Services/TestItemFilterBlockTranslator.cs
Normal file
1567
Filtration.Parser.Tests/Services/TestItemFilterBlockTranslator.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,406 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Filtration.ObjectModel;
|
||||
using Filtration.ObjectModel.BlockItemTypes;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
using Filtration.ObjectModel.ThemeEditor;
|
||||
using Filtration.Parser.Interface.Services;
|
||||
using Filtration.Parser.Services;
|
||||
using Filtration.Parser.Tests.Properties;
|
||||
using Filtration.Properties;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Filtration.Parser.Tests.Services
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestItemFilterScriptTranslator
|
||||
{
|
||||
private ItemFilterScriptTranslatorTestUtility _testUtility;
|
||||
|
||||
[SetUp]
|
||||
public void ItemFilterScriptTranslatorTestSetup()
|
||||
{
|
||||
_testUtility = new ItemFilterScriptTranslatorTestUtility();
|
||||
Settings.Default.Reset();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TranslateStringToItemFilterScript_ReturnsScriptWithCorrectNumberOfBlocks()
|
||||
{
|
||||
// Arrange
|
||||
var testInput = Resources.testscript;
|
||||
|
||||
_testUtility.MockItemFilterBlockTranslator.Setup(t => t.TranslateStringToItemFilterBlock(It.IsAny<string>(), It.IsAny<ThemeComponentCollection>())).Verifiable();
|
||||
|
||||
// Act
|
||||
var script = _testUtility.ScriptTranslator.TranslateStringToItemFilterScript(testInput);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(5, script.ItemFilterBlocks.Count);
|
||||
_testUtility.MockItemFilterBlockTranslator.Verify();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TranslateStringToItemFilterScript_ReturnsScriptWithDescriptionCorrectlySet()
|
||||
{
|
||||
// Arrange
|
||||
var testInput = Resources.testscript;
|
||||
|
||||
var expectedDescription = "Item Filter Script created by Filtration v0.1 - www.github.com/XVar/filtration" + Environment.NewLine +
|
||||
"Begin Script Description" + Environment.NewLine +
|
||||
"This is a test script" + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"End Script Description";
|
||||
|
||||
var mockItemFilterBlockTranslator = new Mock<IItemFilterBlockTranslator>();
|
||||
mockItemFilterBlockTranslator.Setup(t => t.TranslateStringToItemFilterBlock(It.IsAny<string>(), It.IsAny<ThemeComponentCollection>())).Verifiable();
|
||||
|
||||
// Act
|
||||
var script = _testUtility.ScriptTranslator.TranslateStringToItemFilterScript(testInput);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(expectedDescription, script.Description);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TranslateStringToItemFilterScript_ThioleItemFilterTest()
|
||||
{
|
||||
// Arrange
|
||||
var testInput = Resources.ThioleItemFilter;
|
||||
|
||||
var blockTranslator = new ItemFilterBlockTranslator(_testUtility.MockBlockGroupHierarchyBuilder.Object);
|
||||
var translator = new ItemFilterScriptTranslator(blockTranslator, _testUtility.MockBlockGroupHierarchyBuilder.Object);
|
||||
|
||||
// Act
|
||||
translator.TranslateStringToItemFilterScript(testInput);
|
||||
|
||||
// Assert
|
||||
// Not crashing out when loading a huge script means this integration test has passed!
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TranslateItemFilterScriptToString_OneBlock_CallsTranslator()
|
||||
{
|
||||
// Arrange
|
||||
var testScript = new ItemFilterScript();
|
||||
|
||||
var testBlock = new ItemFilterBlock();
|
||||
testBlock.BlockItems.Add(new ItemLevelBlockItem(FilterPredicateOperator.Equal, 5));
|
||||
|
||||
const string blockOutput = "Test Script Output";
|
||||
|
||||
testScript.ItemFilterBlocks.Add(testBlock);
|
||||
|
||||
_testUtility.MockItemFilterBlockTranslator.Setup(t => t.TranslateItemFilterBlockToString(testBlock)).Returns(blockOutput).Verifiable();
|
||||
|
||||
|
||||
// Act
|
||||
_testUtility.ScriptTranslator.TranslateItemFilterScriptToString(testScript);
|
||||
|
||||
// Assert
|
||||
_testUtility.MockItemFilterBlockTranslator.Verify();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TranslateItemFilterScriptToString_ExtraLineBetweenBlocksSettingFalse_ReturnsCorrectOutput()
|
||||
{
|
||||
Settings.Default.ExtraLineBetweenBlocks = false;
|
||||
|
||||
var script = new ItemFilterScript();
|
||||
var block1 = new ItemFilterBlock { Description = "Test Filter 1" };
|
||||
block1.BlockItems.Add(new ItemLevelBlockItem(FilterPredicateOperator.GreaterThan, 5));
|
||||
|
||||
var block2 = new ItemFilterBlock();
|
||||
block2.BlockItems.Add(new QualityBlockItem(FilterPredicateOperator.LessThan, 15));
|
||||
block2.BlockItems.Add(new FontSizeBlockItem(7));
|
||||
block2.BlockItems.Add(new WidthBlockItem(FilterPredicateOperator.Equal, 3));
|
||||
|
||||
script.ItemFilterBlocks.Add(block1);
|
||||
script.ItemFilterBlocks.Add(block2);
|
||||
|
||||
var expectedOutput = "# Script edited with Filtration - https://github.com/ben-wallis/Filtration" + Environment.NewLine +
|
||||
"# Test Filter 1" + Environment.NewLine +
|
||||
"Show" + Environment.NewLine +
|
||||
" ItemLevel > 5" + Environment.NewLine +
|
||||
"Show" + Environment.NewLine +
|
||||
" Quality < 15" + Environment.NewLine +
|
||||
" Width = 3" + Environment.NewLine +
|
||||
" SetFontSize 7" + Environment.NewLine;
|
||||
|
||||
var blockTranslator = new ItemFilterBlockTranslator(_testUtility.MockBlockGroupHierarchyBuilder.Object);
|
||||
var translator = new ItemFilterScriptTranslator(blockTranslator,
|
||||
_testUtility.MockBlockGroupHierarchyBuilder.Object);
|
||||
|
||||
// Act
|
||||
var result = translator.TranslateItemFilterScriptToString(script);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(expectedOutput, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TranslateItemFilterScriptToString_FullScript_ReturnsCorrectOutput()
|
||||
{
|
||||
var script = new ItemFilterScript
|
||||
{
|
||||
Description = "Test script description" + Environment.NewLine +
|
||||
"This is a really great script!" + Environment.NewLine +
|
||||
"Multiple line script descriptions are fun!"
|
||||
};
|
||||
var block1 = new ItemFilterBlock {Description = "Test Filter 1"};
|
||||
block1.BlockItems.Add(new ItemLevelBlockItem(FilterPredicateOperator.GreaterThan, 5));
|
||||
|
||||
var block2 = new ItemFilterBlock();
|
||||
block2.BlockItems.Add(new QualityBlockItem(FilterPredicateOperator.LessThan, 15));
|
||||
block2.BlockItems.Add(new FontSizeBlockItem(7));
|
||||
block2.BlockItems.Add(new WidthBlockItem(FilterPredicateOperator.Equal, 3));
|
||||
|
||||
script.ItemFilterBlocks.Add(block1);
|
||||
script.ItemFilterBlocks.Add(block2);
|
||||
|
||||
var expectedOutput = "# Script edited with Filtration - https://github.com/ben-wallis/Filtration" + Environment.NewLine +
|
||||
"# Test script description" + Environment.NewLine +
|
||||
"# This is a really great script!" + Environment.NewLine +
|
||||
"# Multiple line script descriptions are fun!" + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"# Test Filter 1" + Environment.NewLine +
|
||||
"Show" + Environment.NewLine +
|
||||
" ItemLevel > 5" + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"Show" + Environment.NewLine +
|
||||
" Quality < 15" + Environment.NewLine +
|
||||
" Width = 3" + Environment.NewLine +
|
||||
" SetFontSize 7" + Environment.NewLine + Environment.NewLine;
|
||||
|
||||
var blockTranslator = new ItemFilterBlockTranslator(_testUtility.MockBlockGroupHierarchyBuilder.Object);
|
||||
var translator = new ItemFilterScriptTranslator(blockTranslator,
|
||||
_testUtility.MockBlockGroupHierarchyBuilder.Object);
|
||||
|
||||
// Act
|
||||
var result = translator.TranslateItemFilterScriptToString(script);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(expectedOutput, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TranslateItemFilterScriptToString_FullScriptWithExistingFiltrationTagline_ReturnsCorrectOutput()
|
||||
{
|
||||
var script = new ItemFilterScript
|
||||
{
|
||||
Description = "Script edited with Filtration - https://github.com/ben-wallis/Filtration" + Environment.NewLine +
|
||||
"Test script description" + Environment.NewLine
|
||||
};
|
||||
|
||||
var expectedOutput = "# Script edited with Filtration - https://github.com/ben-wallis/Filtration" +
|
||||
Environment.NewLine +
|
||||
"# Test script description" + Environment.NewLine + Environment.NewLine;
|
||||
|
||||
// Act
|
||||
var result = _testUtility.ScriptTranslator.TranslateItemFilterScriptToString(script);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(expectedOutput, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TranslateStringToItemFilterScript_SectionDirectlyBeforeBlockWithoutDescription_ReturnsCorrectObject()
|
||||
{
|
||||
// Arrange
|
||||
var testInputScript = "# My Script" + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"# Section: Chance Bases" + Environment.NewLine +
|
||||
"Show" + Environment.NewLine +
|
||||
" BaseType \"Lapis Amulet\" \"Amber Amulet\"" + Environment.NewLine +
|
||||
" SetBorderColor 255 0 255" + Environment.NewLine +
|
||||
" SetFontSize 25";
|
||||
|
||||
var blockTranslator = new ItemFilterBlockTranslator(_testUtility.MockBlockGroupHierarchyBuilder.Object);
|
||||
var translator = new ItemFilterScriptTranslator(blockTranslator,
|
||||
_testUtility.MockBlockGroupHierarchyBuilder.Object);
|
||||
|
||||
// Act
|
||||
var result = translator.TranslateStringToItemFilterScript(testInputScript);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(2, result.ItemFilterBlocks.Count);
|
||||
var block = result.ItemFilterBlocks.First(l => l.GetType() != typeof(ItemFilterSection));
|
||||
Assert.AreEqual(4, block.BlockItems.Count);
|
||||
var baseTypeItem = block.BlockItems.OfType<BaseTypeBlockItem>().First();
|
||||
Assert.AreEqual(2, baseTypeItem.Items.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TranslateStringToItemFilterScript_OneLineDescriptionNoBlockDescriptionAddsDescriptionToScript()
|
||||
{
|
||||
// Arrange
|
||||
var testInputScript = "# Script edited with Filtration - https://github.com/ben-wallis/Filtration" +
|
||||
Environment.NewLine +
|
||||
"Show" + Environment.NewLine +
|
||||
"BaseType \"Maelström Staff\"" + Environment.NewLine + Environment.NewLine;
|
||||
var blockTranslator = new ItemFilterBlockTranslator(_testUtility.MockBlockGroupHierarchyBuilder.Object);
|
||||
var translator = new ItemFilterScriptTranslator(blockTranslator,
|
||||
_testUtility.MockBlockGroupHierarchyBuilder.Object);
|
||||
|
||||
// Act
|
||||
var result = translator.TranslateStringToItemFilterScript(testInputScript);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual("Script edited with Filtration - https://github.com/ben-wallis/Filtration", result.Description);
|
||||
var firstBlock = result.ItemFilterBlocks.First();
|
||||
Assert.IsNull(firstBlock.Description);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TranslateStringToItemFilterScript_DisabledBlock_ReturnsCorrectBlockCount()
|
||||
{
|
||||
// Arrange
|
||||
var testInputScript = "Show" + Environment.NewLine +
|
||||
" ItemLevel > 2" + Environment.NewLine +
|
||||
" SetTextColor 255 40 0" + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"#Disabled Block Start" + Environment.NewLine +
|
||||
"#Show" + Environment.NewLine +
|
||||
"# ItemLevel > 2" + Environment.NewLine +
|
||||
"# SetTextColor 255 215 0" + Environment.NewLine +
|
||||
"# SetBorderColor 255 105 180" + Environment.NewLine +
|
||||
"# SetFontSize 32" + Environment.NewLine +
|
||||
"#Disabled Block End" + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"Show" + Environment.NewLine +
|
||||
" ItemLevel > 20" + Environment.NewLine +
|
||||
" SetTextColor 255 255 0";
|
||||
|
||||
|
||||
var blockTranslator = new ItemFilterBlockTranslator(_testUtility.MockBlockGroupHierarchyBuilder.Object);
|
||||
var translator = new ItemFilterScriptTranslator(blockTranslator,
|
||||
_testUtility.MockBlockGroupHierarchyBuilder.Object);
|
||||
|
||||
// Act
|
||||
var result = translator.TranslateStringToItemFilterScript(testInputScript);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(3, result.ItemFilterBlocks.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TranslateStringToItemFilterScript_DisabledBlock_ReturnsCorrectBlocks()
|
||||
{
|
||||
// Arrange
|
||||
var testInputScript = "Show" + Environment.NewLine +
|
||||
" ItemLevel > 2" + Environment.NewLine +
|
||||
" SetTextColor 255 40 0" + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"#Disabled Block Start" + Environment.NewLine +
|
||||
"#Show" + Environment.NewLine +
|
||||
"# ItemLevel > 2" + Environment.NewLine +
|
||||
"# SetTextColor 255 215 0" + Environment.NewLine +
|
||||
"# SetBorderColor 255 105 180" + Environment.NewLine +
|
||||
"# SetFontSize 32" + Environment.NewLine +
|
||||
"#Disabled Block End" + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"Show" + Environment.NewLine +
|
||||
" ItemLevel > 20" + Environment.NewLine +
|
||||
" SetTextColor 255 255 0";
|
||||
|
||||
|
||||
var blockTranslator = new ItemFilterBlockTranslator(_testUtility.MockBlockGroupHierarchyBuilder.Object);
|
||||
var translator = new ItemFilterScriptTranslator(blockTranslator,
|
||||
_testUtility.MockBlockGroupHierarchyBuilder.Object);
|
||||
|
||||
// Act
|
||||
var result = translator.TranslateStringToItemFilterScript(testInputScript);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(3, result.ItemFilterBlocks.Count);
|
||||
|
||||
var firstBlock = result.ItemFilterBlocks.First();
|
||||
var secondBlock = result.ItemFilterBlocks.Skip(1).First();
|
||||
var thirdBlock = result.ItemFilterBlocks.Skip(2).First();
|
||||
|
||||
Assert.AreEqual(3, firstBlock.BlockItems.Count);
|
||||
Assert.AreEqual(5, secondBlock.BlockItems.Count);
|
||||
Assert.AreEqual(3, thirdBlock.BlockItems.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TranslateStringToItemFilterScript_DisabledBlock_BlockDescriptionNotLost()
|
||||
{
|
||||
// Arrange
|
||||
var testInputScript = "Show" + Environment.NewLine +
|
||||
" ItemLevel > 2" + Environment.NewLine +
|
||||
" SetTextColor 255 40 0" + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"#Disabled Block Start" + Environment.NewLine +
|
||||
"# This is a disabled block" + Environment.NewLine +
|
||||
"#Show" + Environment.NewLine +
|
||||
"# ItemLevel > 2" + Environment.NewLine +
|
||||
"#Disabled Block End";
|
||||
|
||||
|
||||
var blockTranslator = new ItemFilterBlockTranslator(_testUtility.MockBlockGroupHierarchyBuilder.Object);
|
||||
var translator = new ItemFilterScriptTranslator(blockTranslator,
|
||||
_testUtility.MockBlockGroupHierarchyBuilder.Object);
|
||||
|
||||
// Act
|
||||
var result = translator.TranslateStringToItemFilterScript(testInputScript);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(2, result.ItemFilterBlocks.Count);
|
||||
var secondBlock = result.ItemFilterBlocks.Skip(1).First();
|
||||
Assert.AreEqual("This is a disabled block", secondBlock.Description);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TranslateStringToItemFilterScript_DisabledBlockWithBlockGroup_ReturnsCorrectBlock()
|
||||
{
|
||||
// Arrange
|
||||
var testInputScript = "Show" + Environment.NewLine +
|
||||
" ItemLevel > 2" + Environment.NewLine +
|
||||
" SetTextColor 255 40 0" + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"#Disabled Block Start" + Environment.NewLine +
|
||||
"# This is a disabled block" + Environment.NewLine +
|
||||
"#Show#My Block Group" + Environment.NewLine +
|
||||
"# ItemLevel > 2" + Environment.NewLine +
|
||||
"#Disabled Block End";
|
||||
|
||||
|
||||
var blockTranslator = new ItemFilterBlockTranslator(_testUtility.MockBlockGroupHierarchyBuilder.Object);
|
||||
_testUtility.MockBlockGroupHierarchyBuilder.Setup(
|
||||
b => b.IntegrateStringListIntoBlockGroupHierarchy(It.IsAny<IEnumerable<string>>()))
|
||||
.Returns(new ItemFilterBlockGroup("My Block Group", null));
|
||||
|
||||
var translator = new ItemFilterScriptTranslator(blockTranslator,
|
||||
_testUtility.MockBlockGroupHierarchyBuilder.Object);
|
||||
|
||||
// Act
|
||||
var result = translator.TranslateStringToItemFilterScript(testInputScript);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(2, result.ItemFilterBlocks.Count);
|
||||
var secondBlock = result.ItemFilterBlocks.Skip(1).First();
|
||||
Assert.AreEqual("This is a disabled block", secondBlock.Description);
|
||||
Assert.AreEqual("My Block Group", secondBlock.BlockGroup.GroupName);
|
||||
}
|
||||
|
||||
private class ItemFilterScriptTranslatorTestUtility
|
||||
{
|
||||
public ItemFilterScriptTranslatorTestUtility()
|
||||
{
|
||||
// Mock setups
|
||||
MockItemFilterBlockTranslator = new Mock<IItemFilterBlockTranslator>();
|
||||
MockBlockGroupHierarchyBuilder = new Mock<IBlockGroupHierarchyBuilder>();
|
||||
|
||||
// Class under test instantiation
|
||||
ScriptTranslator = new ItemFilterScriptTranslator(MockItemFilterBlockTranslator.Object, MockBlockGroupHierarchyBuilder.Object);
|
||||
}
|
||||
|
||||
public ItemFilterScriptTranslator ScriptTranslator { get; }
|
||||
public Mock<IItemFilterBlockTranslator> MockItemFilterBlockTranslator { get; }
|
||||
public Mock<IBlockGroupHierarchyBuilder> MockBlockGroupHierarchyBuilder { get; }
|
||||
}
|
||||
}
|
||||
}
|
||||
6
Filtration.Parser.Tests/packages.config
Normal file
6
Filtration.Parser.Tests/packages.config
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="FluentAssertions" version="4.2.1" targetFramework="net46" />
|
||||
<package id="Moq" version="4.2.1510.2205" targetFramework="net46" />
|
||||
<package id="NUnit" version="3.0.1" targetFramework="net46" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user