Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1 from kalilistic/develop
Browse files Browse the repository at this point in the history
Add multi-language and other adjustments
  • Loading branch information
kalilistic authored Jan 26, 2020
2 parents c329309 + 310fb59 commit 78f453a
Show file tree
Hide file tree
Showing 79 changed files with 3,175 additions and 1,467 deletions.
10 changes: 10 additions & 0 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 1
update_configs:
- package_manager: "dotnet:nuget"
directory: "/"
update_schedule: "live"
target_branch: "develop"
automerged_updates:
- match:
dependency_type: "all"
update_type: "all"
Binary file modified lib/Advanced Combat Tracker.exe
Binary file not shown.
Binary file modified lib/FFXIV_ACT_Plugin.Common.dll
Binary file not shown.
17 changes: 10 additions & 7 deletions src/Aetherbridge.Test/Aetherbridge.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Advanced Combat Tracker, Version=3.4.5.265, Culture=neutral, PublicKeyToken=a946b61e93d97868, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\Advanced Combat Tracker.exe</HintPath>
</Reference>
<Reference Include="FFXIV_ACT_Plugin.Common, Version=2.0.2.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\FFXIV_ACT_Plugin.Common.dll</HintPath>
Expand All @@ -46,8 +50,11 @@
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="LogLineParser\LogLineParser.LootEvent.Test.cs" />
<Compile Include="LogLineParser\LogLineParser.LogLine.Test.cs" />
<Compile Include="LogLineParser\JALogLineParserTest.cs" />
<Compile Include="LogLineParser\FRLogLineParserTest.cs" />
<Compile Include="LogLineParser\DELogLineParserTest.cs" />
<Compile Include="LogLineParser\ENLogLineParserTest.cs" />
<Compile Include="LogLineParser\LogLineParserBaseTest.cs" />
<Compile Include="LogLineParser\LogLineParserTestUtil.cs" />
<Compile Include="Mock\ACTPluginMock.cs" />
<Compile Include="Mock\ACTWrapperMock.cs" />
Expand All @@ -69,16 +76,12 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="CrescentCove">
<Version>0.1.3</Version>
</PackageReference>
<PackageReference Include="MSTest.TestAdapter">
<Version>1.3.2</Version>
<Version>0.1.6</Version>
</PackageReference>
<PackageReference Include="NUnit">
<Version>3.12.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup />
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
311 changes: 311 additions & 0 deletions src/Aetherbridge.Test/LogLineParser/DELogLineParserTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,311 @@
using ACT_FFXIV_Aetherbridge.Test.Mock;
using NUnit.Framework;

