Ejemplo n.º 1
0
 private static string Transform(string inputFileName)
 {
     using (var stream = new MemoryStream())
     {
         JUnitTransformer.Transform($"./input/{inputFileName}.xml", stream);
         return(Encoding.UTF8.GetString(stream.ToArray()));
     }
 }
Ejemplo n.º 2
0
        public void GivenOnlyFileNameForOutputPath_WhenTransform_ThenCreateFile()
        {
            // Act

            JUnitTransformer.Transform(ExistingInputFilePath, "junit.xml");

            // Assert

            Assert.True(File.Exists("junit.xml"));
        }
Ejemplo n.º 3
0
        public void GivenNonExistingOutputDirectory_WhenTransform_ThenCreateDirectory()
        {
            // Arrange

            var outputFilePath = $"{OutputDirectory}/circle-ci/junit.xml";

            Assert.False(Directory.Exists(OutputDirectory));

            // Act

            JUnitTransformer.Transform(ExistingInputFilePath, outputFilePath);

            // Assert

            Assert.True(File.Exists(outputFilePath));
        }