コード例 #1
0
        public async void StartRunTestOverAllSuccessTest(string homeExercisePath1)
        {
            //Arrange
            HomeExercise homeExercise1 = new HomeExercise()
            {
                HomeExercisePath = homeExercisePath1
            };

            List <HomeExercise> homeExercises = new List <HomeExercise>();

            homeExercises.Add(homeExercise1);


            string           inputFilePath    = @"C:\Users\anton\Desktop\HETS.Project\Matala3\JavaExercises\Exc1\HW1-inout\in1.txt";
            string           outputFilePath   = @"C:\Users\anton\Desktop\HETS.Project\Matala3\JavaExercises\Exc1\HW1-inout\out1.txt";
            string           input            = InputOutputParser.Parser(inputFilePath);
            string           output           = InputOutputParser.Parser(outputFilePath);
            InputOutputModel inputOutputModel = new InputOutputModel()
            {
                InputText = input, OutputText = output
            };
            List <InputOutputModel> inputOutputModels = new List <InputOutputModel>();

            inputOutputModels.Add(inputOutputModel);

            int secondsToWait = 5;
            //Act
            await RunTest.StartRunTest(homeExercises, inputOutputModels, secondsToWait);

            //Assert
            Assert.NotNull(homeExercise1.IsRunTestOk);
        }
コード例 #2
0
        public void InputOutputParserSuccessTest()
        {
            //Arrange
            string expected = " - 1 + 5 * (6-2 ) + 18/(10-4)";
            string filePath = @"C:\Users\anton\Desktop\HETS.Project\Matala3\JavaExercises\Exc1\HW1-inout\in1.txt";
            //Act
            string output = InputOutputParser.Parser(filePath);

            //Assert
            Assert.Contains(expected, output);
        }
コード例 #3
0
        //called on Add I/O files click
        private void ExecuteAddIOFiles()
        {
            OpenFileDialog  openFileDialog = new OpenFileDialog();
            Nullable <bool> result         = openFileDialog.ShowDialog();

            if (result == true)
            {
                var tempIOModel = new InputOutputModel
                {
                    InputTextFullPath = System.IO.Path.GetFullPath(openFileDialog.FileName),
                    InputText         = InputOutputParser.Parser(openFileDialog.FileName)
                };
                ExecuteAddOutputFile(tempIOModel);
            }
        }
コード例 #4
0
        //called on Add Output File click
        private void ExecuteAddOutputFile(InputOutputModel inputOutputModel)
        {
            OpenFileDialog  openFileDialog = new OpenFileDialog();
            Nullable <bool> result         = openFileDialog.ShowDialog();

            if (result == true)
            {
                string output = InputOutputParser.Parser(openFileDialog.FileName);
                if (inputOutputModel != null)
                {
                    inputOutputModel.OutputText = output;
                    InputOutputModels.Add(inputOutputModel);
                }
                else
                {
                    InputOutputModels.Add(new Services.InputOutputModel {
                        OutputText = output
                    });
                }
            }
        }