public void NotChangeFile_OnModify() { ProjModifier.ModifyCsproj( new FileInfo(TestProjectFilename), p => ProjModifier.PrepareForChecking(p, "AAA", new string[0])); Assert.AreNotEqual("AAA", CreateTestProject().GetProperty("StartupObject")); }
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)) } })); }