コード例 #1
0
        public void QuestionProcessTest()
        {
            var questionProcess = new QuestionProcess(context);

            context.MetalData.AddMetal("Silver", 17);
            context.ParameterData.AddParameter("glob", "I");
            context.ParameterData.AddParameter("prok", "V");

            Assert.IsTrue(questionProcess.IsMatch("how many Credits is glob prok Silver ?"));
            Assert.IsFalse(questionProcess.IsMatch("how much is pish tegj glob glob ?"));
        }
コード例 #2
0
ファイル: BotService.cs プロジェクト: x8426579s/Line_Friday
 public string AddQuestion(string userId)
 {
     using (var db = new LineModel())
     {
         if (HaveQuestion(userId) != 0)
         {
             return("");
         }
         var question = db.MovieQuestion.OrderBy(x => x.Id).FirstOrDefault();
         var instance = new QuestionProcess
         {
             M_Order        = question.Id,
             UserId         = userId,
             QuestionStatus = false,
             ErrorCount     = 0
         };
         db.QuestionProcess.Add(instance);
         db.SaveChanges();
         return(question.M_Question);
     }
 }