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 ?")); }
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); } }