private static string Transform(string inputFileName) { using (var stream = new MemoryStream()) { JUnitTransformer.Transform($"./input/{inputFileName}.xml", stream); return(Encoding.UTF8.GetString(stream.ToArray())); } }
public void GivenOnlyFileNameForOutputPath_WhenTransform_ThenCreateFile() { // Act JUnitTransformer.Transform(ExistingInputFilePath, "junit.xml"); // Assert Assert.True(File.Exists("junit.xml")); }
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)); }