コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LoggableGeneratorTest{T}"/> class.
        /// </summary>
        /// <param name="enableDiagnostics">Determines whether to enable diagnostics for the created <see cref="ILoggableSourceGenerator"/> if it supports any.</param>
        protected LoggableGeneratorTest(bool enableDiagnostics)
        {
            string typeName = GetType().Name;

            _configuration = GeneratorLoggingConfiguration.CreateConfigurationForGenerator <T>();
            _configuration.LogDirectory += $"/{typeName}";
            _enableDiagnostics           = enableDiagnostics;
        }
コード例 #2
0
 /// <summary>
 /// Creates a new <see cref="ILoggableSourceGenerator"/> based on the specified <paramref name="configuration"/> and <paramref name="testName"/>.
 /// </summary>
 /// <param name="configuration">Configuration for the <see cref="ILoggableSourceGenerator"/>.</param>
 /// <param name="testName">Name of the current test.</param>
 protected abstract T CreateGenerator(GeneratorLoggingConfiguration configuration, string testName);
コード例 #3
0
 public TestableGenerator(GeneratorLoggingConfiguration configuration, string testName) : base(configuration, new TestNameToFile(testName))
 {
 }