public void GetFileContents_ClassPathWithoutJUnit_JUnitAdded()
        {
            var project = GetProject();
            var student = GetStudent();

            var file = new UncompressedMemoryArchiveFile
            (
                "Project1\\.classpath",
                GetClasspathFile(includeJUnit: false)
            );

            var transformer = new SubmissionFileTransformer();

            var result = transformer.GetFileContents(project, student, file);
            var decodedResult = Encoding.UTF8.GetString(result);
            var parsedResult = XElement.Parse(decodedResult.Substring(decodedResult.IndexOf("<")));
            var junitNodes = parsedResult.Elements()
                .Where(node => node.Name == "classpathentry")
                .Where
                (
                    node => node.Attribute("path")
                                ?.Value == "org.eclipse.jdt.junit.JUNIT_CONTAINER/4"
                ).ToList();

            Assert.Equal(1, junitNodes.Count);
        }
        public void GetFileContents_NormalFile_NotTransformed()
        {
            var project = GetProject();
            var student = GetStudent();

            var file = new UncompressedMemoryArchiveFile
            (
                "Project1\\SomeNormalFile.txt",
                Encoding.UTF8.GetBytes
                (
                    "SomeNormalFile"
                )
            );

            var transformer = new SubmissionFileTransformer();

            var result = transformer.GetFileContents(project, student, file);
            var decodedResult = Encoding.UTF8.GetString(result);

            Assert.Equal("SomeNormalFile", decodedResult);
        }
        public void GetFileContents_ProjectFile_ProjectRenamed()
        {
            var project = GetProject();
            var student = GetStudent();

            var file = new UncompressedMemoryArchiveFile
            (
                "Project1\\.project",
                Encoding.UTF8.GetBytes
                (
                    "Before<name>Project1</name>After"
                )
            );

            var transformer = new SubmissionFileTransformer();

            var result = transformer.GetFileContents(project, student, file);
            var decodedResult = Encoding.UTF8.GetString(result);

            Assert.Equal("Before<name>Project1_LastNameFirstName</name>After", decodedResult);
        }