Esempio n. 1
0
        public async Task ProcessInput(Result result)
        {
            var inputFile  = Path.Combine(_inputPath, result.FileName);
            var outputFile = Path.Combine(_outputPath, result.FileName.Replace("input", "output"));

            using (var inputStream = new StreamReader(inputFile))
                using (var outputStream = new StreamReader(outputFile))
                {
                    var challengeResult = await _challengeRunner.Check(inputStream, outputStream);

                    if (challengeResult != null)
                    {
                        result.IsCorrect = challengeResult.IsCorrect;
                        result.Output    = challengeResult.Output;
                    }
                    else
                    {
                        result.ErrorMessage = "Input Inválido";
                    }
                    result.Done = true;
                }
        }