Husqvik / GraphQlClientGenerator

GraphQL C# client generator
MIT License
213 stars 49 forks source link

Add support for FileScopedNamespaces to OneClassPerFile OutputType #149

Closed SlyCedix closed 9 months ago

SlyCedix commented 11 months ago

Add functions WriteNamespaceStart and WriteNamespaceEnd to GenerationContext to support FileScopedNamespaces in both contexts.

Changes some indentation logic to further support this

Update unit tests to call GenerationContext constructor correctly

Unit tests made line ending agnostic with StringCompareShould.IgnoreLineEndings

SlyCedix commented 11 months ago

The only test that is still platform dependent now is the MultipleFileGeneration test, could be fixed by enforcing the use of a specific line ending on the writer in MultipleFileGenerationContext.InitializeNewSourceCodeFile. Though this could cause problems if \n was used on a system which uses \r