-using System.Linq;\r
+// Copyright (C) 2018 Kazuhiro Fujieda <fujieda@users.osdn.me>\r
+//\r
+// Licensed under the Apache License, Version 2.0 (the "License");\r
+// you may not use this file except in compliance with the License.\r
+// You may obtain a copy of the License at\r
+//\r
+// http://www.apache.org/licenses/LICENSE-2.0\r
+//\r
+// Unless required by applicable law or agreed to in writing, software\r
+// distributed under the License is distributed on an "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+// See the License for the specific language governing permissions and\r
+// limitations under the License.\r
+\r
+using System.Collections.Generic;\r
+using System.Linq;\r
using ExpressionToCodeLib;\r
+using KancolleSniffer.Log;\r
using Microsoft.VisualStudio.TestTools.UnitTesting;\r
\r
namespace KancolleSniffer.Test\r
input[15] = "綾波改二(Lv148)";\r
input[16] = "20/37";\r
input[37] = "制空権確保";\r
- var result = BattleLogProcessor.Process(input).ToArray();\r
+ var result = new BattleLogProcessor().Process(input);\r
PAssert.That(() => result[5] == "T字有利");\r
- PAssert.That(() => result[23] == "龍鳳改(Lv97)・夕立改(Lv148)");\r
- PAssert.That(() => result[38] == "確保");\r
+ PAssert.That(() => result[37] == "確保");\r
+ PAssert.That(() => result[38] == "龍鳳改(Lv97)・夕立改(Lv148)");\r
}\r
\r
[TestMethod]\r
input[11] = "龍鳳改(Lv97)・夕立改(Lv148)";\r
input[12] = "3/48・5/36";\r
input[37] = "航空劣勢";\r
- var result = BattleLogProcessor.Process(input).ToArray();\r
+ var result = new BattleLogProcessor().Process(input);\r
PAssert.That(() => result[6] == "第四警戒");\r
- PAssert.That(() => result[23] == "龍鳳改(Lv97)・夕立改(Lv148)");\r
- PAssert.That(() => result[38] == "劣勢");\r
+ PAssert.That(() => result[37] == "劣勢");\r
+ PAssert.That(() => result[38] == "龍鳳改(Lv97)・夕立改(Lv148)");\r
+\r
+ }\r
+\r
+ [TestMethod]\r
+ public void CombinedUnbalanceLog()\r
+ {\r
+ var input = Enumerable.Repeat("", 38).ToArray();\r
+ input[11] = "龍鳳改(Lv97)・";\r
+ input[12] = "3/48・";\r
+ input[13] = "・夕立改(Lv148)";\r
+ input[14] = "・5/36";\r
+ var result = new BattleLogProcessor().Process(input);\r
+ PAssert.That(() => result[38] == "龍鳳改(Lv97)・夕立改(Lv148)");\r
}\r
\r
[TestMethod]\r
var input = Enumerable.Repeat("", 38).ToArray();\r
input[11] = "Luigi Torelli(ルイージ・トレッリ)(Lv7)";\r
input[12] = "2/11";\r
- var result = BattleLogProcessor.Process(input).ToArray();\r
+ var result = new BattleLogProcessor().Process(input);\r
PAssert.That(() => result[11] == "Luigi Torelli(Lv7)");\r
- PAssert.That(() => result[23] == "Luigi Torelli(Lv7)");\r
+ PAssert.That(() => result[38] == "Luigi Torelli(Lv7)");\r
}\r
\r
[TestMethod]\r
"潜水カ級(flagship)", "0/37", "潜水カ級(elite)", "0/27", "潜水カ級(elite)", "0/27", "", "", "", "", "590", "0",\r
"制空権確保"\r
};\r
- var result = BattleLogProcessor.Process(input).ToArray();\r
+ var result = new BattleLogProcessor().Process(input);\r
PAssert.That(() => result[21] == "潮改二(Lv94)・龍驤改二(Lv99)" &&\r
result[22] == "33/33・50/50");\r
- PAssert.That(() => result.Length == 39);\r
+ PAssert.That(() => result.Length == 40);\r
+ }\r
+\r
+ [TestMethod]\r
+ public void AddMapNumber()\r
+ {\r
+ var input = Enumerable.Repeat("", 38).ToArray();\r
+ input[1] = "サーモン海域";\r
+ var result = new BattleLogProcessor(new Dictionary<string, string> {{"サーモン海域", "5-4"}}).Process(input);\r
+ PAssert.That(() => result[39] == "5-4");\r
}\r
}\r
}
\ No newline at end of file