Ejemplo n.º 1
0
        public void InspectClearItemGet()
        {
            var sniffer = new Sniffer();
            var result  = "";

            sniffer.SetLogWriter((path, s, h) => { result += s + "|"; }, () => new DateTime(2017, 5, 1));
            sniffer.EnableLog(LogType.Achievement);
            SnifferTest.SniffLogFile(sniffer, "clearitemget_001");
            PAssert.That(() =>
                         "2017-05-01 00:00:00,45417045,0|2017-05-01 00:00:00,45417045,350|" == result);
        }
Ejemplo n.º 2
0
        public void InspectCreateItem()
        {
            var sniffer = new Sniffer();
            var result  = "";

            sniffer.SetLogWriter((path, s, h) => { result += s + "|"; }, () => new DateTime(2015, 1, 1));
            sniffer.EnableLog(LogType.CreateItem);
            SnifferTest.SniffLogFile(sniffer, "createitem_001");
            PAssert.That(() => "2015-01-01 00:00:00,12cm単装砲,小口径主砲,10,10,30,10,綾波改二(145),120|" +
                         "2015-01-01 00:00:00,失敗,,10,10,30,10,綾波改二(145),120|"
                         == result);
        }
Ejemplo n.º 3
0
        public void InspectGetShip()
        {
            var sniffer = new Sniffer();
            var result  = "";

            sniffer.SetLogWriter((path, s, h) => { result += s + "|"; }, () => new DateTime(2015, 1, 1));
            sniffer.EnableLog(LogType.CreateShip);
            SnifferTest.SniffLogFile(sniffer, "createship_001");
            PAssert.That(() => "2015-01-01 00:00:00,通常艦建造,雷,駆逐艦,30,30,30,30,1,1,綾波改二(145),120|" +
                         "2015-01-01 00:00:00,大型艦建造,霧島,巡洋戦艦,1500,1500,2000,1000,1,0,綾波改二(145),120|"
                         == result);
        }
Ejemplo n.º 4
0
        public void InspectCreateItemMulti()
        {
            var sniffer = new Sniffer();
            var result  = "";

            sniffer.SetLogWriter((path, s, h) => { result += s + "|"; }, () => new DateTime(2019, 1, 1));
            sniffer.EnableLog(LogType.CreateItem);
            SnifferTest.SniffLogFile(sniffer, "createitem_002");
            Assert.AreEqual("2019-01-01 00:00:00,失敗,,10,10,30,10,大淀改(167),120|" +
                            "2019-01-01 00:00:00,61cm三連装魚雷,魚雷,10,10,30,10,大淀改(167),120|" +
                            "2019-01-01 00:00:00,失敗,,10,10,30,10,大淀改(167),120|",
                            result);
        }
Ejemplo n.º 5
0
        public void InspectAirRaidBattleBeforeBoss()
        {
            var sniffer = new Sniffer();
            var result  = "";

            sniffer.SetLogWriter((path, s, h) => { result += s + "|"; }, () => new DateTime(2019, 1, 1));
            sniffer.EnableLog(LogType.Battle);
            SnifferTest.SniffLogFile(sniffer, "airraid_battle_003");
            Assert.AreEqual("2019-01-01 00:00:00,北太平洋ハワイ諸島戦域,22,出撃,A,T字戦(不利),単縦陣,輪形陣,,,," +
                            "基地航空隊1(Lv0),200/200,基地航空隊2(Lv0),188/200,基地航空隊3(Lv0),200/200,,,,,,," +
                            "中枢棲姫,900/900,飛行場姫,500/500,飛行場姫,500/500,飛行場姫,500/500,砲台小鬼,130/130,集積地棲姫,600/600,471~473,212,航空優勢,44-4|",
                            result);
        }
Ejemplo n.º 6
0
        public void InspectAirRaidBattle()
        {
            var sniffer = new Sniffer();
            var result  = "";

            sniffer.SetLogWriter((path, s, h) => { result += s + "|"; }, () => new DateTime(2019, 1, 1));
            sniffer.EnableLog(LogType.Battle);
            SnifferTest.SniffLogFile(sniffer, "airraid_battle_001");
            Assert.AreEqual("2019-01-01 00:00:00,アリューシャン列島沖,12,出撃,S,同航戦,単縦陣,輪形陣,,,," +
                            "基地航空隊1(Lv0),200/200,基地航空隊2(Lv0),200/200,基地航空隊3(Lv0),200/200,,,,,,," +
                            "北方棲妹,790/790,砲台小鬼,130/130,砲台小鬼,130/130,飛行場姫,500/500,飛行場姫,500/500,集積地棲姫,600/600,425~426,231,航空優勢,44-3|",
                            result);
        }
