public JSONWrappers.Question ToJSON() { JSONWrappers.Question jsonQuestion = new JSONWrappers.Question { Url = PicturesDataBase.ConvertPathToUrl(Path), Type = Type.ToString("G"), Severity = Severity.ToString("G") }; return(jsonQuestion); }
public static List <JSONWrappers.Question> CreateTest(TestConfig config) { List <JSONWrappers.Question> questions = new List <JSONWrappers.Question>(config.TotalCount); foreach (string path in PicturesDataBase.SamplePictures(config)) { Debug.Assert(File.Exists(path), $"Got invalid picture path: {path}."); Question question = new Question(path); questions.Add(question.ToJSON()); } return(questions); }
public static Question FromJSON(JSONWrappers.Question jsonQuestion) { return(new Question(PicturesDataBase.ConvertUrlToPath(jsonQuestion.Url))); }