diff --git a/Test/SourceExpander.Generator.Test/Generate/Config/ConfigTest.cs b/Test/SourceExpander.Generator.Test/Generate/Config/ConfigTest.cs index 9cd3458..cf9548f 100644 --- a/Test/SourceExpander.Generator.Test/Generate/Config/ConfigTest.cs +++ b/Test/SourceExpander.Generator.Test/Generate/Config/ConfigTest.cs @@ -6,7 +6,7 @@ namespace SourceExpander.Generate.Config { public class ConfigTest : ExpandGeneratorTestBase { - public static readonly TheoryData ParseErrorJsons = new TheoryData + public static readonly TheoryData ParseErrorJsons = new() { { new InMemorySourceText("/foo/bar/SourceExpander.Generator.Config.json", """ diff --git a/Test/Utils/InMemorySourceText.cs b/Test/Utils/InMemorySourceText.cs index b4f7c6d..f2070cc 100644 --- a/Test/Utils/InMemorySourceText.cs +++ b/Test/Utils/InMemorySourceText.cs @@ -5,16 +5,12 @@ namespace SourceExpander { - public class InMemorySourceText : AdditionalText + public class InMemorySourceText(string path, string source, Encoding encoding) : AdditionalText { public InMemorySourceText(string path, string source) : this(path, source, new UTF8Encoding(false)) { } - public InMemorySourceText(string path, string source, Encoding encoding) - { - Path = path; - sourceText = SourceText.From(source, encoding); - } - public override string Path { get; } - private readonly SourceText sourceText; + + public override string Path { get; } = path; + private readonly SourceText sourceText = SourceText.From(source, encoding); public override SourceText GetText(CancellationToken cancellationToken = default) => sourceText; public static implicit operator (string filename, SourceText content)(InMemorySourceText at) => (at.Path, at.sourceText);