Ejemplo n.º 7
0
        public void InspectShip2BattleResult()
        {
            var sniffer = new Sniffer();
            var result  = "";

            sniffer.SetLogWriter((path, s, h) => { result += s + "|"; }, () => new DateTime(2019, 1, 1));
            sniffer.EnableLog(LogType.Battle);
            SnifferTest.SniffLogFile(sniffer, "battle_003");
            Assert.IsFalse(sniffer.IsBattleResultError);
            Assert.AreEqual("2019-01-01 00:00:00,鎮守府正面海域,1,出撃,S,反航戦,単縦陣,単縦陣,敵偵察艦,駆逐艦,睦月," +
                            "早波改(Lv54),32/32,五月雨(Lv20),16/16,,,,,,,,,駆逐ハ級,0/24,,,,,,,,,,,0,0,,1-1|",
                            result);
        }
Ejemplo n.º 8
0
        public void InspectRemodelSlot()
        {
            var sniffer = new Sniffer();
            var result  = "";

            sniffer.SetLogWriter((path, s, h) => { result += s + "|"; }, () => new DateTime(2015, 1, 1));
            sniffer.EnableLog(LogType.RemodelSlot);
            SnifferTest.SniffLogFile(sniffer, "remodel_slot_001");
            PAssert.That(() => "2015-01-01 00:00:00,12.7cm連装砲,4,○,,,,10,30,60,0,1,1,明石改(50),島風改(131)|" +
                         "2015-01-01 00:00:00,12.7cm連装砲,5,×,,,,10,30,60,0,1,1,明石改(50),|" +
                         "2015-01-01 00:00:00,12.7cm連装砲,7,○,,12.7cm連装砲,1,10,30,60,0,1,1,明石改(50),島風改(131)|" +
                         "2015-01-01 00:00:00,91式高射装置,10,○,○,10cm連装高角砲,2,0,0,60,40,9,7,明石改(50),摩耶改(98)|"
                         == result);
        }
Ejemplo n.º 9
0
        public void InspectShip7BattleResult()
        {
            var sniffer = new Sniffer();
            var result  = "";

            sniffer.SetLogWriter((path, s, h) => { result += s + "|"; }, () => new DateTime(2017, 1, 1));
            sniffer.EnableLog(LogType.Battle);
            SnifferTest.SniffLogFile(sniffer, "ship7battle_001");
            PAssert.That(() =>
                         "2017-01-01 00:00:00,台湾沖/ルソン島沖,5,出撃,S,同航戦,単縦陣,単縦陣,深海通商破部隊 前衛水雷戦隊,,," +
                         "あきつ丸改(Lv81),40/40,那智改二(Lv151),63/63,Roma改(Lv99),83/92,阿武隈改二(Lv98),40/45,霞改二(Lv96),13/31,潮改二(Lv94)・不知火改(Lv85),31/33・32/32," +
                         "軽巡ホ級(flagship),0/53,駆逐ロ級後期型,0/37,駆逐ロ級後期型,0/37,駆逐ロ級後期型,0/37,駆逐イ級,0/20,駆逐イ級,0/20,317~318,0,制空権確保,40-2|"
                         == result);
        }
Ejemplo n.º 10
0
        public void InspectBattleResult()
        {
            var sniffer = new Sniffer();
            var result  = "";

            sniffer.SetLogWriter((path, s, h) => { result += s + "|"; }, () => new DateTime(2017, 1, 1));
            sniffer.EnableLog(LogType.Battle);
            SnifferTest.SniffLogFile(sniffer, "battle_001");
            PAssert.That(() =>
                         "2017-01-01 00:00:00,カレー洋制圧戦,1,出撃,A,T字戦(有利),警戒陣,梯形陣,敵潜水教導艦隊,,," +
                         "隼鷹改二(Lv157),57/62,利根改二(Lv151),66/66,千代田航改二(Lv159),50/65,千歳航改二(Lv159),65/65,大井改二(Lv57),40/43,秋月改(Lv142),42/42," +
                         "潜水ヨ級(elite),34/34,潜水ヨ級,5/24,潜水ヨ級,0/24,潜水カ級(elite),0/27,潜水カ級,0/19,潜水カ級,0/19,248~249,0,制空権確保,4-2|"
                         == result);
        }
