Ejemplo n.º 1
0
 public void NotChangeFile_OnModify()
 {
     ProjModifier.ModifyCsproj(
         new FileInfo(TestProjectFilename),
         p => ProjModifier.PrepareForChecking(p, "AAA", new string[0]));
     Assert.AreNotEqual("AAA", CreateTestProject().GetProperty("StartupObject"));
 }
Ejemplo n.º 2
0
        private byte[] GetZipBytesForChecker(string code)
        {
            var           directoryName = Path.Combine(SlideFolderPath.FullName, ExerciseDir);
            List <string> excluded      = (PathsToExcludeForChecker ?? new string[0]).Concat(new[] { "bin/*", "obj/*" }).ToList();
            var           exerciseDir   = new DirectoryInfo(directoryName);

            return(exerciseDir.ToZip(excluded,
                                     new[]
            {
                new FileContent {
                    Path = UserCodeFileName, Data = Encoding.UTF8.GetBytes(code)
                },
                new FileContent {
                    Path = CsprojFileName,
                    Data = ProjModifier.ModifyCsproj(
                        exerciseDir.GetFile(CsprojFileName),
                        p => ProjModifier.PrepareForChecking(p, this, excluded))
                }
            }));
        }