2 using ExpressionToCodeLib;
\r
3 using Microsoft.VisualStudio.TestTools.UnitTesting;
\r
5 namespace KancolleSniffer.Test
\r
8 public class BattleLogProcessorTest
\r
11 public void NormalLog()
\r
13 var input = Enumerable.Repeat("", 38).ToArray();
\r
14 input[5] = "T字戦(有利)";
\r
15 input[11] = "龍鳳改(Lv97)";
\r
17 input[13] = "夕立改(Lv148)";
\r
19 input[15] = "綾波改二(Lv148)";
\r
20 input[16] = "20/37";
\r
21 input[37] = "制空権確保";
\r
22 var result = BattleLogProcessor.Process(input).ToArray();
\r
23 PAssert.That(() => result[5] == "T字有利");
\r
24 PAssert.That(() => result[23] == "龍鳳改(Lv97)・夕立改(Lv148)");
\r
25 PAssert.That(() => result[38] == "確保");
\r
29 public void CombinedLog()
\r
31 var input = Enumerable.Repeat("", 38).ToArray();
\r
32 input[6] = "第四警戒航行序列";
\r
33 input[11] = "龍鳳改(Lv97)・夕立改(Lv148)";
\r
34 input[12] = "3/48・5/36";
\r
36 var result = BattleLogProcessor.Process(input).ToArray();
\r
37 PAssert.That(() => result[6] == "第四警戒");
\r
38 PAssert.That(() => result[23] == "龍鳳改(Lv97)・夕立改(Lv148)");
\r
39 PAssert.That(() => result[38] == "劣勢");
\r
43 public void NormalLogWithKana()
\r
45 var input = Enumerable.Repeat("", 38).ToArray();
\r
46 input[11] = "Luigi Torelli(ルイージ・トレッリ)(Lv7)";
\r
48 var result = BattleLogProcessor.Process(input).ToArray();
\r
49 PAssert.That(() => result[11] == "Luigi Torelli(Lv7)");
\r
50 PAssert.That(() => result[23] == "Luigi Torelli(Lv7)");
\r
54 public void Ship7BattleLog()
\r
58 "2017-11-20 20:59:39", "台湾沖/ルソン島沖", "1", "出撃", "S", "反航戦", "単横陣", "梯形陣", "深海潜水艦部隊 通商破壊Aライン", "", "",
\r
59 "あきつ丸改(Lv81)", "40/40", "那智改二(Lv151)", "63/63", "Roma改(Lv99)", "92/92", "阿武隈改二(Lv98)", "40/45",
\r
60 "霞改二(Lv96)", "31/31", "潮改二(Lv94)", "33/33", "龍驤改二(Lv99)", "50/50", "潜水カ級(flagship)", "0/37",
\r
61 "潜水カ級(flagship)", "0/37", "潜水カ級(elite)", "0/27", "潜水カ級(elite)", "0/27", "", "", "", "", "590", "0",
\r
64 var result = BattleLogProcessor.Process(input).ToArray();
\r
65 PAssert.That(() => result[21] == "潮改二(Lv94)・龍驤改二(Lv99)" &&
\r
66 result[22] == "33/33・50/50");
\r
67 PAssert.That(() => result.Length == 39);
\r