Roslyn Source generators are not supposed to access I/O. To get around this we have to use `AdditionalFiles` to give the analyzer access to read/load the schema files. To write the schema files we have to use a separate program altogether. - [X] Adds SerializationSchemaGenerator - [X] Splits out the SerializationGenerator code
23 lines
504 B
C#
23 lines
504 B
C#
using System.Collections.Immutable;
|
|
using System.Text;
|
|
using Microsoft.CodeAnalysis;
|
|
using SourceGeneration;
|
|
using Xunit;
|
|
|
|
namespace SerializationGeneratorTests
|
|
{
|
|
public class GenerateClassTests
|
|
{
|
|
[Fact]
|
|
public void Test1()
|
|
{
|
|
var source = new StringBuilder();
|
|
source.GenerateClassStart(
|
|
"TestClass",
|
|
ImmutableArray<ITypeSymbol>.Empty
|
|
);
|
|
|
|
Assert.NotEmpty(source.ToString());
|
|
}
|
|
}
|
|
}
|