Ejemplo n.º 11
0
        public void InspectClearItemGetSeiran631Ku()
        {
            var sniffer = new Sniffer(true);

            sniffer.SetLogWriter((path, s, h) => { }, () => new DateTime(2017, 5, 1));
            sniffer.EnableLog(LogType.Achievement);
            sniffer.Sniff("/kcsapi/api_req_quest/clearitemget",
                          "api%5Fquest%5Fid=656&api%5Fverno=1",
                          JsonObject.Parse(
                              @"{""api_result"":1,""api_result_msg"":""成功"",""api_data"":
                    {""api_material"":[0,0,0,0],""api_bounus"":[
                    {""api_type"":15,""api_count"":1,""api_item"":{""api_id_from"":9999,""api_id_to"":9999,
                    ""api_message"":""第一潜水隊運用航空隊:「晴嵐(六三一空)」の新編成を<br>完了しました!""}}
                    ]}}"));
        }
Ejemplo n.º 12
0
        public void InspectMaterial()
        {
            var sniffer = new Sniffer();
            var result  = "";
            var first   = new DateTime(2015, 1, 1, 0, 0, 0);
            var queue   =
                new Queue <DateTime>(new[] { first, first.AddMinutes(10), first.AddMinutes(15), first.AddMinutes(20) });

            sniffer.SetLogWriter((path, s, h) => { result += s + "|"; }, queue.Dequeue);
            sniffer.EnableLog(LogType.Material);
            SnifferTest.SniffLogFile(sniffer, "material_001");
            PAssert.That(() => "2015-01-01 00:00:00,26178,26742,21196,33750,1426,1574,2185,10|" +
                         "2015-01-01 00:10:00,24595,25353,18900,32025,1427,1576,2187,10|" +
                         "2015-01-01 00:20:00,23463,25064,17314,31765,1427,1572,2187,10|"
                         == result);
        }
Ejemplo n.º 13
0
        public void MissionResultGetScrew()
        {
            var sniffer = new Sniffer(true);
            var result  = "";
            var header  = "";

            sniffer.SetLogWriter((path, s, h) =>
            {
                result += s + "|";
                header  = h;
            }, () => new DateTime(2019, 1, 1));
            sniffer.EnableLog(LogType.Mission);
            SnifferTest.SniffLogFile(sniffer, "mission_result_002");
            PAssert.That(() => "日付,結果,遠征,燃料,弾薬,鋼材,ボーキ,開発資材,高速修復材,高速建造材,改修資材" == header);
            PAssert.That(() => "2019-01-01 00:00:00,大成功,南西諸島離島防衛作戦,0,0,1800,975,0,0,0,1|"
                         == result);
        }
Ejemplo n.º 14
0
        public void InspectMissionResult()
        {
            var sniffer = new Sniffer(true);
            var result  = "";
            var header  = "";

            sniffer.SetLogWriter((path, s, h) =>
            {
                result += s + "|";
                header  = h;
            }, () => new DateTime(2015, 1, 1));
            sniffer.EnableLog(LogType.Mission);
            SnifferTest.SniffLogFile(sniffer, "mission_result_001");
            PAssert.That(() => "日付,結果,遠征,燃料,弾薬,鋼材,ボーキ,開発資材,高速修復材,高速建造材,改修資材" == header);
            PAssert.That(() => "2015-01-01 00:00:00,成功,長距離練習航海,0,100,30,0,0,0,0,0|" +
                         "2015-01-01 00:00:00,成功,長距離練習航海,0,100,30,0,0,1,0,0|" +
                         "2015-01-01 00:00:00,大成功,MO作戦,0,0,360,420,1,0,0,0|" +
                         "2015-01-01 00:00:00,失敗,東京急行(弐),0,0,0,0,0,0,0,0|"
                         == result);
        }