namespace ACT_FFXIV_Aetherbridge.Test.LogLineParser
{
[TestFixture]
public class DELogLineParserTest
{
private AetherbridgeMock _aetherbridge;
private ILogLineParser _parser;

[OneTimeSetUp]
public void SetUp()
{
var language = new Language(3, "German");
_aetherbridge = (AetherbridgeMock)AetherbridgeMock.GetInstance(language);
_aetherbridge.CurrentLanguage = language;
_aetherbridge.AddLanguage(language);
_parser = new DELogLineParser(_aetherbridge);
}

[OneTimeTearDown]
public void TearDown()
{
_aetherbridge.DeInit();
}

[Test]
public void Parse_LogLine_AddedLoot_Standard()
{
const string logLine =
@"[17:41:23.000] 00:0039:Ihr habt Beutegut (eine  YoRHa-Haube des Spähens Modell Nr. 51) erhalten.";
var logEvent = _parser.Parse(new ACTLogLineEvent {LogLine = logLine});
var lootEvent = logEvent.XIVEvent;
Assert.IsNotNull(logEvent.Id);
Assert.IsNotNull(logEvent.XIVEvent);
Assert.AreEqual("00", logEvent.LogCode);
Assert.AreEqual("0039", logEvent.GameLogCode);
Assert.AreEqual("17:41:23.000", logEvent.Timestamp);
Assert.AreEqual("Ihr habt Beutegut (eine YoRHa-Haube des Spähens Modell Nr. 51) erhalten.", logEvent.LogMessage);
Assert.AreEqual("YoRHa-Haube des Spähens Modell Nr. 51", lootEvent.Item.SingularName);
Assert.AreEqual(1, lootEvent.Item.Quantity);
Assert.AreEqual(false, lootEvent.Item.IsHQ);
}

[Test]
public void Parse_LogLine_LostLoot_Standard()
{
const string logLine = @"[23:13:29.000] 00:0039:Du konntest die  YoRHa-Jacke des Spähens Modell Nr. 51 nicht erhalten.";
var logEvent = _parser.Parse(new ACTLogLineEvent {LogLine = logLine});
var lootEvent = logEvent.XIVEvent;
Assert.IsNotNull(logEvent.Id);
Assert.IsNotNull(logEvent.XIVEvent);
Assert.AreEqual("00", logEvent.LogCode);
Assert.AreEqual("0039", logEvent.GameLogCode);
Assert.AreEqual("23:13:29.000", logEvent.Timestamp);
Assert.AreEqual("Du konntest die YoRHa-Jacke des Spähens Modell Nr. 51 nicht erhalten.", logEvent.LogMessage);
Assert.AreEqual("YoRHa-Jacke des Spähens Modell Nr. 51", lootEvent.Item.SingularName);
Assert.AreEqual(1, lootEvent.Item.Quantity);
Assert.AreEqual(false, lootEvent.Item.IsHQ);
}

[Test]
public void Parse_LogLine_ObtainsLoot_Standard()
{
const string logLine = @"[21:56:57.000] 00:083e:Du hast 1.000 Gil erhalten.";
var logEvent = _parser.Parse(new ACTLogLineEvent {LogLine = logLine});
var lootEvent = logEvent.XIVEvent;
Assert.IsNotNull(logEvent.Id);
Assert.IsNotNull(logEvent.XIVEvent);
Assert.AreEqual("00", logEvent.LogCode);
Assert.AreEqual("083e", logEvent.GameLogCode);
Assert.AreEqual("21:56:57.000", logEvent.Timestamp);
Assert.AreEqual("Combatant One hat 1.000 Gil erhalten.", logEvent.LogMessage);
Assert.AreEqual("Gil", lootEvent.Item.SingularName);
Assert.AreEqual(1000, lootEvent.Item.Quantity);
Assert.AreEqual(false, lootEvent.Item.IsHQ);
Assert.AreEqual("Combatant One", lootEvent.Actor.Name);
}

[Test]
public void Parse_LogLine_ObtainsLoot_BadItem()
{
const string logLine = @"[20:30:25.000] 00:0839:Du hast 1.000 Gills erhalten.";
var logEvent = _parser.Parse(new ACTLogLineEvent {LogLine = logLine});
Assert.IsNotNull(logEvent.Id);
Assert.IsNull(logEvent.XIVEvent);
}

[Test]
public void Parse_LogLine_ObtainsLoot_TheyObtain()
{
const string logLine =
@"[21:20:24.000] 00:103e:Blue Zoo hat einen  Heiltrank erhalten.";
var logEvent = _parser.Parse(new ACTLogLineEvent {LogLine = logLine});
var lootEvent = logEvent.XIVEvent;
Assert.IsNotNull(logEvent.Id);
Assert.IsNotNull(logEvent.XIVEvent);
Assert.AreEqual("00", logEvent.LogCode);
Assert.AreEqual("103e", logEvent.GameLogCode);
Assert.AreEqual("21:20:24.000", logEvent.Timestamp);
Assert.AreEqual("Blue Zoo hat einen Heiltrank erhalten.", logEvent.LogMessage);
Assert.AreEqual("Heiltrank", lootEvent.Item.SingularName);
Assert.AreEqual(1, lootEvent.Item.Quantity);
Assert.AreEqual(false, lootEvent.Item.IsHQ);
Assert.AreEqual("Blue Zoo", lootEvent.Actor.Name);
}

[Test]
public void Parse_LogLine_ObtainsLoot_YouObtain()
{
const string logLine = @"[16:35:53.000] 00:083e:Du hast  Die Brennende Sonne erhalten.";
var logEvent = _parser.Parse(new ACTLogLineEvent {LogLine = logLine});
var lootEvent = logEvent.XIVEvent;
Assert.IsNotNull(logEvent.Id);
Assert.IsNotNull(logEvent.XIVEvent);
Assert.AreEqual("00", logEvent.LogCode);
Assert.AreEqual("083e", logEvent.GameLogCode);
Assert.AreEqual("16:35:53.000", logEvent.Timestamp);
Assert.AreEqual("Combatant One hat Die Brennende Sonne erhalten.", logEvent.LogMessage);
Assert.AreEqual("Die Brennende Sonne", lootEvent.Item.SingularName);
Assert.AreEqual(1, lootEvent.Item.Quantity);
Assert.AreEqual(false, lootEvent.Item.IsHQ);
Assert.AreEqual("Combatant One", lootEvent.Actor.Name);
}

[Test]
public void Parse_LogLine_ObtainsLoot_YouObtain_MultipleItems()
{
const string logLine = @"[21:23:42.000] 00:083e:Du hast 20 Allagische Steine der Goëtie erhalten.";
var logEvent = _parser.Parse(new ACTLogLineEvent {LogLine = logLine});
var lootEvent = logEvent.XIVEvent;
Assert.IsNotNull(logEvent.Id);
Assert.IsNotNull(logEvent.XIVEvent);
Assert.AreEqual("00", logEvent.LogCode);
Assert.AreEqual("083e", logEvent.GameLogCode);
Assert.AreEqual("21:23:42.000", logEvent.Timestamp);
Assert.AreEqual("Combatant One hat 20 Allagische Steine der Goëtie erhalten.", logEvent.LogMessage);
Assert.AreEqual("Allagisch Steine der Goëtie", lootEvent.Item.PluralName);
Assert.AreEqual(20, lootEvent.Item.Quantity);
Assert.AreEqual(false, lootEvent.Item.IsHQ);
Assert.AreEqual("Combatant One", lootEvent.Actor.Name);
}

[Test]
public void Parse_LogLine_ObtainsLoot_ItemsMostRare()
{
const string logLine =
@"[16:35:53.000] 00:083e:Du findest und erhältst 2  Töpfe dunkelgrünen Farbstoffs - ein höchst seltener Fund!";
var logEvent = _parser.Parse(new ACTLogLineEvent {LogLine = logLine});
var lootEvent = logEvent.XIVEvent;
Assert.IsNotNull(logEvent.Id);
Assert.IsNotNull(logEvent.XIVEvent);
Assert.AreEqual("00", logEvent.LogCode);
Assert.AreEqual("083e", logEvent.GameLogCode);
Assert.AreEqual("16:35:53.000", logEvent.Timestamp);
Assert.AreEqual("Combatant One hat 2 Töpfe dunkelgrünen Farbstoffs.", logEvent.LogMessage);
Assert.AreEqual("Topf dunkelgrünen Farbstoffs", lootEvent.Item.SingularName);
Assert.AreEqual(2, lootEvent.Item.Quantity);
Assert.AreEqual(false, lootEvent.Item.IsHQ);
Assert.AreEqual("Combatant One", lootEvent.Actor.Name);
}

[Test]
public void Parse_LogLine_ObtainsLoot_ItemMostRare()
{
const string logLine =
@"[21:56:57.000] 00:083e:Du findest und erhältst eine  Sammlersinn-Materia VII - ein höchst seltener Gegenstand!";
var logEvent = _parser.Parse(new ACTLogLineEvent {LogLine = logLine});
var lootEvent = logEvent.XIVEvent;
Assert.IsNotNull(logEvent.Id);
Assert.IsNotNull(logEvent.XIVEvent);
Assert.AreEqual("00", logEvent.LogCode);
Assert.AreEqual("083e", logEvent.GameLogCode);
Assert.AreEqual("21:56:57.000", logEvent.Timestamp);
Assert.AreEqual("Combatant One hat Sammlersinn-Materia VII.", logEvent.LogMessage);
Assert.AreEqual("Sammlersinn-Materia VII", lootEvent.Item.SingularName);
Assert.AreEqual(1, lootEvent.Item.Quantity);
Assert.AreEqual(false, lootEvent.Item.IsHQ);
Assert.AreEqual("Combatant One", lootEvent.Actor.Name);
}

[Test]
public void Parse_LogLine_ObtainsLoot_HQ()
{
const string logLine =
@"[21:56:57.000] 00:083e:Du hast ein  Megalokrabbenbein  erhalten.";
var logEvent = _parser.Parse(new ACTLogLineEvent {LogLine = logLine});
var lootEvent = logEvent.XIVEvent;
Assert.IsNotNull(logEvent.Id);
Assert.IsNotNull(logEvent.XIVEvent);
Assert.AreEqual("00", logEvent.LogCode);
Assert.AreEqual("083e", logEvent.GameLogCode);
Assert.AreEqual("21:56:57.000", logEvent.Timestamp);
Assert.AreEqual("Combatant One hat ein Megalokrabbenbein (HQ) erhalten.", logEvent.LogMessage);
Assert.AreEqual("Megalokrabbenbein", lootEvent.Item.SingularName);
Assert.AreEqual(1, lootEvent.Item.Quantity);
Assert.AreEqual(true, lootEvent.Item.IsHQ);
Assert.AreEqual("Combatant One", lootEvent.Actor.Name);
}


[Test]
public void Parse_LogLine_GreedLoot_YouRoll()
{
const string logLine =
@"[23:03:55.000] 00:0841:Du würfelst mit „Gier“ eine 28 auf die Notenrolle von „Alien Manifestation“.";
var logEvent = _parser.Parse(new ACTLogLineEvent {LogLine = logLine});
var lootEvent = logEvent.XIVEvent;
Assert.IsNotNull(logEvent.Id);
Assert.IsNotNull(logEvent.XIVEvent);
Assert.AreEqual("00", logEvent.LogCode);
Assert.AreEqual("0841", logEvent.GameLogCode);
Assert.AreEqual("23:03:55.000", logEvent.Timestamp);
Assert.AreEqual("Combatant One würfelt mit „Gier“ eine 28 auf die Notenrolle von „Alien Manifestation“.",
logEvent.LogMessage);
Assert.AreEqual("Notenrolle von „Alien Manifestation“", lootEvent.Item.SingularName);
Assert.AreEqual(1, lootEvent.Item.Quantity);
Assert.AreEqual(false, lootEvent.Item.IsHQ);
}

[Test]
public void Parse_LogLine_NeedLoot_YouRoll()
{
const string logLine = @"[23:12:36.000] 00:0841:Du würfelst mit „Bedarf“ eine 28 auf die Notenrolle von „Alien Manifestation“.";
var logEvent = _parser.Parse(new ACTLogLineEvent {LogLine = logLine});
var lootEvent = logEvent.XIVEvent;
Assert.IsNotNull(logEvent.Id);
Assert.IsNotNull(logEvent.XIVEvent);
Assert.AreEqual("00", logEvent.LogCode);
Assert.AreEqual("0841", logEvent.GameLogCode);
Assert.AreEqual("23:12:36.000", logEvent.Timestamp);
Assert.AreEqual("Combatant One würfelt mit „Bedarf“ eine 28 auf die Notenrolle von „Alien Manifestation“.",
logEvent.LogMessage);
Assert.AreEqual("Notenrolle von „Alien Manifestation“", lootEvent.Item.SingularName);
Assert.AreEqual(1, lootEvent.Item.Quantity);
Assert.AreEqual(false, lootEvent.Item.IsHQ);
}

[Test]
public void Parse_LogLine_ObtainsLoot_MultipleWorlds()
{
const string logLine = @"[17:37:35.000] 00:103e:John GilgameshSiren hat ein  Paar YoRHa-Handschuhe der Heilung Modell Nr. 51 erhalten.";
var logEvent = _parser.Parse(new ACTLogLineEvent {LogLine = logLine});
var lootEvent = logEvent.XIVEvent;
Assert.IsNotNull(logEvent.Id);
Assert.IsNotNull(logEvent.XIVEvent);
Assert.AreEqual("00", logEvent.LogCode);
Assert.AreEqual("103e", logEvent.GameLogCode);
Assert.AreEqual("17:37:35.000", logEvent.Timestamp);
Assert.AreEqual("John Gilgamesh hat ein Paar YoRHa-Handschuhe der Heilung Modell Nr. 51 erhalten.", logEvent.LogMessage);
Assert.AreEqual("Paar YoRHa-Handschuhe der Heilung Modell Nr. 51", lootEvent.Item.PluralName);
Assert.AreEqual(1, lootEvent.Item.Quantity);
Assert.AreEqual(false, lootEvent.Item.IsHQ);
Assert.AreEqual("John Gilgamesh", lootEvent.Actor.Name);
}

[Test]
public void Parse_LogLine_GreedLoot_TheyRoll()
{
const string logLine = @"[23:08:44.000] 00:1041:Blue Zoo würfelt mit „Bedarf“ eine 80 auf die  9S-Karte.";
var logEvent = _parser.Parse(new ACTLogLineEvent {LogLine = logLine});
var lootEvent = logEvent.XIVEvent;
Assert.IsNotNull(logEvent.Id);
Assert.IsNotNull(logEvent.XIVEvent);
Assert.AreEqual("00", logEvent.LogCode);
Assert.AreEqual("1041", logEvent.GameLogCode);
Assert.AreEqual("23:08:44.000", logEvent.Timestamp);
Assert.AreEqual("Blue Zoo würfelt mit „Bedarf“ eine 80 auf die 9S-Karte.", logEvent.LogMessage);
Assert.AreEqual("9S-Karte", lootEvent.Item.SingularName);
Assert.AreEqual(1, lootEvent.Item.Quantity);
Assert.AreEqual(false, lootEvent.Item.IsHQ);
}

[Test]
public void Parse_LogLine_NeedLoot_TheyRoll()
{
const string logLine = @"[23:08:44.000] 00:1041:Blue Zoo würfelt mit „Gier“ eine 80 auf die  9S-Karte.";
var logEvent = _parser.Parse(new ACTLogLineEvent {LogLine = logLine});
var lootEvent = logEvent.XIVEvent;
Assert.IsNotNull(logEvent.Id);
Assert.IsNotNull(logEvent.XIVEvent);
Assert.AreEqual("00", logEvent.LogCode);
Assert.AreEqual("1041", logEvent.GameLogCode);
Assert.AreEqual("23:08:44.000", logEvent.Timestamp);
Assert.AreEqual("Blue Zoo würfelt mit „Gier“ eine 80 auf die 9S-Karte.", logEvent.LogMessage);
Assert.AreEqual("9S-Karte", lootEvent.Item.SingularName);
Assert.AreEqual(1, lootEvent.Item.Quantity);
Assert.AreEqual(false, lootEvent.Item.IsHQ);
}

[Test]
public void Parse_LogLine_NeedLoot_MultipleItems()
{
const string logLine =
@"[22:07:14.000] 00:1041:Blue Zoo würfelt mit „Gier“ eine 80 auf die 2  9S-Karten.";
var logEvent = _parser.Parse(new ACTLogLineEvent {LogLine = logLine});
var lootEvent = logEvent.XIVEvent;
Assert.IsNotNull(logEvent.Id);
Assert.IsNotNull(logEvent.XIVEvent);
Assert.AreEqual("00", logEvent.LogCode);
Assert.AreEqual("1041", logEvent.GameLogCode);
Assert.AreEqual("22:07:14.000", logEvent.Timestamp);
Assert.AreEqual("Blue Zoo würfelt mit „Gier“ eine 80 auf die 2 9S-Karten.", logEvent.LogMessage);
Assert.AreEqual("9S-Karte", lootEvent.Item.SingularName);
Assert.AreEqual(2, lootEvent.Item.Quantity);
Assert.AreEqual(false, lootEvent.Item.IsHQ);
}

}
}
Loading

0 comments on commit 78f453a

Please sign in to comment.