public void OneTimeSetUp()
        {
            TestsHelper.RecreateDirectory(tempSlideFolderPath);
            FileSystem.CopyDirectory(TestsHelper.ProjSlideFolderPath, tempSlideFolderPath);

            string studentZipFilepath = Path.Combine(tempSlideFolderPath, "ProjDir.exercise.zip");

            if (File.Exists(studentZipFilepath))
            {
                File.Delete(studentZipFilepath);
            }

            var ctx = new BuildUpContext(new Unit(null, exBlock.SlideFolderPath), CourseSettings.DefaultSettings, null, "Test", string.Empty);

            exBlock.BuildUp(ctx, ImmutableHashSet <string> .Empty).ToList();
        }
예제 #2
0
        public void OneTimeSetUp()
        {
            TestsHelper.RecreateDirectory(tempSlideFolderPath);
            FileSystem.CopyDirectory(TestsHelper.ProjSlideFolderPath, tempSlideFolderPath);

            string studentZipFilepath = Path.Combine(tempSlideFolderPath, "ProjDir.exercise.zip");

            if (File.Exists(studentZipFilepath))
            {
                File.Delete(studentZipFilepath);
            }

            var ctx = new SlideBuildingContext("Test", new Unit(null, exerciseBlock.SlideFolderPath), CourseSettings.DefaultSettings, exerciseBlock.SlideFolderPath, null);

            // ReSharper disable once ReturnValueOfPureMethodIsNotUsed
            exerciseBlock.BuildUp(ctx, ImmutableHashSet <string> .Empty).ToList();
        }
        public void OneTimeSetUp()
        {
            TestsHelper.RecreateDirectory(tempSlideFolderPath);
            FileSystem.CopyDirectory(TestsHelper.ProjSlideFolderPath, tempSlideFolderPath);

            TestsHelper.RecreateDirectory(checkerExerciseFolderPath);
            TestsHelper.RecreateDirectory(studentExerciseFolderPath);

            Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory);

            ex = new CsProjectExerciseBlock
            {
                StartupObject            = "test.Program",
                UserCodeFilePath         = TestsHelper.UserCodeFileName,
                SlideFolderPath          = tempSlideFolder,
                CsProjFilePath           = TestsHelper.CsProjFilePath,
                PathsToExcludeForStudent = new[] { "inner-dir-1\\inner-dir-2\\ExcludeMeForStudent.cs" }
            };

            var unit = new Unit(null, ex.SlideFolderPath);
            var ctx  = new SlideBuildingContext("Test", unit, CourseSettings.DefaultSettings, unit.Directory, null);

            exBlocks = ex.BuildUp(ctx, ImmutableHashSet <string> .Empty).ToList();

            var builder = new ExerciseStudentZipBuilder();

            builder.BuildStudentZip(new ExerciseSlide(exBlocks.ToArray()), studentExerciseZipFilePath);

            Utils.UnpackZip(studentExerciseZipFilePath.ReadAllContent(), studentExerciseFolderPath);

            var zipBytes = ex.GetZipBytesForChecker("i_am_user_code");

            Utils.UnpackZip(zipBytes, checkerExerciseFolderPath);

            studentZipCsproj = new Project(studentCsProjFilePath, null, null, new ProjectCollection());
            checkerZipCsproj = new Project(checkerCsprojFilePath, null, null, new ProjectCollection());
        }
 public void OneTimeSetUp()
 {
     BasicConfigurator.Configure();
     TestsHelper.RecreateDirectory(tempSlideFolderPath);
 }
 public void OneTimeSetUp()
 {
     TestsHelper.RecreateDirectory(tempSlideFolderPath);
 }