Sha256: ceee71398e6ab872823d0fb9790e6fc1ea36117dab5f581dd72e74b828525b67
Contents?: true
Size: 842 Bytes
Versions: 52
Compression:
Stored size: 842 Bytes
Contents
using System.IO; using Serilog; namespace Generators.Output { public class ExerciseWriter { public virtual void WriteToFile(Exercise exercise) { var testClassFilePath = TestClassFilePath(exercise); var testClassContents = exercise.Render(); Directory.CreateDirectory(Path.GetDirectoryName(testClassFilePath)); File.WriteAllText(testClassFilePath, testClassContents); Log.Information("Generated tests for {Exercise} exercise in {TestFile}", exercise.Name, testClassFilePath); } private static string TestClassFilePath(Exercise exercise) => Path.Combine("..", "exercises", exercise.Name, TestClassFileName(exercise)); private static string TestClassFileName(Exercise exercise) => $"{exercise.Name.ToTestClassName()}.cs"; } }
Version data entries
52 entries across 52 versions & 1 rubygems