using System.IO.Compression;\r
using System.Linq;\r
using ExpressionToCodeLib;\r
+using KancolleSniffer.Model;\r
+using KancolleSniffer.Util;\r
using Microsoft.VisualStudio.TestTools.UnitTesting;\r
+using static System.Math;\r
\r
namespace KancolleSniffer.Test\r
{\r
+ using Sniffer = SnifferTest.TestingSniffer;\r
+\r
[TestClass]\r
public class SnifferTest\r
{\r
+ [ClassInitialize]\r
+ public static void Initialize(TestContext context)\r
+ {\r
+ ExpressionToCodeConfiguration.GlobalAssertionConfiguration = ExpressionToCodeConfiguration\r
+ .GlobalAssertionConfiguration.WithPrintedListLengthLimit(200).WithMaximumValueLength(1000);\r
+ }\r
+\r
+ public class TestingSniffer : KancolleSniffer.Sniffer\r
+ {\r
+ public TestingSniffer(bool start = false) : base(start)\r
+ {\r
+ AdditionalData.UseNumEquipsFile = false;\r
+ }\r
+ }\r
+\r
public static StreamReader OpenLogFile(string name)\r
{\r
var dir = Path.GetDirectoryName(Path.GetDirectoryName(Environment.CurrentDirectory));\r
var triple = new List<string>();\r
foreach (var s in new[] {"url: ", "request: ", "response: "})\r
{\r
- var line = stream.ReadLine();\r
- ln++;\r
- if (line == null)\r
- throw new Exception($"ログのurl, request, responseがそろっていません: {ln:d}行目");\r
- if (!line.StartsWith(s))\r
- throw new Exception($"ログに不正な行が含まれています: {ln:d}行目");\r
+ string line;\r
+ do\r
+ {\r
+ line = stream.ReadLine();\r
+ ln++;\r
+ if (line == null)\r
+ throw new Exception($"ログの内容がそろっていません: {ln:d}行目");\r
+ } while (!line.StartsWith(s));\r
triple.Add(line.Substring(s.Length));\r
}\r
var json = JsonParser.Parse(triple[2]);\r
}\r
\r
/// <summary>\r
- /// 演習で受けたダメージが次の戦闘の結果に影響しない\r
- /// </summary>\r
- [TestMethod]\r
- public void DamageInPracticeNotSpillIntoSortie()\r
- {\r
- var expected = new[] {31, 15, 15};\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "battle_001");\r
- var result = sniffer.GetShipStatuses(0).Select(s => s.NowHp);\r
- PAssert.That(() => (expected.SequenceEqual(result)));\r
- }\r
-\r
- /// <summary>\r
- /// 演習では大破警告を出さない\r
- /// </summary>\r
- [TestMethod]\r
- public void IgnoreDamagedShipsInPractice()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "practice_001");\r
- PAssert.That(() => !sniffer.BadlyDamagedShips.Any());\r
- }\r
-\r
- /// <summary>\r
- /// 夜戦のダメージを戦闘結果に反映する\r
- /// </summary>\r
- [TestMethod]\r
- public void CaptureDamageInNightCombat()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "battle_002");\r
- AssertEqualBattleResult(sniffer, new[] {28, 1, 13});\r
- PAssert.That(() => sniffer.BadlyDamagedShips.Any());\r
- }\r
-\r
- private void AssertEqualBattleResult(Sniffer sniffer, IEnumerable<int> expected, string msg = null)\r
- {\r
- var result = sniffer.GetShipStatuses(0).Select(s => s.NowHp);\r
- PAssert.That(() => (expected.SequenceEqual(result)), msg);\r
- }\r
-\r
- /// <summary>\r
- /// 連合艦隊(水上打撃部隊)による戦闘のダメージを結果に反映する\r
- /// </summary>\r
- [TestMethod]\r
- public void CombinedFleetSurface()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "combined_surface_001");\r
- AssertEauqlCombinedResult(sniffer, new[] {40, 77, 77, 33, 51, 47}, new[] {39, 35, 11, 39, 37, 40});\r
- PAssert.That(() => !sniffer.BadlyDamagedShips.Any());\r
-\r
- SniffLogFile(sniffer, "combined_surface_002");\r
- AssertEauqlCombinedResult(sniffer, new[] {40, 77, 77, 33, 15, 6}, new[] {39, 35, 4, 3, 14, 40});\r
- PAssert.That(() => sniffer.BadlyDamagedShips.Any());\r
- }\r
-\r
- private void AssertEauqlCombinedResult(Sniffer sniffer, IEnumerable<int> expected0, IEnumerable<int> expected1,\r
- string msg = null)\r
- {\r
- var result0 = sniffer.GetShipStatuses(0).Select(s => s.NowHp);\r
- var result1 = sniffer.GetShipStatuses(1).Select(s => s.NowHp);\r
- PAssert.That(() => (expected0.SequenceEqual(result0) && expected1.SequenceEqual(result1)), msg);\r
- }\r
-\r
- /// <summary>\r
- /// 開幕夜戦のダメージを戦闘結果に反映する\r
- /// </summary>\r
- [TestMethod]\r
- public void SpMidnight()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "sp_midnight_001");\r
- AssertEqualBattleResult(sniffer, new[] {1});\r
- PAssert.That(() => sniffer.BadlyDamagedShips.Any());\r
- }\r
-\r
- /// <summary>\r
- /// 連合艦隊(空母機動部隊)による戦闘のダメージを結果に反映する\r
- /// </summary>\r
- [TestMethod]\r
- public void CombinedFleetAir()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "combined_air_001");\r
- AssertEauqlCombinedResult(sniffer, new[] {40, 98, 90, 66, 78, 86}, new[] {47, 41, 5, 42, 43, 29});\r
- PAssert.That(() => sniffer.BadlyDamagedShips.Any());\r
-\r
- SniffLogFile(sniffer, "combined_air_002");\r
- AssertEauqlCombinedResult(sniffer, new[] {13, 87, 90, 59, 69, 86}, new[] {47, 41, 5, 20, 43, 29});\r
- }\r
-\r
- /// <summary>\r
- /// 護衛退避を正しく処理する\r
- /// </summary>\r
- [TestMethod]\r
- public void EscapeShip()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "combined_escape_001");\r
- AssertEauqlCombinedResult(sniffer, new[] {37, 105, 106, 90, 66, 10}, new[] {41, 41, 37, 44, 43, 43},\r
- "連合艦隊で2戦して大破が出るまで");\r
- PAssert.That(() => sniffer.BadlyDamagedShips.Any());\r
- SniffLogFile(sniffer, "combined_escape_002");\r
- PAssert.That(() => sniffer.GetShipStatuses(0)[5].Escaped && sniffer.GetShipStatuses(1)[1].Escaped,\r
- "続けて護衛退避を実行");\r
- PAssert.That(() => !sniffer.BadlyDamagedShips.Any());\r
- SniffLogFile(sniffer, "combined_escape_003");\r
- AssertEauqlCombinedResult(sniffer, new[] {37, 105, 106, 90, 1, 10}, new[] {41, 41, 32, 44, 43, 43},\r
- "もう一戦して大破が出るまで");\r
- PAssert.That(() => sniffer.BadlyDamagedShips.Any());\r
- SniffLogFile(sniffer, "combined_escape_004");\r
- PAssert.That(() => sniffer.GetShipStatuses(0)[5].Escaped && sniffer.GetShipStatuses(1)[1].Escaped &&\r
- sniffer.GetShipStatuses(0)[4].Escaped && sniffer.GetShipStatuses(1)[2].Escaped,\r
- "続けて護衛退避を実行");\r
- PAssert.That(() => !sniffer.BadlyDamagedShips.Any());\r
- }\r
-\r
- /// <summary>\r
- /// 護衛退避した空母を除いた制空値を計算する\r
- /// </summary>\r
- [TestMethod]\r
- public void FighterPowerWithoutEscapedShip()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "combined_escape_001");\r
- PAssert.That(() => sniffer.GetFighterPower(0)[0] == 187);\r
- SniffLogFile(sniffer, "combined_escape_002");\r
- PAssert.That(() => sniffer.GetFighterPower(0)[0] == 65);\r
- }\r
-\r
- /// <summary>\r
- /// 護衛退避した艦娘を除いて勝利判定を計算する\r
- /// </summary>\r
- [TestMethod]\r
- public void BattleResultRankWithEscapedShip()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "combined_escape_005");\r
- PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.D);\r
- }\r
-\r
-\r
- /// <summary>\r
- /// 夜戦の開始時に昼戦の結果を反映する\r
- /// </summary>\r
- [TestMethod]\r
- public void ResultOfDayBattleShowInNightBattle()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "battle_003");\r
- AssertEqualBattleResult(sniffer, new[] {28, 2, 13});\r
- PAssert.That(() => !sniffer.BadlyDamagedShips.Any(), "夜戦の開始時は大破警告を出さない");\r
- }\r
-\r
- /// <summary>\r
- /// 通常艦隊の航空戦のダメージを結果に反映する\r
- /// </summary>\r
- [TestMethod]\r
- public void AirBattle()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "airbattle_001");\r
- AssertEqualBattleResult(sniffer, new[] {37, 36, 31, 37, 17, 63}, "夜戦あり");\r
-\r
- sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "airbattle_002");\r
- AssertEqualBattleResult(sniffer, new[] {66, 36, 16, 27, 35, 38}, "昼戦のみ");\r
- }\r
-\r
- /// <summary>\r
- /// 支援射撃による敵の損傷を勝利判定に反映させる\r
- /// </summary>\r
- [TestMethod]\r
- public void SupportShellingChangeResultRank()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "support_001");\r
- PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.A);\r
- }\r
-\r
- /// <summary>\r
- /// ダメコンの使用を戦闘結果に反映させる\r
- /// </summary>\r
- [TestMethod]\r
- public void DamageControl()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "damecon_001");\r
- AssertEqualBattleResult(sniffer, new[] {30, 1, 3}, "戦闘前");\r
- PAssert.That(() => sniffer.GetShipStatuses(0)[1].Slot.Select(item => item.Id).\r
- SequenceEqual(new[] {2, 4593, -1, -1, -1}), "ダメコンを二つ装備");\r
- PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.P, "判定は完全勝利");\r
- SniffLogFile(sniffer, "damecon_002");\r
- AssertEqualBattleResult(sniffer, new[] {30, 1, 3}, "戦闘後");\r
- PAssert.That(() => sniffer.GetShipStatuses(0)[1].Slot.Select(item => item.Id).\r
- SequenceEqual(new[] {-1, 4593, -1, -1, -1}), "ダメコンを一つ消費");\r
- }\r
-\r
- /// <summary>\r
- /// 補強装備スロットのダメコンの使用を反映する\r
- /// </summary>\r
- [TestMethod]\r
- public void DamgeControlInSlotEx()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "damecon_003");\r
- PAssert.That(() => sniffer.GetShipStatuses(0)[5].SlotEx.Id == 10306, "戦闘前");\r
- SniffLogFile(sniffer, "damecon_004");\r
- PAssert.That(() => sniffer.GetShipStatuses(0)[5].SlotEx.Id == -1, "戦闘後");\r
- }\r
-\r
- /// <summary>\r
- /// 旗艦大破で女神を使った進撃を反映する\r
- /// </summary>\r
- [TestMethod]\r
- public void DamageControlForFlagShip()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "damecon_005");\r
- var fs = sniffer.GetShipStatuses(0)[0];\r
- PAssert.That(() => fs.SlotEx.Id == -1);\r
- PAssert.That(() => fs.NowHp == fs.MaxHp);\r
- PAssert.That(() => sniffer.BadlyDamagedShips.Length == 0);\r
- }\r
-\r
- /// <summary>\r
- /// 戦闘開始時に大破艦がいても夜戦突入時に警告を出さない\r
- /// </summary>\r
- [TestMethod]\r
- public void NotWarnDamagedShipOnRunIntoNightBattle()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "damecon_006");\r
- PAssert.That(() => sniffer.BadlyDamagedShips.Length == 0);\r
- }\r
-\r
- /// <summary>\r
- /// 連合艦隊(水上打撃部隊)で二回目の砲撃戦がない場合を正しく処理する\r
- /// </summary>\r
- [TestMethod]\r
- // ReSharper disable once InconsistentNaming\r
- public void CombinedFleetSurfaceWithout2ndShelling()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "combined_surface_003");\r
- PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.P);\r
- }\r
-\r
- /// <summary>\r
- /// 連合艦隊(水上打撃部隊)で開幕雷撃で戦闘が終わる場合を正しく処理する\r
- /// </summary>\r
- [TestMethod]\r
- // ReSharper disable once InconsistentNaming\r
- public void CombinedFleetSurfaceWithoutAnyShelling()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "combined_surface_004");\r
- PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.P);\r
- }\r
-\r
- /// <summary>\r
- /// ship2に代わるship_deckを処理する\r
- /// </summary>\r
- [TestMethod]\r
- public void ShipDeck()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "ship_deck_001");\r
- PAssert.That(() => sniffer.GetShipStatuses(0)[0].Fuel == 36);\r
- }\r
-\r
- /// <summary>\r
- /// 夜戦かどうかを選択する画面でリロードしても結果を次の戦闘に持ち越さない\r
- /// </summary>\r
- [TestMethod]\r
- public void ReloadBeforeBattleResult()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "reload_001");\r
- PAssert.That(() => sniffer.GetShipStatuses(0)[0].NowHp == 41);\r
- }\r
-\r
- /// <summary>\r
- /// 航空戦のない演習を正しく処理する\r
- /// </summary>\r
- [TestMethod]\r
- public void PracticeWithoutAirBattle()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "practice_002");\r
- PAssert.That(() => sniffer.Battle.AirControlLevel == -1);\r
- }\r
-\r
- /// <summary>\r
- /// 出撃時に大破している艦娘がいたら警告する\r
- /// </summary>\r
- [TestMethod]\r
- public void DamagedShipWarningOnMapStart()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "mapstart_001");\r
- PAssert.That(() => sniffer.BadlyDamagedShips.SequenceEqual(new[] {"大潮"}));\r
- }\r
-\r
- /// <summary>\r
- /// 連合艦隊に大破艦がいる状態で第3艦隊が出撃したときに警告しない\r
+ /// 熟練度込みの制空値を正しく計算する\r
/// </summary>\r
[TestMethod]\r
- public void NotWarnDamagedShipInCombinedFleetOnMapStart()\r
+ public void FighterPowerWithBonus()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "mapstart_002");\r
- PAssert.That(() => !sniffer.BadlyDamagedShips.Any());\r
+ SniffLogFile(sniffer, "fighterpower_001");\r
+ var fleet = sniffer.Fleets[0];\r
+ PAssert.That(() => fleet.FighterPower.SequenceEqual(new[] {156, 159}));\r
+ SniffLogFile(sniffer, "fighterpower_002");\r
+ PAssert.That(() => fleet.FighterPower.SequenceEqual(new[] {140, 143}), "全滅したスロットがある");\r
}\r
\r
/// <summary>\r
- /// 先制対潜攻撃を正しく処理する\r
+ /// 改修効果込みの制空値を正しく計算する\r
/// </summary>\r
[TestMethod]\r
- public void OpeningTaisen()\r
+ public void FighterPowerWithImprovement()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "opening_taisen_001");\r
- PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.P);\r
+ SniffLogFile(sniffer, "fighterpower_003");\r
+ PAssert.That(() => sniffer.Fleets[0].FighterPower.SequenceEqual(new[] {135, 135}));\r
}\r
\r
/// <summary>\r
- /// 敵の空スロットの値が-1ではなく0のときにエラーにならない\r
+ /// 基地航空隊の制空値を正しく計算する\r
/// </summary>\r
[TestMethod]\r
- public void ZeroValueEmptySlot()\r
+ public void FighterPowerOfBaseAirCorps()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "battle_006");\r
- PAssert.That(() => sniffer.Battle.EnemyFighterPower == "0");\r
+ SniffLogFile(sniffer, "baseaircorps_001");\r
+ PAssert.That(() => sniffer.BaseAirCorps[0].AirCorps[0].FighterPower.AirCombat[1] == 301);\r
+ sniffer.BaseAirCorps[0].AirCorps[0].Action = 2; // 防空\r
+ PAssert.That(() => sniffer.BaseAirCorps[0].AirCorps[0].FighterPower.Interception[1] == 320);\r
}\r
\r
/// <summary>\r
- /// 熟練度込みの制空値を正しく計算する\r
+ /// 基地航空隊の防空時の偵察機補正を含む制空値を計算する\r
/// </summary>\r
[TestMethod]\r
- public void FighterPowerWithBonus()\r
+ public void FighterPowerWithReconBonus()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "fighterpower_001");\r
- PAssert.That(() => sniffer.GetFighterPower(0).SequenceEqual(new[] {156, 159}));\r
- SniffLogFile(sniffer, "fighterpower_002");\r
- PAssert.That(() => sniffer.GetFighterPower(0).SequenceEqual(new[] {140, 143}), "全滅したスロットがある");\r
+ SniffLogFile(sniffer, "baseaircorps_002");\r
+ PAssert.That(() => sniffer.BaseAirCorps[0].AirCorps[2].FighterPower.Interception[0] == 353);\r
}\r
\r
/// <summary>\r
- /// 改修効果込みの制空値を正しく計算する\r
+ /// 陸上攻撃機の熟練度を制空値に反映させる\r
/// </summary>\r
[TestMethod]\r
- public void FighterPowerWithImprovement()\r
+ public void FighterPowerOfLandBasedAttackAircraft()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "fighterpower_003");\r
- PAssert.That(() => sniffer.GetFighterPower(0).SequenceEqual(new [] {135, 135}));\r
+ SniffLogFile(sniffer, "baseaircorps_003");\r
+ PAssert.That(() => sniffer.BaseAirCorps[1].AirCorps[0].FighterPower.AirCombat[0] == 121);\r
}\r
\r
/// <summary>\r
- /// å\9fºå\9c°è\88ªç©ºé\9a\8aã\81®å\88¶ç©ºå\80¤ã\82\92æ£ã\81\97ã\81\8f計算する\r
+ /// å\9fºå\9c°è\88ªç©ºé\9a\8aã\81®å\87ºæ\92\83ã\82³ã\82¹ã\83\88ã\82\92計算する\r
/// </summary>\r
[TestMethod]\r
- public void FighterPowerOfBaseAirCorps()\r
+ public void CostForSortieOfBaseAirCorps()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "baseaircorps_001");\r
- PAssert.That(() => sniffer.BaseAirCorps[0].AirCorps[0].FighterPower[1] == 301);\r
- sniffer.BaseAirCorps[0].AirCorps[0].Action = 2; // 防空\r
- PAssert.That(()=>sniffer.BaseAirCorps[0].AirCorps[0].FighterPower[1] == 320);\r
+ SniffLogFile(sniffer, "baseaircorps_003");\r
+ PAssert.That(() => sniffer.BaseAirCorps[1].AirCorps[0].CostForSortie.SequenceEqual(new[] {99, 47}));\r
}\r
\r
/// <summary>\r
- /// 基地航空隊の防空時の偵察機補正を含む制空値を計算する\r
+ /// 陸上戦闘機の改修レベルを制空値に反映させる。\r
/// </summary>\r
[TestMethod]\r
- public void FighterPowerWithReconBonus()\r
+ public void FighterPowerOfLandBAseFighter()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "baseaircorps_002");\r
- PAssert.That(() => sniffer.BaseAirCorps[0].AirCorps[2].FighterPower[0] == 353);\r
+ SniffLogFile(sniffer, "baseaircorps_004");\r
+ PAssert.That(() => sniffer.BaseAirCorps[1].AirCorps[0].FighterPower.AirCombat[0] == 328);\r
}\r
\r
/// <summary>\r
{\r
var sniffer = new Sniffer();\r
SniffLogFile(sniffer, "lineofsight_001");\r
- PAssert.That(() => Math.Abs(sniffer.GetFleetLineOfSights(0) - 39.45) < 0.01);\r
+ var fleet = sniffer.Fleets[0];\r
+ PAssert.That(() => Abs(fleet.GetLineOfSights(1) - 39.45) < 0.01);\r
+ PAssert.That(() => Abs(fleet.GetLineOfSights(3) - 115.19) < 0.01);\r
+ PAssert.That(() => Abs(fleet.GetLineOfSights(4) - 153.06) < 0.01);\r
SniffLogFile(sniffer, "lineofsight_002");\r
- PAssert.That(() => Math.Abs(sniffer.GetFleetLineOfSights(0) - -25.10) < 0.01, "艦隊に空きがある");\r
+ PAssert.That(() => Abs(fleet.GetLineOfSights(1) - -25.10) < 0.01, "艦隊に空きがある");\r
}\r
\r
/// <summary>\r
{\r
var sniffer = new Sniffer();\r
SniffLogFile(sniffer, "contact_001");\r
- PAssert.That(() => Math.Abs(sniffer.GetContactTriggerRate(0) - 1.8182) < 0.0001);\r
+ PAssert.That(() => Abs(sniffer.Fleets[0].ContactTriggerRate - 1.8182) < 0.0001);\r
}\r
\r
/// <summary>\r
- /// 空襲戦を正しく処理する\r
+ /// TPを計算する\r
/// </summary>\r
[TestMethod]\r
- public void LdAirBattle()\r
+ public void TransportPoint()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "ld_airbattle_001");\r
- AssertEqualBattleResult(sniffer, new[] {31, 59, 62, 14, 36, 47});\r
- PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.A);\r
+ var msgs = new[] {"", "鬼怒改二+特大発+おにぎり", "駆逐艦+士魂部隊", "補給艦"};\r
+ var results = new[] {47, 19, 13, 15};\r
+ for (var i = 0; i < msgs.Length; i++)\r
+ {\r
+ SniffLogFile(sniffer, "transportpoint_00" + (i + 1));\r
+ var j = i;\r
+ PAssert.That(() => (int)sniffer.Fleets[0].TransportPoint == results[j], msgs[j]);\r
+ }\r
}\r
\r
/// <summary>\r
- /// 連合艦隊の空襲戦を正しく処理する\r
+ /// 対空砲火のパラメータを計算する\r
/// </summary>\r
[TestMethod]\r
- public void CombinedLdAirBattle()\r
+ public void AntiAirFire()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "ld_airbattle_002");\r
- AssertEauqlCombinedResult(sniffer, new[] {31, 77, 77, 37, 41, 39}, new[] {45, 59, 64, 35, 36, 10});\r
- PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.A);\r
- }\r
-\r
- /// <summary>\r
- /// TPを正しく計算する\r
- /// </summary>\r
- [TestMethod]\r
- public void TransportPoint()\r
- {\r
- var sniffer1 = new Sniffer();\r
- SniffLogFile(sniffer1, "transportpoint_001");\r
- ItemSpec.IncreaceLandPowerTp = false;\r
- PAssert.That(() => (int)sniffer1.GetShipStatuses(0).Sum(s => s.TransportPoint) == 27);\r
- ItemSpec.IncreaceLandPowerTp = true;\r
- PAssert.That(() => (int)sniffer1.GetShipStatuses(0).Sum(s => s.TransportPoint) == 37, "陸上戦力揚陸時");\r
-\r
- var sniffer2 = new Sniffer();\r
- SniffLogFile(sniffer2, "transportpoint_002");\r
- PAssert.That(() => (int)sniffer2.GetShipStatuses(0).Sum(s => s.TransportPoint) == 19, "鬼怒改二+特大発+おにぎり");\r
- }\r
-\r
- /// <summary>\r
- /// 敵の連合艦隊に対応する\r
- /// </summary>\r
- [TestMethod]\r
- public void EnemyCombinedBattle()\r
- {\r
- var sniffer1 = new Sniffer();\r
- SniffLogFile(sniffer1, "ec_battle_001");\r
- PAssert.That(() => sniffer1.Battle.ResultRank == BattleResultRank.S, "昼戦のみ");\r
-\r
- var sniffer2 = new Sniffer();\r
- SniffLogFile(sniffer2, "ec_battle_002");\r
- PAssert.That(() => sniffer2.Battle.ResultRank == BattleResultRank.S, "夜戦込み");\r
-\r
- var sniffer3 = new Sniffer();\r
- SniffLogFile(sniffer3, "ec_battle_003");\r
- PAssert.That(() => sniffer3.Battle.ResultRank == BattleResultRank.A, "護衛を撃ちもらす");\r
+ SniffLogFile(sniffer, "antiairfire_001");\r
+ var ships = sniffer.Fleets[0].Ships;\r
+ PAssert.That(() => ships.Sum(ship => ship.EffectiveAntiAirForFleet) == 88);\r
+ PAssert.That(\r
+ () =>\r
+ ships.Select(ship => ship.EffectiveAntiAirForShip)\r
+ .SequenceEqual(new[] {92, 90, 88, 228, 146, 226}));\r
}\r
\r
-\r
/// <summary>\r
- /// 双方連合艦隊の戦闘に対応する\r
+ /// 空母の夜戦火力を計算する\r
/// </summary>\r
[TestMethod]\r
- public void BothCombinedBattle()\r
+ public void CvNightBattlePower()\r
{\r
- var sniffer1 = new Sniffer();\r
- SniffLogFile(sniffer1, "both_combined_water_001");\r
- PAssert.That(() => sniffer1.Battle.ResultRank == BattleResultRank.A);\r
-\r
- var sniffer2 = new Sniffer();\r
- SniffLogFile(sniffer2, "both_combined_001");\r
- PAssert.That(() => sniffer2.Battle.ResultRank == BattleResultRank.S);\r
-\r
- // 護衛艦隊に雷撃を受ける場合\r
- var sniffer3 = new Sniffer();\r
- SniffLogFile(sniffer3, "both_combined_002");\r
- PAssert.That(() => sniffer2.Battle.ResultRank == BattleResultRank.S);\r
- PAssert.That(\r
- () => sniffer3.GetShipStatuses(0).Select(s => s.NowHp).SequenceEqual(new[] {89, 86, 87, 78, 87, 57}));\r
- PAssert.That(\r
- () => sniffer3.GetShipStatuses(1).Select(s => s.NowHp).SequenceEqual(new[] {46, 37, 14, 59, 49, 63}));\r
+ var sniffer = new Sniffer();\r
+ SniffLogFile(sniffer, "nightbattlepower_001");\r
+ var ships = sniffer.Fleets[0].ActualShips;\r
+ PAssert.That(() =>\r
+ ships.Select(ship => (int)(ship.NightBattlePower * 100))\r
+ .SequenceEqual(new[] {11202, 14985, 20092, 17354}));\r
+ // 夜間作戦航空要員を外す\r
+ ships[0].FreeSlot(3);\r
+ ships[1].FreeSlot(2);\r
+ ships[3].FreeSlot(2);\r
+ PAssert.That(() =>\r
+ ships.Select(ship => (int)(ship.NightBattlePower * 100))\r
+ .SequenceEqual(new[] {6900, 7500, 20092, 0}));\r
+ // Ark RoyalからSwordfishを外す\r
+ ships[0].FreeSlot(0);\r
+ PAssert.That(() => (int)ships[0].NightBattlePower == 0);\r
}\r
\r
/// <summary>\r
- /// å\99´å¼\8f強襲ã\81«å¯¾å¿\9cする\r
+ /// å\89¯ç ²ã\81®æ\94¹ä¿®ã\83¬ã\83\99ã\83«ã\81®å\8a¹æ\9e\9cã\82\92è¨\88ç®\97する\r
/// </summary>\r
[TestMethod]\r
- public void Injection()\r
+ public void SecondaryGunFirepowerLevelBonus()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "injection_001");\r
- PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.P);\r
+ SniffLogFile(sniffer, "firepower_001");\r
+ var ships = sniffer.Fleets[0].Ships;\r
+ // ReSharper disable CompareOfFloatsByEqualityOperator\r
+ PAssert.That(() => ships[0].EffectiveFirepower == 93.5);\r
+ PAssert.That(() => ships[1].EffectiveFirepower == 82.5);\r
+ // ReSharper restore CompareOfFloatsByEqualityOperator\r
}\r
\r
/// <summary>\r
- /// 2-5をクリアしたときの特別戦果を反映する\r
+ /// 連合艦隊補正の載った火力を計算する\r
/// </summary>\r
[TestMethod]\r
- public void ExMapBattleResult()\r
+ public void CombinedFleetFirepower()\r
{\r
- var sniffer0 = new Sniffer();\r
- sniffer0.ExMap.ClearClearStatus();\r
- SniffLogFile(sniffer0, "eo_001");\r
- PAssert.That(() => sniffer0.ExMap.Achievement == 100, "ほかのマップの情報なし");\r
- var sniffer1 = new Sniffer();\r
- SniffLogFile(sniffer1, "eo_001");\r
- // すでに3-5をクリアしているので合計で250\r
- PAssert.That(() => sniffer1.ExMap.Achievement == 250, "ほかのマップの情報あり");\r
+ var sniffer = new Sniffer();\r
+ SniffLogFile(sniffer, "combined_status_001");\r
+ // ReSharper disable CompareOfFloatsByEqualityOperator\r
+ PAssert.That(() => sniffer.Fleets[0].Ships[0].EffectiveFirepower == 117.0);\r
+ PAssert.That(() => sniffer.Fleets[1].Ships[0].EffectiveFirepower == 72.0);\r
+ // ReSharper restore CompareOfFloatsByEqualityOperator\r
}\r
\r
/// <summary>\r
- /// 1-6をクリアしたときの特別戦果を反映する\r
+ /// 対潜攻撃力を計算する\r
/// </summary>\r
[TestMethod]\r
- public void ExMapMapNext()\r
+ public void AntiSubmarine()\r
{\r
- var sniffer0 = new Sniffer();\r
- sniffer0.ExMap.ClearClearStatus();\r
- SniffLogFile(sniffer0, "eo_002");\r
- PAssert.That(() => sniffer0.ExMap.Achievement == 75, "ほかのマップの情報なし");\r
- var sniffer1 = new Sniffer();\r
- SniffLogFile(sniffer1, "eo_002");\r
- // 5-5以外クリアしているので合計で400\r
- PAssert.That(() => sniffer1.ExMap.Achievement == 400, "ほかのマップの情報あり");\r
+ var sniffer = new Sniffer();\r
+ SniffLogFile(sniffer, "antisubmarine_001");\r
+ PAssert.That(() => Abs(sniffer.Fleets[0].Ships[0].EffectiveAntiSubmarine - 92.16) < 0.01);\r
+ PAssert.That(() => Abs(sniffer.Fleets[0].Ships[1].EffectiveAntiSubmarine - 84.49) < 0.01);\r
+ PAssert.That(() => Abs(sniffer.Fleets[0].Ships[2].EffectiveAntiSubmarine - 57.84) < 0.01);\r
+ PAssert.That(() => Abs(sniffer.Fleets[0].Ships[3].EffectiveAntiSubmarine - 61.37) < 0.01);\r
}\r
\r
/// <summary>\r
{\r
var sniffer = new Sniffer();\r
SniffLogFile(sniffer, "deck_001");\r
- var result = sniffer.GetDeck(0);\r
+ var result = sniffer.Fleets[0].Deck;\r
PAssert.That(() => new[] {756, 17204, 6156, 28806, 1069, -1}.SequenceEqual(result));\r
}\r
\r
{\r
var sniffer = new Sniffer();\r
SniffLogFile(sniffer, "deck_005");\r
- var result = sniffer.GetDeck(0);\r
+ var result = sniffer.Fleets[0].Deck;\r
PAssert.That(() => new[] {57391, 50, 24475, 113, -1, -1}.SequenceEqual(result));\r
}\r
\r
var sniffer = new Sniffer();\r
\r
SniffLogFile(sniffer, "deck_002");\r
- var result0 = sniffer.GetDeck(0);\r
+ var result0 = sniffer.Fleets[0].Deck;\r
PAssert.That(() => new[] {1069, 6156, 756, 3223, -1, -1}.SequenceEqual(result0), "編成で艦隊内で艦娘と交換する");\r
\r
SniffLogFile(sniffer, "deck_003");\r
- var result10 = sniffer.GetDeck(0);\r
- var result11 = sniffer.GetDeck(1);\r
+ var result10 = sniffer.Fleets[0].Deck;\r
+ var result11 = sniffer.Fleets[1].Deck;\r
PAssert.That(() => new[] {1069, 6156, 14258, 3223, -1, -1}.SequenceEqual(result10) &&\r
new[] {101, 4487, 756, 14613, 28806, -1}.SequenceEqual(result11), "002に続いて艦隊をまたがって交換する");\r
\r
SniffLogFile(sniffer, "deck_004");\r
- var result20 = sniffer.GetDeck(0);\r
- var result21 = sniffer.GetDeck(1);\r
+ var result20 = sniffer.Fleets[0].Deck;\r
+ var result21 = sniffer.Fleets[1].Deck;\r
PAssert.That(() => new[] {1069, 6156, 14258, 3223, 756, -1}.SequenceEqual(result20) &&\r
new[] {101, 4487, 14613, 28806, -1, -1}.SequenceEqual(result21),\r
"003に続いて空き番号にほかの艦隊の艦娘を配置する");\r
}\r
\r
/// <summary>\r
+ /// 随伴艦一括解除を実行する\r
+ /// </summary>\r
+ [TestMethod]\r
+ public void WithdrawAccompanyingShipsAtOnce()\r
+ {\r
+ var sniffer = new Sniffer();\r
+ SniffLogFile(sniffer, "deck_006");\r
+ var result = sniffer.Fleets[0].Deck;\r
+ PAssert.That(() => new[] {135, -1, -1, -1, -1, -1}.SequenceEqual(result));\r
+ }\r
+\r
+ /// <summary>\r
/// 編成展開を正しく反映する\r
/// </summary>\r
[TestMethod]\r
{\r
var sniffer = new Sniffer();\r
SniffLogFile(sniffer, "preset_001");\r
- var result = sniffer.GetDeck(0);\r
+ var result = sniffer.Fleets[0].Deck;\r
PAssert.That(() => new[] {50510, 632, 39843, 113, 478, 47422}.SequenceEqual(result));\r
}\r
\r
{\r
var sniffer = new Sniffer();\r
SniffLogFile(sniffer, "slot_exchange_001");\r
- var result = sniffer.GetShipStatuses(0)[0].Slot.Select(item => item.Id);\r
+ var result = sniffer.Fleets[0].Ships[0].Slot.Select(item => item.Id);\r
PAssert.That(() => new[] {26096, 30571, 77694, 61383, -1}.SequenceEqual(result));\r
}\r
\r
/// 近代化改修の結果をすぐに反映する\r
/// </summary>\r
[TestMethod]\r
- public void PowerupResult()\r
+ public void PowerUpResult()\r
{\r
var sniffer = new Sniffer();\r
SniffLogFile(sniffer, "powerup_001");\r
- PAssert.That(() => Math.Abs(sniffer.GetShipStatuses(0)[0].EffectiveFirepower - 30) < 0.0001);\r
+ PAssert.That(() => Abs(sniffer.Fleets[0].Ships[0].EffectiveFirepower - 30) < 0.0001);\r
+ }\r
+\r
+ /// <summary>\r
+ /// 近代化改修が二重に行われた場合に対応する\r
+ /// </summary>\r
+ [TestMethod]\r
+ public void DuplicatedPowerUp()\r
+ {\r
+ var sniffer = new Sniffer();\r
+ SniffLogFile(sniffer, "powerup_002");\r
+ PAssert.That(() => sniffer.ShipCounter.Now == 218);\r
+ }\r
+\r
+ /// <summary>\r
+ /// ship2を待たずにケッコンの結果を反映する\r
+ /// </summary>\r
+ [TestMethod]\r
+ public void MarriageResult()\r
+ {\r
+ var sniffer = new Sniffer();\r
+ SniffLogFile(sniffer, "marriage_001");\r
+ PAssert.That(() => sniffer.Fleets[0].Ships[2].Level == 100);\r
}\r
\r
/// <summary>\r
{\r
var sniffer1 = new Sniffer();\r
SniffLogFile(sniffer1, "createitem_001");\r
- PAssert.That(() => sniffer1.Item.NowEquips == 900);\r
+ PAssert.That(() => sniffer1.ItemCounter.Now == 900);\r
var sniffer2 = new Sniffer();\r
SniffLogFile(sniffer2, "createship_001");\r
- PAssert.That(() => sniffer2.Item.NowEquips == 904);\r
- }\r
-\r
- /// <summary>\r
- /// 解体された艦の装備数を全体の装備数から引く\r
- /// </summary>\r
- [TestMethod]\r
- public void CountItemsOnDeletedShip()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "destroyship_001");\r
- PAssert.That(() => sniffer.Item.NowEquips == 879, "ドロップしたばかりの艦娘を解体する場合");\r
+ PAssert.That(() => sniffer2.ItemCounter.Now == 904);\r
}\r
\r
/// <summary>\r
[TestMethod]\r
public void WarnItemCount()\r
{\r
+ Action<int> func = i => { };\r
var sniffer1 = new Sniffer();\r
SniffLogFile(sniffer1, "item_count_001");\r
- PAssert.That(() => sniffer1.Item.RingEquips, "出撃から母港に戻ったとき");\r
+ func.Invoke(sniffer1.ItemCounter.Now); // Nowを読まないとAlarmが立たない\r
+ PAssert.That(() => sniffer1.ItemCounter.Alarm, "出撃から母港に戻ったとき");\r
var sniffer2 = new Sniffer();\r
SniffLogFile(sniffer2, "item_count_002");\r
- PAssert.That(() => sniffer2.Item.RingEquips, "ログインしたとき");\r
- }\r
-\r
- /// <summary>\r
- /// ドロップ艦のいる出撃から戻ったときに、slot_itemを受信する前にItemListを取得しても例外を出さない\r
- /// </summary>\r
- [TestMethod]\r
- public void GetItemListBeforeReceivingSlotItem()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "dropship_001");\r
- PAssert.That(() => sniffer.ItemList[0].Holder.Id == 250);\r
+ func.Invoke(sniffer2.ItemCounter.Now);\r
+ PAssert.That(() => sniffer2.ItemCounter.Alarm, "ログインしたとき");\r
}\r
\r
/// <summary>\r
new[] {0, 0, 0, 0, 0, 0, 0, 0},\r
new[] {288194, 282623, 299496, 295958, 3000, 2968, 2997, 7},\r
new[] {288185, 282623, 299496, 295943, 3000, 2968, 2997, 7},\r
- new[] {288161, 282623, 299496, 295903, 3000, 2968, 2997, 7},\r
+ new[] {288161, 282623, 299496, 295903, 3000, 2968, 2997, 7}\r
};\r
PAssert.That(() => SequenceOfSequenceEqual(expected3, result3), "航空機の補充");\r
\r
new[] {0, 0, 0, 0, 0, 0, 0, 0},\r
new[] {261012, 252252, 298492, 279622, 3000, 2842, 3000, 22},\r
new[] {261012, 252252, 298492, 279538, 3000, 2842, 3000, 22},\r
- new[] {261012, 252252, 298492, 279454, 3000, 2842, 3000, 22},\r
+ new[] {261012, 252252, 298492, 279454, 3000, 2842, 3000, 22}\r
};\r
PAssert.That(() => SequenceOfSequenceEqual(expected4, result4), "航空機の配備");\r
}\r
}\r
\r
/// <summary>\r
- /// 海域ゲージ情報を作成する\r
+ /// 修復時間が1分以内の艦娘が入渠する\r
/// </summary>\r
[TestMethod]\r
- public void MapInfo()\r
+ public void NyukyoLessThanOrEqualTo1Min()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "mapinfo_001");\r
- PAssert.That(() => sniffer.MiscText ==\r
- "[海域ゲージ]\r\n" +\r
- "1-6 : 撃破 3/7\r\n5-5 : 撃破 0/5\r\n6-3 : 撃破 0/4\r\n" +\r
- "31-1 : HP 0/750\r\n31-2 : HP 0/1050\r\n31-3 : HP 0/2100\r\n31-4 : HP 0/3500\r\n31-5 : HP 1/2450\r\n",\r
- "最初の海域ゲージ情報");\r
- SniffLogFile(sniffer, "mapinfo_002");\r
+ SniffLogFile(sniffer, "nyukyo_001");\r
+ PAssert.That(() => sniffer.RepairList.Length == 1);\r
+ }\r
+\r
+ /// <summary>\r
+ /// 一括解体する(装備保管なしとあり)\r
+ /// </summary>\r
+ [TestMethod]\r
+ public void DestroyShip()\r
+ {\r
+ var sniffer = new Sniffer();\r
+ SniffLogFile(sniffer, "destroyship_001");\r
+ PAssert.That(() => sniffer.ShipCounter.Now == 250);\r
+ PAssert.That(() => sniffer.ItemCounter.Now == 1118);\r
+ PAssert.That(() => sniffer.Material.Current.Take(4).SequenceEqual(new[] {285615, 286250, 291010, 284744}));\r
+ }\r
+\r
+ /// <summary>\r
+ /// 第2艦隊までしか解放していなくてもエラーにならないようにする\r
+ /// </summary>\r
+ [TestMethod]\r
+ public void TwoFleets()\r
+ {\r
+ var sniffer = new Sniffer(true);\r
+ SniffLogFile(sniffer, "twofleets_001");\r
+ var expected = Enumerable.Repeat(new ChargeStatus(5, 5), ShipInfo.FleetCount);\r
+ PAssert.That(() => expected.SequenceEqual(sniffer.Fleets.Select(f => f.ChargeStatus)));\r
+ }\r
+\r
+ /// <summary>\r
+ /// ship2がリクエストで指定した艦娘のデータしか返さない\r
+ /// </summary>\r
+ [TestMethod]\r
+ public void Ship2ReturnShipSpecifiedByRequest()\r
+ {\r
+ var sniffer = new Sniffer();\r
+ SniffLogFile(sniffer, "ship2_001");\r
+ PAssert.That(() => sniffer.ShipCounter.Now == 243);\r
+ }\r
+\r
+ /// <summary>\r
+ /// 出撃中にアイテムを取得する\r
+ /// </summary>\r
+ [TestMethod]\r
+ public void ItemGetInSortie()\r
+ {\r
+ var sniffer = new Sniffer();\r
+ SniffLogFile(sniffer, "itemget_001");\r
PAssert.That(() => sniffer.MiscText ==\r
- "[海域ゲージ情報]\r\n 海域選択画面に進むと表示します。\r\n[演習情報]\r\n 演習相手を選ぶと表示します。",\r
- "戦闘から戻ったら案内を表示");\r
- SniffLogFile(sniffer, "mapinfo_003");\r
+ "[獲得アイテム]\r\n" +\r
+ "燃料: 1115\r\n" +\r
+ "弾薬: 25\r\n" +\r
+ "鋼材: 70\r\n" +\r
+ "家具箱(大): 1\r\n" +\r
+ "給糧艦「間宮」: 1\r\n" +\r
+ "勲章: 1\r\n" +\r
+ "給糧艦「伊良湖」: 3\r\n" +\r
+ "プレゼント箱: 1\r\n" +\r
+ "補強増設: 2\r\n" +\r
+ "戦闘詳報: 1\r\n" +\r
+ "瑞雲(六三一空): 1\r\n" +\r
+ "夜間作戦航空要員: 1\r\n" +\r
+ "130mm B-13連装砲: 1\r\n" +\r
+ "潜水空母な桐箪笥: 1\r\n" +\r
+ "Gambier Bay: 1");\r
+ }\r
+\r
+ /// <summary>\r
+ /// 出撃直後に資源を獲得する\r
+ /// </summary>\r
+ [TestMethod]\r
+ public void ItemGetAtStart()\r
+ {\r
+ var sniffer = new Sniffer();\r
+ SniffLogFile(sniffer, "itemget_002");\r
PAssert.That(() => sniffer.MiscText ==\r
+ "[獲得アイテム]\r\n" +\r
+ "燃料: 65");\r
+ }\r
+\r
+ /// <summary>\r
+ /// 航空偵察でアイテムを取得する\r
+ /// </summary>\r
+ [TestMethod]\r
+ public void ItemGetInAirRecon()\r
+ {\r
+ var sniffer = new Sniffer();\r
+ SniffLogFile(sniffer, "airrecon_001");\r
+ PAssert.That(() =>\r
+ sniffer.MiscText ==\r
+ "[海域ゲージ情報]\r\n 海域選択画面に進むと表示します。\r\n" +\r
+ "[演習情報]\r\n 演習相手を選ぶと表示します。\r\n" +\r
+ "[獲得アイテム]\r\n 帰投したときに表示します。", "失敗の場合");\r
+\r
+ SniffLogFile(sniffer, "airrecon_002");\r
+ PAssert.That(() =>\r
+ sniffer.MiscText == "[獲得アイテム]\r\n弾薬: 150\r\n開発資材: 1", "成功");\r
+\r
+ SniffLogFile(sniffer, "airrecon_003");\r
+ PAssert.That(() =>\r
+ sniffer.MiscText == "[獲得アイテム]\r\n弾薬: 150\r\n開発資材: 1", "途中でリロードして再出撃");\r
+ }\r
+\r
+ /// <summary>\r
+ /// 海域ゲージの情報を生成する\r
+ /// </summary>\r
+ [TestMethod]\r
+ public void AreaGauge()\r
+ {\r
+ var sniffer = new Sniffer();\r
+ SniffLogFile(sniffer, "mapgauge_001");\r
+ PAssert.That(() =>\r
+ sniffer.MiscText ==\r
"[海域ゲージ]\r\n" +\r
- "1-6 : 撃破 4/7\r\n5-5 : 撃破 0/5\r\n6-3 : 撃破 0/4\r\n" +\r
- "31-1 : HP 0/750\r\n31-2 : HP 0/1050\r\n31-3 : HP 0/2100\r\n31-4 : HP 0/3500\r\n31-5 : HP 1/2450\r\n",\r
- "更新された海域ゲージ情報");\r
+ "1-6 : 残り 5/7\r\n" +\r
+ "2-5 : 残り 4/4\r\n" +\r
+ "3-5 : 残り 4/4\r\n" +\r
+ "4-4 : 残り 4/4\r\n");\r
}\r
\r
/// <summary>\r
- /// æ¼\94ç¿\92ç\9b¸æ\89\8bã\81®æ\83\85å ±ã\82\92ä½\9cæ\88\90する\r
+ /// æ\96°è¦\8fã\81®ã\83\89ã\83ã\83\83ã\83\97è\89¦ã\81®å\88\9dæ\9c\9fè£\85å\82\99æ\95°ã\82\92ç\99»é\8c²する\r
/// </summary>\r
[TestMethod]\r
- public void PractiveEnemyInfo()\r
+ public void RecordNumEquipsOfNewDropShip()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "practice_enemyinfo_001");\r
- PAssert.That(() => sniffer.MiscText ==\r
- "[演習情報]\r\n敵艦隊名 : 大銀河地球連邦 第7艦隊\r\n獲得経験値 : 570\r\nS勝利 : 684",\r
- "演習相手の情報");\r
- SniffLogFile(sniffer, "practice_enemyinfo_002");\r
- PAssert.That(() => sniffer.MiscText ==\r
- "[海域ゲージ情報]\r\n 海域選択画面に進むと表示します。\r\n[演習情報]\r\n 演習相手を選ぶと表示します。",\r
- "演習から戻ったら案内を表示");\r
+ SniffLogFile(sniffer, "dropship_001");\r
+ PAssert.That(() => sniffer.AdditionalData.NumEquips(565) == 2);\r
+ PAssert.That(() => sniffer.ShipList.First(s => s.Spec.Id == 565).Spec.NumEquips == 2);\r
+ }\r
+\r
+ /// <summary>\r
+ /// 既知のドロップ艦とその装備をカウントする\r
+ /// </summary>\r
+ [TestMethod]\r
+ public void CountDropShip()\r
+ {\r
+ var sniffer = new Sniffer();\r
+ sniffer.AdditionalData.RecordNumEquips(11, "", 1);\r
+ SniffLogFile(sniffer, "dropship_002");\r
+ PAssert.That(() => sniffer.ShipCounter.Now == 250);\r
+ PAssert.That(() => sniffer.ItemCounter.Now == 1159);\r
+ }\r
+\r
+ /// <summary>\r
+ /// 艦娘数を数える\r
+ /// </summary>\r
+ [TestMethod]\r
+ public void CountShips()\r
+ {\r
+ var sniffer = new Sniffer();\r
+ SniffLogFile(sniffer, "ship_count_001");\r
+ PAssert.That(() => sniffer.ShipCounter.Now == 267 && sniffer.ShipCounter.Alarm, "ログイン");\r
+ SniffLogFile(sniffer, "ship_count_002");\r
+ PAssert.That(() => sniffer.ShipCounter.Now == 266 && sniffer.ShipCounter.Alarm, "建造");\r
+ SniffLogFile(sniffer, "ship_count_003");\r
+ PAssert.That(() => sniffer.ShipCounter.Now == 266 && sniffer.ShipCounter.Alarm, "ドロップ");\r
}\r
}\r
}
\ No newline at end of file