Пример #1
0
        string postQuest(DateTime time)
        {
            string quest_name = RecommendQuestCalculator.recommandQuest(time);

            (int day, DateTime nextday) = RecommendQuestCalculator.nextQuest("暗影渦巻く壊れた世界", time);
            string postStr = string.Format("今日のおすすめクエストは{0}です。次の暗影は{1}です。",
                                           quest_name,
                                           nextday.ToString("MM月dd日"));

            return(postStr);
        }
Пример #2
0
        public void RecomQuest_test()
        {
            //List<string> quest_list = new List<string>() { "暗影渦巻く壊れた世界", "境界を貫く双角の凶鳥", "混沌導く闇の化身", "混沌産み出す闇の化身", "混沌喚び出す龍の咆哮" };
            List <string> quest_list = new List <string>()
            {
                "暗影渦巻く壊れた世界", "平穏を引き裂く混沌", "混沌導く闇の化身", "戦塵を招く魔城の脅威", "静寂に生まれし混沌"
            };
            DateTime d   = new DateTime(2019, 8, 21);
            DateTime epc = new DateTime(2019, 8, 20);

            for (int i = 0; i < 30; i++)
            {
                string quest      = RecommendQuestCalculator.recommandQuest(d);
                int    expect_day = (d - epc).Days % 5;
                Assert.AreEqual(quest_list[expect_day], quest);

                d += new TimeSpan(1, 0, 0, 0);
            }
        }