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
- [TestInitialize]\r
- public void Intialize()\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
}\r
\r
/// <summary>\r
- /// 4-2-1で開幕対潜雷撃を含む戦闘を行う\r
- /// </summary>\r
- [TestMethod]\r
- public void NormalBattleWithVriousTypesOfAttack()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "battle_001");\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 AssertEqualBattleResult(Sniffer sniffer, IEnumerable<int> expected, IEnumerable<int> enemy,\r
- string msg = null)\r
- {\r
- var result = sniffer.GetShipStatuses(0).Select(s => s.NowHp);\r
- PAssert.That(() => expected.SequenceEqual(result), msg);\r
- var enemyResult = sniffer.Battle.Result.Enemy.Main.Select(s => s.NowHp);\r
- PAssert.That(() => enemy.SequenceEqual(enemyResult), msg);\r
- }\r
-\r
- /// <summary>\r
- /// 開幕夜戦で潜水艦同士がお見合いする\r
- /// </summary>\r
- [TestMethod]\r
- public void SpMidnightWithoutBattle()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "sp_midnight_001");\r
- PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.D);\r
- }\r
-\r
- /// <summary>\r
- /// 夜戦で戦艦が攻撃すると一回で三発分のデータが来る\r
- /// そのうち存在しない攻撃はターゲット、ダメージともに-1になる\r
- /// </summary>\r
- [TestMethod]\r
- public void BattleShipAttackInMidnight()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "midnight_001");\r
- PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.S);\r
- }\r
-\r
- /// <summary>\r
- /// 7隻編成の戦闘で7隻目が攻撃される\r
- /// </summary>\r
- [TestMethod]\r
- public void Ship7Battle()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "ship7battle_001");\r
- PAssert.That(() => sniffer.Battle.ResultRank == BattleResultRank.P);\r
- }\r
-\r
- /// <summary>\r
- /// 演習のあとのportで戦闘結果の検証を行わない\r
- /// </summary>\r
- [TestMethod]\r
- public void NotVerifyBattleResultAfterPractice()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "practice_001");\r
- PAssert.That(() => !sniffer.IsBattleResultStatusError);\r
- }\r
-\r
- /// <summary>\r
- /// 演習でダメコンを発動させない\r
- /// </summary>\r
- [TestMethod]\r
- public void NotTriggerDameconInPractice()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "practice_002");\r
- PAssert.That(() => !sniffer.Battle.DisplayedResultRank.IsError);\r
- }\r
-\r
- /// <summary>\r
- /// 連合艦隊が開幕雷撃で被弾する\r
- /// </summary>\r
- [TestMethod]\r
- public void OpeningTorpedoInCombinedBattle()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "combined_battle_001");\r
- PAssert.That(() => !sniffer.IsBattleResultStatusError);\r
- }\r
-\r
- /// <summary>\r
- /// 連合艦隊が閉幕雷撃で被弾する\r
- /// </summary>\r
- [TestMethod]\r
- public void ClosingTorpedoInCombinedBattle()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "combined_battle_002");\r
- PAssert.That(() => !sniffer.IsBattleResultStatusError);\r
- }\r
-\r
- /// <summary>\r
- /// 第一が6隻未満の連合艦隊で戦闘する\r
- /// </summary>\r
- [TestMethod]\r
- public void SmallCombinedFleetBattle()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "combined_battle_003");\r
- PAssert.That(() => !sniffer.IsBattleResultStatusError);\r
- }\r
-\r
- /// <summary>\r
- /// 護衛退避する\r
- /// </summary>\r
- [TestMethod]\r
- public void EscapeWithEscort()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "escape_001");\r
- PAssert.That(() => sniffer.GetShipStatuses(0)[5].Escaped &&\r
- sniffer.GetShipStatuses(1)[2].Escaped);\r
- }\r
-\r
- /// <summary>\r
- /// 開幕夜戦に支援が来る\r
- /// </summary>\r
- [TestMethod]\r
- public void SpMidnightSupportAttack()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "sp_midnight_002");\r
- PAssert.That(() => !sniffer.Battle.DisplayedResultRank.IsError);\r
- }\r
-\r
- /// <summary>\r
- /// 払暁戦を行う\r
- /// </summary>\r
- [TestMethod]\r
- public void NightToDay()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "nighttoday_001");\r
- PAssert.That(() => !sniffer.Battle.DisplayedResultRank.IsError && !sniffer.IsBattleResultStatusError);\r
- }\r
-\r
- /// <summary>\r
- /// 単艦退避する\r
- /// </summary>\r
- [TestMethod]\r
- public void EscapeWithoutEscort()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "escape_002");\r
- PAssert.That(() => sniffer.GetShipStatuses(2)[1].Escaped);\r
- PAssert.That(() => !sniffer.IsBattleResultStatusError);\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
- /// </summary>\r
- [TestMethod]\r
- public void NotWarnDamagedShipInCombinedFleetOnMapStart()\r
- {\r
- var sniffer = new Sniffer();\r
- SniffLogFile(sniffer, "mapstart_002");\r
- PAssert.That(() => !sniffer.BadlyDamagedShips.Any());\r
- }\r
-\r
- /// <summary>\r
/// 熟練度込みの制空値を正しく計算する\r
/// </summary>\r
[TestMethod]\r
{\r
var sniffer = new Sniffer();\r
SniffLogFile(sniffer, "fighterpower_001");\r
- PAssert.That(() => sniffer.GetFighterPower(0).SequenceEqual(new[] {156, 159}));\r
+ var fleet = sniffer.Fleets[0];\r
+ PAssert.That(() => fleet.FighterPower.SequenceEqual(new[] {156, 159}));\r
SniffLogFile(sniffer, "fighterpower_002");\r
- PAssert.That(() => sniffer.GetFighterPower(0).SequenceEqual(new[] {140, 143}), "全滅したスロットがある");\r
+ PAssert.That(() => fleet.FighterPower.SequenceEqual(new[] {140, 143}), "全滅したスロットがある");\r
}\r
\r
/// <summary>\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.Fleets[0].FighterPower.SequenceEqual(new[] {135, 135}));\r
}\r
\r
/// <summary>\r
}\r
\r
/// <summary>\r
+ /// 基地航空隊の出撃コストを計算する\r
+ /// </summary>\r
+ [TestMethod]\r
+ public void CostForSortieOfBaseAirCorps()\r
+ {\r
+ var sniffer = new Sniffer();\r
+ SniffLogFile(sniffer, "baseaircorps_003");\r
+ PAssert.That(() => sniffer.BaseAirCorps[1].AirCorps[0].CostForSortie.SequenceEqual(new[] {99, 47}));\r
+ }\r
+\r
+ /// <summary>\r
/// 陸上戦闘機の改修レベルを制空値に反映させる。\r
/// </summary>\r
[TestMethod]\r
{\r
var sniffer = new Sniffer();\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
+ 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, 1) - -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
[TestMethod]\r
public void TransportPoint()\r
{\r
- DataLoader.LoadTpSpec();\r
-\r
+ var sniffer = new Sniffer();\r
var msgs = new[] {"", "鬼怒改二+特大発+おにぎり", "駆逐艦+士魂部隊", "補給艦"};\r
var results = new[] {47, 19, 13, 15};\r
for (var i = 0; i < msgs.Length; i++)\r
{\r
- var sniffer = new Sniffer();\r
SniffLogFile(sniffer, "transportpoint_00" + (i + 1));\r
var j = i;\r
- PAssert.That(() => (int)sniffer.GetShipStatuses(0).Sum(s => s.TransportPoint) == results[j], msgs[j]);\r
+ PAssert.That(() => (int)sniffer.Fleets[0].TransportPoint == results[j], msgs[j]);\r
}\r
}\r
\r
{\r
var sniffer = new Sniffer();\r
SniffLogFile(sniffer, "antiairfire_001");\r
- var ships = sniffer.GetShipStatuses(0);\r
+ var ships = sniffer.Fleets[0].Ships;\r
PAssert.That(() => ships.Sum(ship => ship.EffectiveAntiAirForFleet) == 88);\r
PAssert.That(\r
() =>\r
{\r
var sniffer = new Sniffer();\r
SniffLogFile(sniffer, "nightbattlepower_001");\r
- var ships = sniffer.GetShipStatuses(0);\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].Slot[3] = ships[1].Slot[2] = ships[3].Slot[2] = new ItemStatus();\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].Slot[0] = new ItemStatus();\r
+ ships[0].FreeSlot(0);\r
PAssert.That(() => (int)ships[0].NightBattlePower == 0);\r
}\r
\r
/// <summary>\r
+ /// 副砲の改修レベルの効果を計算する\r
+ /// </summary>\r
+ [TestMethod]\r
+ public void SecondaryGunFirepowerLevelBonus()\r
+ {\r
+ var sniffer = new Sniffer();\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
+ /// 連合艦隊補正の載った火力を計算する\r
+ /// </summary>\r
+ [TestMethod]\r
+ public void CombinedFleetFirepower()\r
+ {\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
+ /// 対潜攻撃力を計算する\r
+ /// </summary>\r
+ [TestMethod]\r
+ public void AntiSubmarine()\r
+ {\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
/// </summary>\r
[TestMethod]\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
+ public void DuplicatedPowerUp()\r
{\r
var sniffer = new Sniffer();\r
SniffLogFile(sniffer, "powerup_002");\r
- PAssert.That(() => sniffer.Item.NowShips == 218);\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
+ 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.AlarmEquips, "出撃から母港に戻ったとき");\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.AlarmEquips, "ログインしたとき");\r
+ func.Invoke(sniffer2.ItemCounter.Now);\r
+ PAssert.That(() => sniffer2.ItemCounter.Alarm, "ログインしたとき");\r
}\r
\r
/// <summary>\r
{\r
var sniffer = new Sniffer();\r
SniffLogFile(sniffer, "destroyship_001");\r
- PAssert.That(() => sniffer.Item.NowShips == 250);\r
- PAssert.That(() => sniffer.Item.NowEquips == 1118);\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
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
+ PAssert.That(() => expected.SequenceEqual(sniffer.Fleets.Select(f => f.ChargeStatus)));\r
}\r
\r
/// <summary>\r
{\r
var sniffer = new Sniffer();\r
SniffLogFile(sniffer, "ship2_001");\r
- PAssert.That(() => sniffer.Item.NowShips == 243);\r
+ PAssert.That(() => sniffer.ShipCounter.Now == 243);\r
}\r
\r
/// <summary>\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
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 : 残り 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
+ /// 新規のドロップ艦の初期装備数を登録する\r
+ /// </summary>\r
+ [TestMethod]\r
+ public void RecordNumEquipsOfNewDropShip()\r
+ {\r
+ var sniffer = new Sniffer();\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