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
+ /// 4-2-1で開幕対潜雷撃を含む戦闘を行う\r
/// </summary>\r
[TestMethod]\r
- public void DamageInPracticeNotSpillIntoSortie()\r
+ public void NormalBattleWithVriousTypesOfAttack()\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
- }\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
-\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.Battle.ResultRank == BattleResultRank.A);\r
+ AssertEqualBattleResult(sniffer,\r
+ new[] {57, 66, 50, 65, 40, 42}, new[] {34, 5, 0, 0, 0, 0});\r
}\r
\r
- private void AssertEauqlCombinedResult(Sniffer sniffer, IEnumerable<int> expected0, IEnumerable<int> expected1,\r
+ private void AssertEqualBattleResult(Sniffer sniffer, IEnumerable<int> expected, IEnumerable<int> enemy,\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
+ var result = sniffer.GetShipStatuses(0).Select(s => s.NowHp);\r
+ PAssert.That(() => expected.SequenceEqual(result), msg);\r
+ var enemyResult = sniffer.Battle.EnemyResultStatus.Select(s => s.NowHp);\r
+ PAssert.That(() => enemy.SequenceEqual(enemyResult), msg);\r
}\r
\r
/// <summary>\r
- /// é\96\8bå¹\95å¤\9cæ\88¦ã\81®ã\83\80ã\83¡ã\83¼ã\82¸ã\82\92æ\88¦é\97\98çµ\90æ\9e\9cã\81«å\8f\8dæ\98 する\r
+ /// é\96\8bå¹\95å¤\9cæ\88¦ã\81§æ½\9cæ°´è\89¦å\90\8c士ã\81\8cã\81\8aè¦\8bå\90\88ã\81\84する\r
/// </summary>\r
[TestMethod]\r
- public void SpMidnight()\r
+ public void SpMidnightWithoutBattle()\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
+ /// 夜戦で戦艦が攻撃すると一回で三発分のデータが来る\r
+ /// そのうち存在しない攻撃はターゲット、ダメージともに-1になる\r
/// </summary>\r
[TestMethod]\r
- public void SupportShellingChangeResultRank()\r
+ public void BattleShipAttackInMidnight()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "support_001");\r
- PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.A);\r
+ SniffLogFile(sniffer, "midnight_001");\r
+ PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.S);\r
}\r
\r
/// <summary>\r
- /// 敵連合艦隊への航空支援攻撃を反映させる\r
+ /// 7隻編成の戦闘で7隻目が攻撃される\r
/// </summary>\r
[TestMethod]\r
- public void SupportAirAttackResultRank()\r
+ public void Ship7Battle()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "support_002");\r
+ SniffLogFile(sniffer, "ship7battle_001");\r
PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.P);\r
}\r
\r
/// <summary>\r
- /// ダメコンの使用を戦闘結果に反映させる\r
+ /// 演習のあとのportで戦闘結果の検証を行わない\r
/// </summary>\r
[TestMethod]\r
- public void DamageControl()\r
+ public void NotVerifyBattleResultAfterPractice()\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
+ SniffLogFile(sniffer, "practice_001");\r
+ PAssert.That(() => !sniffer.IsBattleResultStatusError);\r
}\r
\r
/// <summary>\r
- /// 旗艦大破で女神を使った進撃を反映する\r
+ /// 連合艦隊が開幕雷撃で被弾する\r
/// </summary>\r
[TestMethod]\r
- public void DamageControlForFlagShip()\r
+ public void OpeningTorpedoInCombinedBattle()\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
+ SniffLogFile(sniffer, "combined_battle_001");\r
+ PAssert.That(() => !sniffer.IsBattleResultStatusError);\r
}\r
\r
/// <summary>\r
- /// 戦闘開始時に大破艦がいても夜戦突入時に警告を出さない\r
+ /// 連合艦隊が閉幕雷撃で被弾する\r
/// </summary>\r
[TestMethod]\r
- public void NotWarnDamagedShipOnRunIntoNightBattle()\r
+ public void ClosingTorpedoInCombinedBattle()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "damecon_006");\r
- PAssert.That(() => sniffer.BadlyDamagedShips.Length == 0);\r
+ SniffLogFile(sniffer, "combined_battle_002");\r
+ PAssert.That(() => !sniffer.IsBattleResultStatusError);\r
}\r
\r
/// <summary>\r
- /// 轟沈した艦娘に大破警告を出さない\r
+ /// 第一が6隻未満の連合艦隊で戦闘する\r
/// </summary>\r
[TestMethod]\r
- public void NotWarnToSunkShip()\r
+ public void SmallCombinedFleetBattle()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "sunk_001");\r
- AssertEqualBattleResult(sniffer, new[]{26, 0, 1, 3});\r
- PAssert.That(() => sniffer.BadlyDamagedShips.SequenceEqual(new[] {"菊月", "雪風"}));\r
+ SniffLogFile(sniffer, "combined_battle_003");\r
+ PAssert.That(() => !sniffer.IsBattleResultStatusError);\r
}\r
\r
/// <summary>\r
- /// 連合艦隊(水上打撃部隊)で二回目の砲撃戦がない場合を正しく処理する\r
+ /// 護衛退避する\r
/// </summary>\r
[TestMethod]\r
- // ReSharper disable once InconsistentNaming\r
- public void CombinedFleetSurfaceWithout2ndShelling()\r
+ public void EscapeWithEscort()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "combined_surface_003");\r
- PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.P);\r
+ SniffLogFile(sniffer, "escape_001");\r
+ PAssert.That(() => sniffer.GetShipStatuses(0)[5].Escaped &&\r
+ sniffer.GetShipStatuses(1)[2].Escaped);\r
}\r
\r
/// <summary>\r
- /// é\80£å\90\88è\89¦é\9a\8a(æ°´ä¸\8aæ\89\93æ\92\83é\83¨é\9a\8a)ã\81§é\96\8bå¹\95é\9b·æ\92\83ã\81§æ\88¦é\97\98ã\81\8cçµ\82ã\82\8fã\82\8bå ´å\90\88ã\82\92æ£ã\81\97ã\81\8få\87¦ç\90\86ã\81\99る\r
+ /// é\96\8bå¹\95å¤\9cæ\88¦ã\81«æ\94¯æ\8f´ã\81\8cæ\9d¥る\r
/// </summary>\r
[TestMethod]\r
- // ReSharper disable once InconsistentNaming\r
- public void CombinedFleetSurfaceWithoutAnyShelling()\r
+ public void SpMidnightSupportAttack()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "combined_surface_004");\r
- PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.P);\r
+ SniffLogFile(sniffer, "sp_midnight_002");\r
+ PAssert.That(() => !sniffer.Battle.DisplayedResultRank.IsError);\r
}\r
\r
/// <summary>\r
- /// ship2に代わるship_deckを処理する\r
+ /// 払暁戦を行う\r
/// </summary>\r
[TestMethod]\r
- public void ShipDeck()\r
+ public void NightToDay()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "ship_deck_001");\r
- PAssert.That(() => sniffer.GetShipStatuses(0)[0].Fuel == 36);\r
+ SniffLogFile(sniffer, "nighttoday_001");\r
+ PAssert.That(() => !sniffer.Battle.DisplayedResultRank.IsError && !sniffer.IsBattleResultStatusError);\r
}\r
\r
/// <summary>\r
- /// å¤\9cæ\88¦ã\81\8bã\81©ã\81\86ã\81\8bã\82\92é\81¸æ\8a\9eã\81\99ã\82\8bç\94»é\9d¢ã\81§ã\83ªã\83ã\83¼ã\83\89ã\81\97ã\81¦ã\82\82çµ\90æ\9e\9cã\82\92次ã\81®æ\88¦é\97\98ã\81«æ\8c\81ã\81¡è¶\8aã\81\95ã\81ªã\81\84\r
+ /// å\8d\98è\89¦é\80\80é\81¿ã\81\99ã\82\8b\r
/// </summary>\r
[TestMethod]\r
- public void ReloadBeforeBattleResult()\r
+ public void EscapeWithoutEscort()\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
+ SniffLogFile(sniffer, "escape_002");\r
+ PAssert.That(() => sniffer.GetShipStatuses(2)[1].Escaped);\r
+ PAssert.That(() => !sniffer.IsBattleResultStatusError);\r
}\r
\r
/// <summary>\r
}\r
\r
/// <summary>\r
- /// 先制対潜攻撃を正しく処理する\r
- /// </summary>\r
- [TestMethod]\r
- public void OpeningTaisen()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "opening_taisen_001");\r
- PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.P);\r
- }\r
-\r
- /// <summary>\r
- /// 敵の空スロットの値が-1ではなく0のときにエラーにならない\r
- /// </summary>\r
- [TestMethod]\r
- public void ZeroValueEmptySlot()\r
- {\r
- var sniffer = new Sniffer {UseOldEnemyId = true};\r
- SniffLogFile(sniffer, "battle_006");\r
- PAssert.That(() => sniffer.Battle.EnemyFighterPower.AirCombat == 0);\r
- }\r
-\r
- /// <summary>\r
- /// B勝利を正しく判定する\r
- /// </summary>\r
- [TestMethod]\r
- public void JudgeResultRankB()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "battle_008");\r
- PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.B);\r
- }\r
-\r
- /// <summary>\r
- /// 最終セルで大破警告を出さない\r
- /// </summary>\r
- [TestMethod]\r
- public void NotWarnDamagedShipInLastCell()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "taiha_001");\r
- PAssert.That(() => sniffer.GetShipStatuses(0)[2].NowHp == 2);\r
- PAssert.That(() => !sniffer.BadlyDamagedShips.Any());\r
- }\r
-\r
- /// <summary>\r
- /// 道中で大破警告を出す\r
- /// </summary>\r
- [TestMethod]\r
- public void WarnDamagedShip()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "taiha_002");\r
- PAssert.That(() => sniffer.GetShipStatuses(0)[2].NowHp == 1);\r
- PAssert.That(() => sniffer.BadlyDamagedShips.Any());\r
- }\r
-\r
- /// <summary>\r
- /// 連合艦隊の第二艦隊の旗艦の大破警告を出さない\r
- /// </summary>\r
- [TestMethod]\r
- public void NotWarnDamagedFlagshipInGuardFleet()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "taiha_003");\r
- PAssert.That(() => sniffer.GetShipStatuses(1)[0].NowHp == 12);\r
- PAssert.That(() => !sniffer.BadlyDamagedShips.Any());\r
- }\r
-\r
- /// <summary>\r
/// 熟練度込みの制空値を正しく計算する\r
/// </summary>\r
[TestMethod]\r
{\r
var sniffer = new Sniffer();\r
SniffLogFile(sniffer, "baseaircorps_001");\r
- PAssert.That(() => sniffer.BaseAirCorps[0].AirCorps[0].FighterPower[1] == 301);\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[1] == 320);\r
+ PAssert.That(() => sniffer.BaseAirCorps[0].AirCorps[0].FighterPower.Interception[1] == 320);\r
}\r
\r
/// <summary>\r
{\r
var sniffer = new Sniffer();\r
SniffLogFile(sniffer, "baseaircorps_002");\r
- PAssert.That(() => sniffer.BaseAirCorps[0].AirCorps[2].FighterPower[0] == 353);\r
+ PAssert.That(() => sniffer.BaseAirCorps[0].AirCorps[2].FighterPower.Interception[0] == 353);\r
}\r
\r
/// <summary>\r
{\r
var sniffer = new Sniffer();\r
SniffLogFile(sniffer, "baseaircorps_003");\r
- PAssert.That(() => sniffer.BaseAirCorps[1].AirCorps[0].FighterPower[0] == 121);\r
- }\r
-\r
- /// <summary>\r
- /// 敵艦隊の制空値を計算する\r
- /// </summary>\r
- [TestMethod]\r
- public void EnemyFighterPower()\r
- {\r
- var sniffer1 = new Sniffer{UseOldEnemyId = true};\r
- SniffLogFile(sniffer1, "airbattle_002");\r
- PAssert.That(() => sniffer1.Battle.EnemyFighterPower.AirCombat == 28);\r
-\r
- var sniffer2 = new Sniffer {UseOldEnemyId = true};\r
- SniffLogFile(sniffer2, "both_combined_001");\r
- PAssert.That(() => sniffer2.Battle.EnemyFighterPower.AirCombat == 389);\r
+ PAssert.That(() => sniffer.BaseAirCorps[1].AirCorps[0].FighterPower.AirCombat[0] == 121);\r
}\r
\r
/// <summary>\r
}\r
\r
/// <summary>\r
- /// 空襲戦を正しく処理する\r
- /// </summary>\r
- [TestMethod]\r
- public void LdAirBattle()\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
- }\r
-\r
- /// <summary>\r
- /// 連合艦隊の空襲戦を正しく処理する\r
- /// </summary>\r
- [TestMethod]\r
- public void CombinedLdAirBattle()\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
}\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
- }\r
-\r
-\r
- /// <summary>\r
- /// 双方連合艦隊の戦闘に対応する\r
- /// </summary>\r
- [TestMethod]\r
- public void BothCombinedBattle()\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
- }\r
-\r
- /// <summary>\r
- /// 噴式強襲に対応する\r
- /// </summary>\r
- [TestMethod]\r
- public void Injection()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "injection_001");\r
- PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.P);\r
- }\r
-\r
- /// <summary>\r
- /// 基地航空隊噴式強襲でapi_stage3_combinedがnullの場合に対応する\r
- /// </summary>\r
- [TestMethod]\r
- public void AirbaseInjection()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "airbase_injection_001");\r
- PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.P);\r
- }\r
-\r
- /// <summary>\r
/// 対空砲火のパラメータを計算する\r
/// </summary>\r
[TestMethod]\r
}\r
\r
/// <summary>\r
- /// 航空戦の結果を処理する\r
- /// </summary>\r
- [TestMethod]\r
- public void AirBattleResult()\r
- {\r
- var sniffer1 = new Sniffer();\r
- SniffLogFile(sniffer1, "battle_001");\r
- PAssert.That(() => sniffer1.Battle.AirBattleResults.Count == 0);\r
-\r
- var sniffer2 = new Sniffer();\r
- SniffLogFile(sniffer2, "ec_battle_001");\r
- PAssert.That(() => sniffer2.Battle.AirBattleResults.Count == 4);\r
-\r
- var sniffer3 = new Sniffer();\r
- SniffLogFile(sniffer3, "battle_007");\r
- PAssert.That(() => sniffer3.Battle.AirBattleResults.Count == 1, "stage2がない場合");\r
- }\r
-\r
- /// <summary>\r
- /// 2-5をクリアしたときの特別戦果を反映する\r
- /// </summary>\r
- [TestMethod]\r
- public void ExMapBattleResult()\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
- }\r
-\r
- /// <summary>\r
- /// 1-6をクリアしたときの特別戦果を反映する\r
- /// </summary>\r
- [TestMethod]\r
- public void ExMapMapNext()\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
- }\r
-\r
- /// <summary>\r
/// 編成で空き番号を使ったローテートを正しく反映する\r
/// </summary>\r
[TestMethod]\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
- }\r
-\r
- /// <summary>\r
/// 装備数の超過を警告する\r
/// </summary>\r
[TestMethod]\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
- }\r
-\r
- /// <summary>\r
/// 装備の所持者を設定する\r
/// </summary>\r
[TestMethod]\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
+ /// 一括解体する(装備保管なしとあり)\r
/// </summary>\r
[TestMethod]\r
- public void MapInfo()\r
+ public void DestroyShip()\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
- PAssert.That(() => sniffer.MiscText ==\r
- "[海域ゲージ情報]\r\n 海域選択画面に進むと表示します。\r\n[演習情報]\r\n 演習相手を選ぶと表示します。",\r
- "戦闘から戻ったら案内を表示");\r
- SniffLogFile(sniffer, "mapinfo_003");\r
- PAssert.That(() => 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
+ SniffLogFile(sniffer, "destroyship_001");\r
+ PAssert.That(() => sniffer.Item.NowShips == 250);\r
+ PAssert.That(() => sniffer.Item.NowEquips == 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.ChargeStatuses));\r
}\r
\r
/// <summary>\r
- /// 演習相手の情報を作成する\r
+ /// ship2がリクエストで指定した艦娘のデータしか返さない\r
/// </summary>\r
[TestMethod]\r
- public void PractiveEnemyInfo()\r
+ public void Ship2ReturnShipSpecifiedByRequest()\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, "ship2_001");\r
+ PAssert.That(() => sniffer.Item.NowShips == 243);\r
}\r
}\r
}
\ No newline at end of file