diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/TestBaseTypeNotSpecifiedInCodeBehind/GlobalStaticResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/TestBaseTypeNotSpecifiedInCodeBehind/XamlCodeGenerator_GlobalStaticResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/TestBaseTypeNotSpecifiedInCodeBehind/GlobalStaticResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/TestBaseTypeNotSpecifiedInCodeBehind/XamlCodeGenerator_GlobalStaticResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/TestBaseTypeNotSpecifiedInCodeBehind/LocalizationResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/TestBaseTypeNotSpecifiedInCodeBehind/XamlCodeGenerator_LocalizationResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/TestBaseTypeNotSpecifiedInCodeBehind/LocalizationResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/TestBaseTypeNotSpecifiedInCodeBehind/XamlCodeGenerator_LocalizationResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/TestBaseTypeNotSpecifiedInCodeBehind/MainPage_d6cd66944958ced0c513e0a04797b51d.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/TestBaseTypeNotSpecifiedInCodeBehind/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/TestBaseTypeNotSpecifiedInCodeBehind/MainPage_d6cd66944958ced0c513e0a04797b51d.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/TestBaseTypeNotSpecifiedInCodeBehind/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/TestBaseTypeNotSpecifiedInCodeBehind/UserControl1_81d855d5b3bba02f594dcda3b149beb2.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/TestBaseTypeNotSpecifiedInCodeBehind/XamlCodeGenerator_UserControl1_81d855d5b3bba02f594dcda3b149beb2.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/TestBaseTypeNotSpecifiedInCodeBehind/UserControl1_81d855d5b3bba02f594dcda3b149beb2.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/TestBaseTypeNotSpecifiedInCodeBehind/XamlCodeGenerator_UserControl1_81d855d5b3bba02f594dcda3b149beb2.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Binding_ElementName_In_Template/Binding_ElementName_In_Template_66bf0a54f1801c397a6fa4930a237eca.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Binding_ElementName_In_Template/XamlCodeGenerator_Binding_ElementName_In_Template_66bf0a54f1801c397a6fa4930a237eca.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Binding_ElementName_In_Template/Binding_ElementName_In_Template_66bf0a54f1801c397a6fa4930a237eca.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Binding_ElementName_In_Template/XamlCodeGenerator_Binding_ElementName_In_Template_66bf0a54f1801c397a6fa4930a237eca.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Binding_ElementName_In_Template/GlobalStaticResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Binding_ElementName_In_Template/XamlCodeGenerator_GlobalStaticResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Binding_ElementName_In_Template/GlobalStaticResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Binding_ElementName_In_Template/XamlCodeGenerator_GlobalStaticResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Binding_ElementName_In_Template/LocalizationResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Binding_ElementName_In_Template/XamlCodeGenerator_LocalizationResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Binding_ElementName_In_Template/LocalizationResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Binding_ElementName_In_Template/XamlCodeGenerator_LocalizationResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Both_Syntaxes/GlobalStaticResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Both_Syntaxes/XamlCodeGenerator_GlobalStaticResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Both_Syntaxes/GlobalStaticResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Both_Syntaxes/XamlCodeGenerator_GlobalStaticResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Both_Syntaxes/Grid_Uses_Both_Syntaxes_794c1760299b374d12fe38ba3b633206.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Both_Syntaxes/XamlCodeGenerator_Grid_Uses_Both_Syntaxes_794c1760299b374d12fe38ba3b633206.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Both_Syntaxes/Grid_Uses_Both_Syntaxes_794c1760299b374d12fe38ba3b633206.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Both_Syntaxes/XamlCodeGenerator_Grid_Uses_Both_Syntaxes_794c1760299b374d12fe38ba3b633206.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Both_Syntaxes/LocalizationResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Both_Syntaxes/XamlCodeGenerator_LocalizationResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Both_Syntaxes/LocalizationResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Both_Syntaxes/XamlCodeGenerator_LocalizationResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Common_Syntax/GlobalStaticResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Common_Syntax/XamlCodeGenerator_GlobalStaticResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Common_Syntax/GlobalStaticResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Common_Syntax/XamlCodeGenerator_GlobalStaticResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Common_Syntax/Grid_Uses_Common_Syntax_8659265dc2cabf0b5a684f0f4b26f8b7.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Common_Syntax/XamlCodeGenerator_Grid_Uses_Common_Syntax_8659265dc2cabf0b5a684f0f4b26f8b7.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Common_Syntax/Grid_Uses_Common_Syntax_8659265dc2cabf0b5a684f0f4b26f8b7.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Common_Syntax/XamlCodeGenerator_Grid_Uses_Common_Syntax_8659265dc2cabf0b5a684f0f4b26f8b7.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Common_Syntax/LocalizationResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Common_Syntax/XamlCodeGenerator_LocalizationResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Common_Syntax/LocalizationResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_Common_Syntax/XamlCodeGenerator_LocalizationResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Assigned_ContentProperty_Syntax/GlobalStaticResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Assigned_ContentProperty_Syntax/XamlCodeGenerator_GlobalStaticResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Assigned_ContentProperty_Syntax/GlobalStaticResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Assigned_ContentProperty_Syntax/XamlCodeGenerator_GlobalStaticResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Assigned_ContentProperty_Syntax/Grid_Uses_New_Assigned_ContentProperty_Syntax_9f853e56098ff21d39f15479035509ef.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Assigned_ContentProperty_Syntax/XamlCodeGenerator_Grid_Uses_New_Assigned_ContentProperty_Syntax_9f853e56098ff21d39f15479035509ef.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Assigned_ContentProperty_Syntax/Grid_Uses_New_Assigned_ContentProperty_Syntax_9f853e56098ff21d39f15479035509ef.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Assigned_ContentProperty_Syntax/XamlCodeGenerator_Grid_Uses_New_Assigned_ContentProperty_Syntax_9f853e56098ff21d39f15479035509ef.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Assigned_ContentProperty_Syntax/LocalizationResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Assigned_ContentProperty_Syntax/XamlCodeGenerator_LocalizationResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Assigned_ContentProperty_Syntax/LocalizationResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Assigned_ContentProperty_Syntax/XamlCodeGenerator_LocalizationResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Succinct_Syntax/GlobalStaticResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Succinct_Syntax/XamlCodeGenerator_GlobalStaticResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Succinct_Syntax/GlobalStaticResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Succinct_Syntax/XamlCodeGenerator_GlobalStaticResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Succinct_Syntax/Grid_Uses_New_Succinct_Syntax_cc38332c9fd4c0da9c1fa0270bbd3609.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Succinct_Syntax/XamlCodeGenerator_Grid_Uses_New_Succinct_Syntax_cc38332c9fd4c0da9c1fa0270bbd3609.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Succinct_Syntax/Grid_Uses_New_Succinct_Syntax_cc38332c9fd4c0da9c1fa0270bbd3609.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Succinct_Syntax/XamlCodeGenerator_Grid_Uses_New_Succinct_Syntax_cc38332c9fd4c0da9c1fa0270bbd3609.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Succinct_Syntax/LocalizationResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Succinct_Syntax/XamlCodeGenerator_LocalizationResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Succinct_Syntax/LocalizationResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Grid_Uses_New_Succinct_Syntax/XamlCodeGenerator_LocalizationResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Invalid_Element_Property/LocalizationResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Invalid_Element_Property/XamlCodeGenerator_LocalizationResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Invalid_Element_Property/LocalizationResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Invalid_Element_Property/XamlCodeGenerator_LocalizationResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeDoesNotExists/GlobalStaticResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeDoesNotExists/XamlCodeGenerator_GlobalStaticResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeDoesNotExists/GlobalStaticResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeDoesNotExists/XamlCodeGenerator_GlobalStaticResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeDoesNotExists/LocalizationResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeDoesNotExists/XamlCodeGenerator_LocalizationResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeDoesNotExists/LocalizationResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeDoesNotExists/XamlCodeGenerator_LocalizationResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeDoesNotExists/MainPage_d6cd66944958ced0c513e0a04797b51d.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeDoesNotExists/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeDoesNotExists/MainPage_d6cd66944958ced0c513e0a04797b51d.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeDoesNotExists/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/TestRepro.MyViewModel.g.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/ObservablePropertyGenerator_TestRepro.MyViewModel.g.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/TestRepro.MyViewModel.g.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/ObservablePropertyGenerator_TestRepro.MyViewModel.g.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/__KnownINotifyPropertyChangedArgs.g.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/ObservablePropertyGenerator___KnownINotifyPropertyChangedArgs.g.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/__KnownINotifyPropertyChangedArgs.g.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/ObservablePropertyGenerator___KnownINotifyPropertyChangedArgs.g.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/__KnownINotifyPropertyChangingArgs.g.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/ObservablePropertyGenerator___KnownINotifyPropertyChangingArgs.g.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/__KnownINotifyPropertyChangingArgs.g.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/ObservablePropertyGenerator___KnownINotifyPropertyChangingArgs.g.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/GlobalStaticResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/XamlCodeGenerator_GlobalStaticResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/GlobalStaticResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/XamlCodeGenerator_GlobalStaticResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/LocalizationResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/XamlCodeGenerator_LocalizationResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/LocalizationResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/XamlCodeGenerator_LocalizationResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/MainPage_d6cd66944958ced0c513e0a04797b51d.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/MainPage_d6cd66944958ced0c513e0a04797b51d.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists__name/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/TestRepro.MyViewModel.g.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/ObservablePropertyGenerator_TestRepro.MyViewModel.g.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/TestRepro.MyViewModel.g.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/ObservablePropertyGenerator_TestRepro.MyViewModel.g.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/__KnownINotifyPropertyChangedArgs.g.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/ObservablePropertyGenerator___KnownINotifyPropertyChangedArgs.g.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/__KnownINotifyPropertyChangedArgs.g.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/ObservablePropertyGenerator___KnownINotifyPropertyChangedArgs.g.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/__KnownINotifyPropertyChangingArgs.g.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/ObservablePropertyGenerator___KnownINotifyPropertyChangingArgs.g.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/__KnownINotifyPropertyChangingArgs.g.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/ObservablePropertyGenerator___KnownINotifyPropertyChangingArgs.g.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/GlobalStaticResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/XamlCodeGenerator_GlobalStaticResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/GlobalStaticResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/XamlCodeGenerator_GlobalStaticResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/LocalizationResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/XamlCodeGenerator_LocalizationResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/LocalizationResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/XamlCodeGenerator_LocalizationResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/MainPage_d6cd66944958ced0c513e0a04797b51d.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/MainPage_d6cd66944958ced0c513e0a04797b51d.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_m_name/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/TestRepro.MyViewModel.g.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/ObservablePropertyGenerator_TestRepro.MyViewModel.g.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/TestRepro.MyViewModel.g.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/ObservablePropertyGenerator_TestRepro.MyViewModel.g.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/__KnownINotifyPropertyChangedArgs.g.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/ObservablePropertyGenerator___KnownINotifyPropertyChangedArgs.g.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/__KnownINotifyPropertyChangedArgs.g.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/ObservablePropertyGenerator___KnownINotifyPropertyChangedArgs.g.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/__KnownINotifyPropertyChangingArgs.g.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/ObservablePropertyGenerator___KnownINotifyPropertyChangingArgs.g.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/__KnownINotifyPropertyChangingArgs.g.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/ObservablePropertyGenerator___KnownINotifyPropertyChangingArgs.g.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/GlobalStaticResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/XamlCodeGenerator_GlobalStaticResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/GlobalStaticResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/XamlCodeGenerator_GlobalStaticResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/LocalizationResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/XamlCodeGenerator_LocalizationResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/LocalizationResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/XamlCodeGenerator_LocalizationResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/MainPage_d6cd66944958ced0c513e0a04797b51d.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/MainPage_d6cd66944958ced0c513e0a04797b51d.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_ObservableProperty_AttributeExists_name/XamlCodeGenerator_MainPage_d6cd66944958ced0c513e0a04797b51d.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Common_Properties/Binding_Xaml_Object_With_Common_Properties_4891310bc693a433ba9a8e9f5113f94f.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Common_Properties/XamlCodeGenerator_Binding_Xaml_Object_With_Common_Properties_4891310bc693a433ba9a8e9f5113f94f.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Common_Properties/Binding_Xaml_Object_With_Common_Properties_4891310bc693a433ba9a8e9f5113f94f.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Common_Properties/XamlCodeGenerator_Binding_Xaml_Object_With_Common_Properties_4891310bc693a433ba9a8e9f5113f94f.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Common_Properties/GlobalStaticResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Common_Properties/XamlCodeGenerator_GlobalStaticResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Common_Properties/GlobalStaticResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Common_Properties/XamlCodeGenerator_GlobalStaticResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Common_Properties/LocalizationResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Common_Properties/XamlCodeGenerator_LocalizationResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Common_Properties/LocalizationResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Common_Properties/XamlCodeGenerator_LocalizationResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Xaml_Object_Properties/Binding_Xaml_Object_With_Xaml_Object_Properties_5147419e44d1bc3e3f86860ad528476f.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Xaml_Object_Properties/XamlCodeGenerator_Binding_Xaml_Object_With_Xaml_Object_Properties_5147419e44d1bc3e3f86860ad528476f.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Xaml_Object_Properties/Binding_Xaml_Object_With_Xaml_Object_Properties_5147419e44d1bc3e3f86860ad528476f.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Xaml_Object_Properties/XamlCodeGenerator_Binding_Xaml_Object_With_Xaml_Object_Properties_5147419e44d1bc3e3f86860ad528476f.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Xaml_Object_Properties/GlobalStaticResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Xaml_Object_Properties/XamlCodeGenerator_GlobalStaticResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Xaml_Object_Properties/GlobalStaticResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Xaml_Object_Properties/XamlCodeGenerator_GlobalStaticResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Xaml_Object_Properties/LocalizationResources.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Xaml_Object_Properties/XamlCodeGenerator_LocalizationResources.cs similarity index 100% rename from src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Xaml_Object_Properties/LocalizationResources.cs rename to src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/TestOutput/When_Xaml_Object_With_Xaml_Object_Properties/XamlCodeGenerator_LocalizationResources.cs diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/Verifiers/CSGenerator.cs b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/Verifiers/CSGenerator.cs index 5d3e0f8e8bae..555b3bc03282 100644 --- a/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/Verifiers/CSGenerator.cs +++ b/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests/XamlCodeGeneratorTests/Verifiers/CSGenerator.cs @@ -6,6 +6,7 @@ using System.Diagnostics; using System.Runtime.CompilerServices; using System.Text; +using CommunityToolkit.Mvvm.SourceGenerators; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Testing; @@ -117,7 +118,7 @@ protected override Project ApplyCompilationOptions(Project project) foreach (var tree in compilation.SyntaxTrees.Skip(project.DocumentIds.Count)) { WriteTreeToDiskIfNecessary(tree, resourceDirectory); - expectedNames.Add(Path.GetFileName(tree.FilePath)); + expectedNames.Add(GetFileNameFromTree(tree)); } var currentTestPrefix = $"Uno.UI.SourceGenerators.netcore.Tests.XamlCodeGeneratorTests.{TestOutputFolderName}.{_testMethodName}."; @@ -155,12 +156,29 @@ public Test AddGeneratedSources() using var reader = new StreamReader(resourceStream, Encoding.UTF8, detectEncodingFromByteOrderMarks: true, bufferSize: 4096, leaveOpen: true); var name = resourceName.Substring(expectedPrefix.Length); - TestState.GeneratedSources.Add((typeof(XamlCodeGenerator), name, reader.ReadToEnd())); + var underscoreIndex = name.IndexOf('_'); + var generatorName = name.Substring(0, underscoreIndex); + name = name.Substring(underscoreIndex + 1); + + var type = generatorName switch + { + "XamlCodeGenerator" => typeof(XamlCodeGenerator), + "ObservablePropertyGenerator" => typeof(ObservablePropertyGenerator), + _ => throw new Exception("Unexpected generator name"), + }; + TestState.GeneratedSources.Add((type, name, reader.ReadToEnd())); } return this; } + private static string GetFileNameFromTree(SyntaxTree tree) + { + var generatorName = new DirectoryInfo(tree.FilePath).Parent!.Name; + generatorName = generatorName.Substring(generatorName.LastIndexOf('.') + 1); + return $"{generatorName}_{Path.GetFileName(tree.FilePath)}"; + } + [Conditional("WRITE_EXPECTED")] private static void WriteTreeToDiskIfNecessary(SyntaxTree tree, string resourceDirectory) { @@ -169,7 +187,8 @@ private static void WriteTreeToDiskIfNecessary(SyntaxTree tree, string resourceD throw new ArgumentException("Syntax tree encoding was not specified"); } - var name = Path.GetFileName(tree.FilePath); + var name = GetFileNameFromTree(tree); + var filePath = Path.Combine(resourceDirectory, name); Directory.CreateDirectory(resourceDirectory); File.WriteAllText(filePath, tree.GetText().ToString(), tree.Encoding);