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
- 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
+ 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 DamageControl()\r
+ public void Ship7Battle()\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
+ 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 DamgeControlInSlotEx()\r
+ public void NotVerifyBattleResultAfterPractice()\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
- // ReSharper disable once InconsistentNaming\r
- public void CombinedFleetSurfaceWithout2ndShelling()\r
+ public void SmallCombinedFleetBattle()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "combined_surface_003");\r
- PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.P);\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 CombinedFleetSurfaceWithoutAnyShelling()\r
+ public void EscapeWithEscort()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "combined_surface_004");\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
- /// ship2に代わるship_deckを処理する\r
+ /// 開幕夜戦に支援が来る\r
/// </summary>\r
[TestMethod]\r
- public void ShipDeck()\r
+ public void SpMidnightSupportAttack()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "ship_deck_001");\r
- PAssert.That(() => sniffer.GetShipStatuses(0)[0].Fuel == 36);\r
+ SniffLogFile(sniffer, "sp_midnight_002");\r
+ PAssert.That(() => !sniffer.Battle.DisplayedResultRank.IsError);\r
}\r
\r
/// <summary>\r
- /// 夜戦かどうかを選択する画面でリロードしても結果を次の戦闘に持ち越さない\r
+ /// 払暁戦を行う\r
/// </summary>\r
[TestMethod]\r
- public void ReloadBeforeBattleResult()\r
+ public void NightToDay()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "reload_001");\r
- PAssert.That(() => sniffer.GetShipStatuses(0)[0].NowHp == 41);\r
+ SniffLogFile(sniffer, "nighttoday_001");\r
+ PAssert.That(() => !sniffer.Battle.DisplayedResultRank.IsError && !sniffer.IsBattleResultStatusError);\r
}\r
\r
/// <summary>\r
- /// 航空戦のない演習を正しく処理する\r
+ /// 単艦退避する\r
/// </summary>\r
[TestMethod]\r
- public void PracticeWithoutAirBattle()\r
+ public void EscapeWithoutEscort()\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();\r
- SniffLogFile(sniffer, "battle_006");\r
- PAssert.That(() => sniffer.Battle.EnemyFighterPower == "0");\r
- }\r
-\r
- /// <summary>\r
/// 熟練度込みの制空値を正しく計算する\r
/// </summary>\r
[TestMethod]\r
{\r
var sniffer = new Sniffer();\r
SniffLogFile(sniffer, "fighterpower_003");\r
- PAssert.That(() => sniffer.GetFighterPower(0).SequenceEqual(new [] {135, 135}));\r
+ PAssert.That(() => sniffer.GetFighterPower(0).SequenceEqual(new[] {135, 135}));\r
}\r
\r
/// <summary>\r
public void FighterPowerOfBaseAirCorps()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "fighterpower_004");\r
- PAssert.That(() => sniffer.BaseAirCorps[0].FighterPower[1] == 301);\r
- sniffer.BaseAirCorps[0].Action = 2; // 防空\r
- PAssert.That(()=>sniffer.BaseAirCorps[0].FighterPower[1] == 320);\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
- /// マップ索敵の判定式(33)を正しく計算する\r
+ /// 基地航空隊の防空時の偵察機補正を含む制空値を計算する\r
/// </summary>\r
[TestMethod]\r
- public void LineOfSight()\r
+ public void FighterPowerWithReconBonus()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "lineofsight_001");\r
- PAssert.That(() => Math.Abs(sniffer.GetFleetLineOfSights(0) - 39.45) < 0.01);\r
- SniffLogFile(sniffer, "lineofsight_002");\r
- PAssert.That(() => Math.Abs(sniffer.GetFleetLineOfSights(0) - -25.10) < 0.01, "艦隊に空きがある");\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 ContactTriggerRage()\r
+ public void FighterPowerOfLandBasedAttackAircraft()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "contact_001");\r
- PAssert.That(() => Math.Abs(sniffer.GetContactTriggerRate(0) - 1.8182) < 0.0001);\r
+ SniffLogFile(sniffer, "baseaircorps_003");\r
+ PAssert.That(() => sniffer.BaseAirCorps[1].AirCorps[0].FighterPower.AirCombat[0] == 121);\r
}\r
\r
/// <summary>\r
- /// 空襲戦を正しく処理する\r
+ /// マップ索敵の判定式(33)を正しく計算する\r
/// </summary>\r
[TestMethod]\r
- public void LdAirBattle()\r
+ public void LineOfSight()\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
+ SniffLogFile(sniffer, "lineofsight_001");\r
+ PAssert.That(() => Math.Abs(sniffer.GetFleetLineOfSights(0, 1) - 39.45) < 0.01);\r
+ PAssert.That(() => Math.Abs(sniffer.GetFleetLineOfSights(0, 3) - 115.19) < 0.01);\r
+ PAssert.That(() => Math.Abs(sniffer.GetFleetLineOfSights(0, 4) - 153.06) < 0.01);\r
+ SniffLogFile(sniffer, "lineofsight_002");\r
+ PAssert.That(() => Math.Abs(sniffer.GetFleetLineOfSights(0, 1) - -25.10) < 0.01, "艦隊に空きがある");\r
}\r
\r
/// <summary>\r
- /// 連合艦隊の空襲戦を正しく処理する\r
+ /// 触接開始率を正しく計算する\r
/// </summary>\r
[TestMethod]\r
- public void CombinedLdAirBattle()\r
+ public void ContactTriggerRage()\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
+ SniffLogFile(sniffer, "contact_001");\r
+ PAssert.That(() => Math.Abs(sniffer.GetContactTriggerRate(0) - 1.8182) < 0.0001);\r
}\r
\r
/// <summary>\r
[TestMethod]\r
public void TransportPoint()\r
{\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "transportpoint_001");\r
+ var sniffer1 = new Sniffer();\r
+ SniffLogFile(sniffer1, "transportpoint_001");\r
ItemSpec.IncreaceLandPowerTp = false;\r
- PAssert.That(() => (int)sniffer.GetShipStatuses(0).Sum(s => s.TransportPoint) == 27);\r
+ PAssert.That(() => (int)sniffer1.GetShipStatuses(0).Sum(s => s.TransportPoint) == 27);\r
ItemSpec.IncreaceLandPowerTp = true;\r
- PAssert.That(() => (int)sniffer.GetShipStatuses(0).Sum(s => s.TransportPoint) == 37, "陸上戦力揚陸時");\r
- }\r
+ PAssert.That(() => (int)sniffer1.GetShipStatuses(0).Sum(s => s.TransportPoint) == 37, "陸上戦力揚陸時");\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
+ var sniffer2 = new Sniffer();\r
+ SniffLogFile(sniffer2, "transportpoint_002");\r
+ PAssert.That(() => (int)sniffer2.GetShipStatuses(0).Sum(s => s.TransportPoint) == 19, "鬼怒改二+特大発+おにぎり");\r
+\r
+ var sniffer3 = new Sniffer();\r
+ SniffLogFile(sniffer3, "transportpoint_003");\r
+ PAssert.That(() => (int)sniffer3.GetShipStatuses(0).Sum(s => s.TransportPoint) == 13, "駆逐艦+士魂部隊");\r
}\r
\r
/// <summary>\r
- /// 1-6をクリアしたときの特別戦果を反映する\r
+ /// 対空砲火のパラメータを計算する\r
/// </summary>\r
[TestMethod]\r
- public void ExMapMapNext()\r
+ public void AntiAirFire()\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, "antiairfire_001");\r
+ var ships = sniffer.GetShipStatuses(0);\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
/// <summary>\r
}\r
\r
/// <summary>\r
+ /// 拡張した編成記録枠にすぐに記録してもエラーにならない\r
+ /// </summary>\r
+ [TestMethod]\r
+ public void PresetExpand()\r
+ {\r
+ var sniffer = new Sniffer();\r
+ SniffLogFile(sniffer, "preset_002");\r
+ }\r
+\r
+ /// <summary>\r
/// 装備の交換を正しく反映する\r
/// </summary>\r
[TestMethod]\r
{\r
var sniffer = new Sniffer();\r
SniffLogFile(sniffer, "powerup_001");\r
- PAssert.That(() => Math.Abs(sniffer.GetShipStatuses(0)[0].RealFirepower - 30) < 0.0001);\r
+ PAssert.That(() => Math.Abs(sniffer.GetShipStatuses(0)[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.Item.NowShips == 218);\r
}\r
\r
/// <summary>\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
+ /// 装備の所持者を設定する\r
/// </summary>\r
[TestMethod]\r
- public void GetItemListBeforeReceivingSlotItem()\r
+ public void SetItemHolder()\r
{\r
var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "dropship_001");\r
- PAssert.That(() => sniffer.ItemList[0].Holder.Id == 250);\r
+ SniffLogFile(sniffer, "itemholder_001");\r
+ var itemIds = new HashSet<int> {75298, 76572, 82725, 90213, 5910};\r
+ var items = sniffer.ItemList.Where(status => itemIds.Contains(status.Id));\r
+ PAssert.That(() => items.All(x => x.Holder.Id == 861));\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 NyukyoLessThanOrEqualTo1Min()\r
+ {\r
+ var sniffer = new Sniffer();\r
+ SniffLogFile(sniffer, "nyukyo_001");\r
+ PAssert.That(() => sniffer.RepairList.Length == 1);\r
+ }\r
+\r
+ /// <summary>\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