private static BatchTestTestResultTypeViewModel TranslateType(SolutionEvaluationTestResultType type) { switch (type) { case SolutionEvaluationTestResultType.CheckerCouldNotBind: return(BatchTestTestResultTypeViewModel.CouldNotBind); case SolutionEvaluationTestResultType.CheckerCrashed: return(BatchTestTestResultTypeViewModel.CheckerCrashed); case SolutionEvaluationTestResultType.CorrectAnswer: return(BatchTestTestResultTypeViewModel.CorrectAnswer); case SolutionEvaluationTestResultType.WrongAnswer: return(BatchTestTestResultTypeViewModel.WrongAnswer); case SolutionEvaluationTestResultType.MemoryLimitExceeded: return(BatchTestTestResultTypeViewModel.MemoryLimitExceeded); case SolutionEvaluationTestResultType.PartiallyCorrectAnswer: return(BatchTestTestResultTypeViewModel.PartiallyCorrectAnswer); case SolutionEvaluationTestResultType.ProgramCrashed: return(BatchTestTestResultTypeViewModel.ProgramCrashed); case SolutionEvaluationTestResultType.TimeLimitExceeded: return(BatchTestTestResultTypeViewModel.TimeLimitExceeded); default: throw new NotImplementedException(); } }
private bool TryTranslateUngracefulExit(ProcessExitType processExitType, out SolutionEvaluationTestResultType type) { switch (processExitType) { case ProcessExitType.Crashed: type = SolutionEvaluationTestResultType.ProgramCrashed; return(true); case ProcessExitType.Timeout: type = SolutionEvaluationTestResultType.TimeLimitExceeded; return(true); default: type = default(SolutionEvaluationTestResultType); return(false); } }