public void SubjectBll_GetSubjectDetails_ShouldReturnAllInfo() { SubjectBll bll = new SubjectBll(); var result = bll.GetSubjectDetails(10000); Assert.IsNotNull(result); Console.WriteLine(result.ToJson()); }
public ActionResult GetDetails(int id) { SubjectBll bll = new SubjectBll(); DtoSubject subject = bll.GetSubjectDetails(id); QuestionInputModel derived = ConvertToDerived(subject.Content); derived.Difficulty = subject.Difficulty; derived.Explain = subject.Content.Ysc_Explain; derived.Grade = subject.Grade; derived.Id = subject.Id; derived.Mark = subject.Mark; derived.SubjectStatus = (SubjectStatusEnum)subject.Status; derived.Keywords = subject.Keywords; derived.Knowledge = subject.MainKnowledge; derived.KnowledgeText = subject.MainKnowledgeName; derived.Knowledges = string.Join(",", subject.Knowledges); derived.KnowledgeTexts = subject.KnowledgeNames; derived.PlainName = subject.Name; derived.Name = FormatStem(derived.Name); var response = new SuccessJsonResponse(derived); return(Json(response, JsonRequestBehavior.AllowGet)); }