diff --git a/src/Directory.Build.props b/src/Directory.Build.props index b17be43..b70ec23 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -32,7 +32,7 @@ - + @@ -47,9 +47,9 @@ - + - \ No newline at end of file + diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/ModuleInitializer.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/ModuleInitializer.cs index 5303908..0348a91 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/ModuleInitializer.cs +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/ModuleInitializer.cs @@ -15,5 +15,5 @@ public static class ModuleInitializer /// Initializes the source generators. /// [ModuleInitializer] - public static void Init() => VerifySourceGenerators.Enable(); + public static void Init() => VerifySourceGenerators.Initialize(); } diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail.verified.txt new file mode 100644 index 0000000..796078d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail.verified.txt @@ -0,0 +1,28 @@ +{ + Diagnostics: [ + { + Id: SPLATDI005, + Title: Constructors must not have a circular dependency, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (26,36)-(26,44), + Description: , + HelpLink: , + MessageFormat: Constructor parameters must not have a circular dependency to another registered resource, + Message: Constructor parameters must not have a circular dependency to another registered resource, + Category: Compiler + }, + { + Id: SPLATDI005, + Title: Constructors must not have a circular dependency, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (18,36)-(18,44), + Description: , + HelpLink: , + MessageFormat: Constructor parameters must not have a circular dependency to another registered resource, + Message: Constructor parameters must not have a circular dependency to another registered resource, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail_Test1.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail_Test1.verified.txt new file mode 100644 index 0000000..796078d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail_Test1.verified.txt @@ -0,0 +1,28 @@ +{ + Diagnostics: [ + { + Id: SPLATDI005, + Title: Constructors must not have a circular dependency, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (26,36)-(26,44), + Description: , + HelpLink: , + MessageFormat: Constructor parameters must not have a circular dependency to another registered resource, + Message: Constructor parameters must not have a circular dependency to another registered resource, + Category: Compiler + }, + { + Id: SPLATDI005, + Title: Constructors must not have a circular dependency, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (18,36)-(18,44), + Description: , + HelpLink: , + MessageFormat: Constructor parameters must not have a circular dependency to another registered resource, + Message: Constructor parameters must not have a circular dependency to another registered resource, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail_Test2.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail_Test2.verified.txt new file mode 100644 index 0000000..796078d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.CircularDependencyFail_Test2.verified.txt @@ -0,0 +1,28 @@ +{ + Diagnostics: [ + { + Id: SPLATDI005, + Title: Constructors must not have a circular dependency, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (26,36)-(26,44), + Description: , + HelpLink: , + MessageFormat: Constructor parameters must not have a circular dependency to another registered resource, + Message: Constructor parameters must not have a circular dependency to another registered resource, + Category: Compiler + }, + { + Id: SPLATDI005, + Title: Constructors must not have a circular dependency, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (18,36)-(18,44), + Description: , + HelpLink: , + MessageFormat: Constructor parameters must not have a circular dependency to another registered resource, + Message: Constructor parameters must not have a circular dependency to another registered resource, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjection#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjection#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..93b8007 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjection#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} ); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy)); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest)); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjection#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjection#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjection#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjectionTypeArgument#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjectionTypeArgument#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..42f56e3 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjectionTypeArgument#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} ); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy)); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.TestConcrete)); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjectionTypeArgument#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjectionTypeArgument#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjectionTypeArgument#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..e0928a9 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} ); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test1"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.TestConcrete), "Test1"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..66a756f --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} ); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test2"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.TestConcrete), "Test2"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjection_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjection_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..6fcc669 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjection_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} ); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test1"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test1"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjection_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjection_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjection_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjection_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjection_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..b4a7556 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjection_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} ); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test2"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test2"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjection_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjection_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalPropertyInjection_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalSetterPropertyInjection#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalSetterPropertyInjection#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..93b8007 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalSetterPropertyInjection#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} ); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy)); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest)); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalSetterPropertyInjection#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalSetterPropertyInjection#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalSetterPropertyInjection#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalSetterPropertyInjection_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalSetterPropertyInjection_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..6fcc669 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalSetterPropertyInjection_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} ); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test1"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test1"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalSetterPropertyInjection_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalSetterPropertyInjection_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalSetterPropertyInjection_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalSetterPropertyInjection_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalSetterPropertyInjection_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..b4a7556 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalSetterPropertyInjection_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} ); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test2"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test2"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalSetterPropertyInjection_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalSetterPropertyInjection_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndInternalSetterPropertyInjection_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjection#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjection#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..6ae4eeb --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjection#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty1 = (global::Test.IServiceProperty1)resolver.GetService(typeof(global::Test.IServiceProperty1)), ServiceProperty2 = (global::Test.IServiceProperty2)resolver.GetService(typeof(global::Test.IServiceProperty2)), ServiceProperty3 = (global::Test.IServiceProperty3)resolver.GetService(typeof(global::Test.IServiceProperty3))} ); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy)); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest)); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjection#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjection#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjection#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test1_ExecutionAndPublication#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test1_ExecutionAndPublication#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..0f95a2f --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test1_ExecutionAndPublication#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty1 = (global::Test.IServiceProperty1)resolver.GetService(typeof(global::Test.IServiceProperty1)), ServiceProperty2 = (global::Test.IServiceProperty2)resolver.GetService(typeof(global::Test.IServiceProperty2)), ServiceProperty3 = (global::Test.IServiceProperty3)resolver.GetService(typeof(global::Test.IServiceProperty3))} , System.Threading.LazyThreadSafetyMode.ExecutionAndPublication); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test1"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test1"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test1_ExecutionAndPublication#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test1_ExecutionAndPublication#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test1_ExecutionAndPublication#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test1_None#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test1_None#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..781ad40 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test1_None#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty1 = (global::Test.IServiceProperty1)resolver.GetService(typeof(global::Test.IServiceProperty1)), ServiceProperty2 = (global::Test.IServiceProperty2)resolver.GetService(typeof(global::Test.IServiceProperty2)), ServiceProperty3 = (global::Test.IServiceProperty3)resolver.GetService(typeof(global::Test.IServiceProperty3))} , System.Threading.LazyThreadSafetyMode.None); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test1"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test1"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test1_None#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test1_None#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test1_None#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test1_PublicationOnly#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test1_PublicationOnly#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..711e50d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test1_PublicationOnly#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty1 = (global::Test.IServiceProperty1)resolver.GetService(typeof(global::Test.IServiceProperty1)), ServiceProperty2 = (global::Test.IServiceProperty2)resolver.GetService(typeof(global::Test.IServiceProperty2)), ServiceProperty3 = (global::Test.IServiceProperty3)resolver.GetService(typeof(global::Test.IServiceProperty3))} , System.Threading.LazyThreadSafetyMode.PublicationOnly); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test1"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test1"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test1_PublicationOnly#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test1_PublicationOnly#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test1_PublicationOnly#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test2_ExecutionAndPublication#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test2_ExecutionAndPublication#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..aa81d95 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test2_ExecutionAndPublication#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty1 = (global::Test.IServiceProperty1)resolver.GetService(typeof(global::Test.IServiceProperty1)), ServiceProperty2 = (global::Test.IServiceProperty2)resolver.GetService(typeof(global::Test.IServiceProperty2)), ServiceProperty3 = (global::Test.IServiceProperty3)resolver.GetService(typeof(global::Test.IServiceProperty3))} , System.Threading.LazyThreadSafetyMode.ExecutionAndPublication); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test2"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test2"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test2_ExecutionAndPublication#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test2_ExecutionAndPublication#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test2_ExecutionAndPublication#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test2_None#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test2_None#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1fc8c77 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test2_None#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty1 = (global::Test.IServiceProperty1)resolver.GetService(typeof(global::Test.IServiceProperty1)), ServiceProperty2 = (global::Test.IServiceProperty2)resolver.GetService(typeof(global::Test.IServiceProperty2)), ServiceProperty3 = (global::Test.IServiceProperty3)resolver.GetService(typeof(global::Test.IServiceProperty3))} , System.Threading.LazyThreadSafetyMode.None); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test2"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test2"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test2_None#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test2_None#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test2_None#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test2_PublicationOnly#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test2_PublicationOnly#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..b000718 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test2_PublicationOnly#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty1 = (global::Test.IServiceProperty1)resolver.GetService(typeof(global::Test.IServiceProperty1)), ServiceProperty2 = (global::Test.IServiceProperty2)resolver.GetService(typeof(global::Test.IServiceProperty2)), ServiceProperty3 = (global::Test.IServiceProperty3)resolver.GetService(typeof(global::Test.IServiceProperty3))} , System.Threading.LazyThreadSafetyMode.PublicationOnly); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test2"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test2"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test2_PublicationOnly#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test2_PublicationOnly#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode_Test2_PublicationOnly#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode__ExecutionAndPublication#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode__ExecutionAndPublication#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..798125b --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode__ExecutionAndPublication#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty1 = (global::Test.IServiceProperty1)resolver.GetService(typeof(global::Test.IServiceProperty1)), ServiceProperty2 = (global::Test.IServiceProperty2)resolver.GetService(typeof(global::Test.IServiceProperty2)), ServiceProperty3 = (global::Test.IServiceProperty3)resolver.GetService(typeof(global::Test.IServiceProperty3))} , System.Threading.LazyThreadSafetyMode.ExecutionAndPublication); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy)); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest)); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode__ExecutionAndPublication#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode__ExecutionAndPublication#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode__ExecutionAndPublication#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode__None#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode__None#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..c7d7619 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode__None#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty1 = (global::Test.IServiceProperty1)resolver.GetService(typeof(global::Test.IServiceProperty1)), ServiceProperty2 = (global::Test.IServiceProperty2)resolver.GetService(typeof(global::Test.IServiceProperty2)), ServiceProperty3 = (global::Test.IServiceProperty3)resolver.GetService(typeof(global::Test.IServiceProperty3))} , System.Threading.LazyThreadSafetyMode.None); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy)); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest)); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode__None#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode__None#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode__None#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode__PublicationOnly#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode__PublicationOnly#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..81982c3 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode__PublicationOnly#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty1 = (global::Test.IServiceProperty1)resolver.GetService(typeof(global::Test.IServiceProperty1)), ServiceProperty2 = (global::Test.IServiceProperty2)resolver.GetService(typeof(global::Test.IServiceProperty2)), ServiceProperty3 = (global::Test.IServiceProperty3)resolver.GetService(typeof(global::Test.IServiceProperty3))} , System.Threading.LazyThreadSafetyMode.PublicationOnly); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy)); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest)); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode__PublicationOnly#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode__PublicationOnly#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjectionWithLazyMode__PublicationOnly#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjection_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjection_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..18ee545 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjection_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty1 = (global::Test.IServiceProperty1)resolver.GetService(typeof(global::Test.IServiceProperty1)), ServiceProperty2 = (global::Test.IServiceProperty2)resolver.GetService(typeof(global::Test.IServiceProperty2)), ServiceProperty3 = (global::Test.IServiceProperty3)resolver.GetService(typeof(global::Test.IServiceProperty3))} ); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test1"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test1"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjection_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjection_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjection_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjection_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjection_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..3bb85d1 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjection_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty1 = (global::Test.IServiceProperty1)resolver.GetService(typeof(global::Test.IServiceProperty1)), ServiceProperty2 = (global::Test.IServiceProperty2)resolver.GetService(typeof(global::Test.IServiceProperty2)), ServiceProperty3 = (global::Test.IServiceProperty3)resolver.GetService(typeof(global::Test.IServiceProperty3))} ); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test2"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test2"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjection_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjection_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndMultiplePropertyInjection_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail.verified.txt new file mode 100644 index 0000000..df8ebb4 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI002, + Title: Property must be public/internal settable, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (22,58)-(22,61), + Description: , + HelpLink: , + MessageFormat: {0} property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Message: ServiceProperty property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail_Test1.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail_Test1.verified.txt new file mode 100644 index 0000000..df8ebb4 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail_Test1.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI002, + Title: Property must be public/internal settable, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (22,58)-(22,61), + Description: , + HelpLink: , + MessageFormat: {0} property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Message: ServiceProperty property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail_Test2.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail_Test2.verified.txt new file mode 100644 index 0000000..df8ebb4 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertyInjectionFail_Test2.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI002, + Title: Property must be public/internal settable, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (22,58)-(22,61), + Description: , + HelpLink: , + MessageFormat: {0} property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Message: ServiceProperty property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail.verified.txt new file mode 100644 index 0000000..c8b723c --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI002, + Title: Property must be public/internal settable, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (22,63)-(22,66), + Description: , + HelpLink: , + MessageFormat: {0} property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Message: ServiceProperty property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test1.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test1.verified.txt new file mode 100644 index 0000000..c8b723c --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test1.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI002, + Title: Property must be public/internal settable, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (22,63)-(22,66), + Description: , + HelpLink: , + MessageFormat: {0} property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Message: ServiceProperty property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test2.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test2.verified.txt new file mode 100644 index 0000000..c8b723c --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test2.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI002, + Title: Property must be public/internal settable, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (22,63)-(22,66), + Description: , + HelpLink: , + MessageFormat: {0} property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Message: ServiceProperty property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndPropertyInjection#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndPropertyInjection#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..93b8007 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndPropertyInjection#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} ); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy)); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest)); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndPropertyInjection#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndPropertyInjection#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndPropertyInjection#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndPropertyInjection_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndPropertyInjection_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..6fcc669 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndPropertyInjection_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} ); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test1"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test1"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndPropertyInjection_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndPropertyInjection_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndPropertyInjection_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndPropertyInjection_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndPropertyInjection_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..b4a7556 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndPropertyInjection_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} ); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test2"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test2"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndPropertyInjection_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndPropertyInjection_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionAndPropertyInjection_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionInjection#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionInjection#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..6aa93a1 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionInjection#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2)))); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy)); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest)); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionInjection#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionInjection#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionInjection#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionInjection_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionInjection_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..08a7df7 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionInjection_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2)))); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test1"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test1"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionInjection_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionInjection_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionInjection_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionInjection_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionInjection_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..6642429 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionInjection_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2)))); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test2"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test2"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionInjection_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionInjection_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.ConstructionInjection_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.EmptyConstructor#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.EmptyConstructor#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..e2b95e5 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.EmptyConstructor#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete()); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy)); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest)); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.EmptyConstructor#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.EmptyConstructor#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.EmptyConstructor#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.EmptyConstructor_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.EmptyConstructor_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..d99ae73 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.EmptyConstructor_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete()); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test1"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test1"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.EmptyConstructor_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.EmptyConstructor_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.EmptyConstructor_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.EmptyConstructor_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.EmptyConstructor_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..fec6163 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.EmptyConstructor_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete()); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test2"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test2"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.EmptyConstructor_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.EmptyConstructor_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.EmptyConstructor_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ef05390 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,22 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete1()); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy)); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest)); + } + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete2()); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy)); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest)); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes.verified.txt new file mode 100644 index 0000000..bb70a23 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI006, + Title: Interface has been registered before, + Severity: Warning, + WarningLevel: 1, + Location: Unknown File: (11,12)-(11,76), + Description: , + HelpLink: , + MessageFormat: {0} has been registered in multiple places, + Message: global::Test.ITest has been registered in multiple places, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..29c5807 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,22 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete1()); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test1"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test1"); + } + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete2()); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test1"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test1"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes_Test1.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes_Test1.verified.txt new file mode 100644 index 0000000..853389f --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes_Test1.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI006, + Title: Interface has been registered before, + Severity: Warning, + WarningLevel: 1, + Location: Unknown File: (11,12)-(11,83), + Description: , + HelpLink: , + MessageFormat: {0} has been registered in multiple places, + Message: global::Test.ITest has been registered in multiple places, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..5489493 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,22 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete1()); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test2"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test2"); + } + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete2()); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test2"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test2"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes_Test2.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes_Test2.verified.txt new file mode 100644 index 0000000..853389f --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.InterfaceRegisteredMultipleTimes_Test2.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI006, + Title: Interface has been registered before, + Severity: Warning, + WarningLevel: 1, + Location: Unknown File: (11,12)-(11,83), + Description: , + HelpLink: , + MessageFormat: {0} has been registered in multiple places, + Message: global::Test.ITest has been registered in multiple places, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.LazyParameterRegisteredLazy#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.LazyParameterRegisteredLazy#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..4bc00b5 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.LazyParameterRegisteredLazy#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,19 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::System.Lazy)resolver.GetService(typeof(global::System.Lazy))){ ServiceProperty1 = (global::Test.IServiceProperty1)resolver.GetService(typeof(global::Test.IServiceProperty1)), ServiceProperty2 = (global::Test.IServiceProperty2)resolver.GetService(typeof(global::Test.IServiceProperty2)), ServiceProperty3 = (global::Test.IServiceProperty3)resolver.GetService(typeof(global::Test.IServiceProperty3))} , typeof(global::Test.ITest)); + Splat.Locator.CurrentMutable.Register(() => new global::Test.Service1(), typeof(global::Test.IService1)); + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.Service2()); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy)); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.IService2)); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.LazyParameterRegisteredLazy#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.LazyParameterRegisteredLazy#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.LazyParameterRegisteredLazy#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.LazyParameterRegisteredLazy_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.LazyParameterRegisteredLazy_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..cad4d24 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.LazyParameterRegisteredLazy_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,19 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::System.Lazy)resolver.GetService(typeof(global::System.Lazy))){ ServiceProperty1 = (global::Test.IServiceProperty1)resolver.GetService(typeof(global::Test.IServiceProperty1)), ServiceProperty2 = (global::Test.IServiceProperty2)resolver.GetService(typeof(global::Test.IServiceProperty2)), ServiceProperty3 = (global::Test.IServiceProperty3)resolver.GetService(typeof(global::Test.IServiceProperty3))} , typeof(global::Test.ITest), "Test1"); + Splat.Locator.CurrentMutable.Register(() => new global::Test.Service1(), typeof(global::Test.IService1), "Test1"); + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.Service2()); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test1"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.IService2), "Test1"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.LazyParameterRegisteredLazy_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.LazyParameterRegisteredLazy_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.LazyParameterRegisteredLazy_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.LazyParameterRegisteredLazy_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.LazyParameterRegisteredLazy_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..e2a36c1 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.LazyParameterRegisteredLazy_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,19 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::System.Lazy)resolver.GetService(typeof(global::System.Lazy))){ ServiceProperty1 = (global::Test.IServiceProperty1)resolver.GetService(typeof(global::Test.IServiceProperty1)), ServiceProperty2 = (global::Test.IServiceProperty2)resolver.GetService(typeof(global::Test.IServiceProperty2)), ServiceProperty3 = (global::Test.IServiceProperty3)resolver.GetService(typeof(global::Test.IServiceProperty3))} , typeof(global::Test.ITest), "Test2"); + Splat.Locator.CurrentMutable.Register(() => new global::Test.Service1(), typeof(global::Test.IService1), "Test2"); + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.Service2()); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test2"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.IService2), "Test2"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.LazyParameterRegisteredLazy_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.LazyParameterRegisteredLazy_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.LazyParameterRegisteredLazy_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultiClassesRegistrations#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultiClassesRegistrations#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..379ada2 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultiClassesRegistrations#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete1((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2)))); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy)); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest1)); + } + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete2((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2)))); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy)); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest2)); + } + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete3((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2)))); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy)); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest3)); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultiClassesRegistrations#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultiClassesRegistrations#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultiClassesRegistrations#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultiClassesRegistrations_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultiClassesRegistrations_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..9cbf2d9 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultiClassesRegistrations_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete1((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2)))); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test1"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest1), "Test1"); + } + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete2((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2)))); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test1"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest2), "Test1"); + } + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete3((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2)))); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test1"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest3), "Test1"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultiClassesRegistrations_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultiClassesRegistrations_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..9e71547 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultiClassesRegistrations_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,27 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete1((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2)))); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test2"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest1), "Test2"); + } + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete2((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2)))); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test2"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest2), "Test2"); + } + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete3((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2)))); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test2"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest3), "Test2"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithAttribute#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithAttribute#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ccdba6f --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithAttribute#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)))); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy)); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest)); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithAttribute#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithAttribute#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithAttribute#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithAttribute_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithAttribute_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..a2e9653 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithAttribute_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)))); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test1"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test1"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithAttribute_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithAttribute_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithAttribute_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithAttribute_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithAttribute_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..9efe7a8 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithAttribute_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,17 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + { + global::System.Lazy lazy = new global::System.Lazy(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)))); + Splat.Locator.CurrentMutable.Register(() => lazy, typeof(global::System.Lazy), "Test2"); + Splat.Locator.CurrentMutable.Register(() => lazy.Value, typeof(global::Test.ITest), "Test2"); + } + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithAttribute_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithAttribute_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithAttribute_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail.verified.txt new file mode 100644 index 0000000..b025b20 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI003, + Title: Multiple constructors have DependencyInjectionConstructorAttribute, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (23,15)-(23,27), + Description: , + HelpLink: , + MessageFormat: {0} has multiple constructors marked with the DependencyInjectionConstructorAttribute attribute change so only one is marked, + Message: global::Test.TestConcrete has multiple constructors marked with the DependencyInjectionConstructorAttribute attribute change so only one is marked, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail_Test1.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail_Test1.verified.txt new file mode 100644 index 0000000..b025b20 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail_Test1.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI003, + Title: Multiple constructors have DependencyInjectionConstructorAttribute, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (23,15)-(23,27), + Description: , + HelpLink: , + MessageFormat: {0} has multiple constructors marked with the DependencyInjectionConstructorAttribute attribute change so only one is marked, + Message: global::Test.TestConcrete has multiple constructors marked with the DependencyInjectionConstructorAttribute attribute change so only one is marked, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail_Test2.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail_Test2.verified.txt new file mode 100644 index 0000000..b025b20 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithMultipleAttributesFail_Test2.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI003, + Title: Multiple constructors have DependencyInjectionConstructorAttribute, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (23,15)-(23,27), + Description: , + HelpLink: , + MessageFormat: {0} has multiple constructors marked with the DependencyInjectionConstructorAttribute attribute change so only one is marked, + Message: global::Test.TestConcrete has multiple constructors marked with the DependencyInjectionConstructorAttribute attribute change so only one is marked, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail.verified.txt new file mode 100644 index 0000000..7b82e17 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI001, + Title: Can't find valid constructor, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (10,12)-(10,75), + Description: , + HelpLink: , + MessageFormat: {0} has more than one constructor and one hasn't been marked with DependencyInjectionConstructorAttribute, + Message: global::Test.TestConcrete has more than one constructor and one hasn't been marked with DependencyInjectionConstructorAttribute, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail_Test1.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail_Test1.verified.txt new file mode 100644 index 0000000..869bc34 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail_Test1.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI001, + Title: Can't find valid constructor, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (10,12)-(10,82), + Description: , + HelpLink: , + MessageFormat: {0} has more than one constructor and one hasn't been marked with DependencyInjectionConstructorAttribute, + Message: global::Test.TestConcrete has more than one constructor and one hasn't been marked with DependencyInjectionConstructorAttribute, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail_Test2.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail_Test2.verified.txt new file mode 100644 index 0000000..869bc34 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterLazySingletonTests.MultipleConstructorWithoutAttributeFail_Test2.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI001, + Title: Can't find valid constructor, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (10,12)-(10,82), + Description: , + HelpLink: , + MessageFormat: {0} has more than one constructor and one hasn't been marked with DependencyInjectionConstructorAttribute, + Message: global::Test.TestConcrete has more than one constructor and one hasn't been marked with DependencyInjectionConstructorAttribute, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail.verified.txt new file mode 100644 index 0000000..796078d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail.verified.txt @@ -0,0 +1,28 @@ +{ + Diagnostics: [ + { + Id: SPLATDI005, + Title: Constructors must not have a circular dependency, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (26,36)-(26,44), + Description: , + HelpLink: , + MessageFormat: Constructor parameters must not have a circular dependency to another registered resource, + Message: Constructor parameters must not have a circular dependency to another registered resource, + Category: Compiler + }, + { + Id: SPLATDI005, + Title: Constructors must not have a circular dependency, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (18,36)-(18,44), + Description: , + HelpLink: , + MessageFormat: Constructor parameters must not have a circular dependency to another registered resource, + Message: Constructor parameters must not have a circular dependency to another registered resource, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail_Test1.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail_Test1.verified.txt new file mode 100644 index 0000000..796078d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail_Test1.verified.txt @@ -0,0 +1,28 @@ +{ + Diagnostics: [ + { + Id: SPLATDI005, + Title: Constructors must not have a circular dependency, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (26,36)-(26,44), + Description: , + HelpLink: , + MessageFormat: Constructor parameters must not have a circular dependency to another registered resource, + Message: Constructor parameters must not have a circular dependency to another registered resource, + Category: Compiler + }, + { + Id: SPLATDI005, + Title: Constructors must not have a circular dependency, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (18,36)-(18,44), + Description: , + HelpLink: , + MessageFormat: Constructor parameters must not have a circular dependency to another registered resource, + Message: Constructor parameters must not have a circular dependency to another registered resource, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail_Test2.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail_Test2.verified.txt new file mode 100644 index 0000000..796078d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.CircularDependencyFail_Test2.verified.txt @@ -0,0 +1,28 @@ +{ + Diagnostics: [ + { + Id: SPLATDI005, + Title: Constructors must not have a circular dependency, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (26,36)-(26,44), + Description: , + HelpLink: , + MessageFormat: Constructor parameters must not have a circular dependency to another registered resource, + Message: Constructor parameters must not have a circular dependency to another registered resource, + Category: Compiler + }, + { + Id: SPLATDI005, + Title: Constructors must not have a circular dependency, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (18,36)-(18,44), + Description: , + HelpLink: , + MessageFormat: Constructor parameters must not have a circular dependency to another registered resource, + Message: Constructor parameters must not have a circular dependency to another registered resource, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjection#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjection#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..deff285 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjection#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} , typeof(global::Test.ITest)); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjection#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjection#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjection#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjectionTypeArgument#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjectionTypeArgument#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..2b4b1da --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjectionTypeArgument#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} , typeof(global::Test.TestConcrete)); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjectionTypeArgument#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjectionTypeArgument#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjectionTypeArgument#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..d9ced1b --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} , typeof(global::Test.TestConcrete), "Test1"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..977c98c --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} , typeof(global::Test.TestConcrete), "Test2"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjectionTypeArgument_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjection_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjection_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..eddb371 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjection_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} , typeof(global::Test.ITest), "Test1"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjection_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjection_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjection_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjection_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjection_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..a050923 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjection_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} , typeof(global::Test.ITest), "Test2"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjection_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjection_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalPropertyInjection_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalSetterPropertyInjection#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalSetterPropertyInjection#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..deff285 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalSetterPropertyInjection#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} , typeof(global::Test.ITest)); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalSetterPropertyInjection#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalSetterPropertyInjection#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalSetterPropertyInjection#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalSetterPropertyInjection_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalSetterPropertyInjection_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..eddb371 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalSetterPropertyInjection_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} , typeof(global::Test.ITest), "Test1"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalSetterPropertyInjection_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalSetterPropertyInjection_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalSetterPropertyInjection_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalSetterPropertyInjection_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalSetterPropertyInjection_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..a050923 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalSetterPropertyInjection_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} , typeof(global::Test.ITest), "Test2"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalSetterPropertyInjection_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalSetterPropertyInjection_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndInternalSetterPropertyInjection_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndMultiplePropertyInjection#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndMultiplePropertyInjection#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..0c13d74 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndMultiplePropertyInjection#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty1 = (global::Test.IServiceProperty1)resolver.GetService(typeof(global::Test.IServiceProperty1)), ServiceProperty2 = (global::Test.IServiceProperty2)resolver.GetService(typeof(global::Test.IServiceProperty2)), ServiceProperty3 = (global::Test.IServiceProperty3)resolver.GetService(typeof(global::Test.IServiceProperty3))} , typeof(global::Test.ITest)); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndMultiplePropertyInjection#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndMultiplePropertyInjection#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndMultiplePropertyInjection#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndMultiplePropertyInjection_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndMultiplePropertyInjection_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..c43980b --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndMultiplePropertyInjection_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty1 = (global::Test.IServiceProperty1)resolver.GetService(typeof(global::Test.IServiceProperty1)), ServiceProperty2 = (global::Test.IServiceProperty2)resolver.GetService(typeof(global::Test.IServiceProperty2)), ServiceProperty3 = (global::Test.IServiceProperty3)resolver.GetService(typeof(global::Test.IServiceProperty3))} , typeof(global::Test.ITest), "Test1"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndMultiplePropertyInjection_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndMultiplePropertyInjection_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndMultiplePropertyInjection_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndMultiplePropertyInjection_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndMultiplePropertyInjection_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..5427587 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndMultiplePropertyInjection_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty1 = (global::Test.IServiceProperty1)resolver.GetService(typeof(global::Test.IServiceProperty1)), ServiceProperty2 = (global::Test.IServiceProperty2)resolver.GetService(typeof(global::Test.IServiceProperty2)), ServiceProperty3 = (global::Test.IServiceProperty3)resolver.GetService(typeof(global::Test.IServiceProperty3))} , typeof(global::Test.ITest), "Test2"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndMultiplePropertyInjection_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndMultiplePropertyInjection_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndMultiplePropertyInjection_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail.verified.txt new file mode 100644 index 0000000..df8ebb4 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI002, + Title: Property must be public/internal settable, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (22,58)-(22,61), + Description: , + HelpLink: , + MessageFormat: {0} property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Message: ServiceProperty property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail_Test1.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail_Test1.verified.txt new file mode 100644 index 0000000..df8ebb4 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail_Test1.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI002, + Title: Property must be public/internal settable, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (22,58)-(22,61), + Description: , + HelpLink: , + MessageFormat: {0} property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Message: ServiceProperty property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail_Test2.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail_Test2.verified.txt new file mode 100644 index 0000000..df8ebb4 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertyInjectionFail_Test2.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI002, + Title: Property must be public/internal settable, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (22,58)-(22,61), + Description: , + HelpLink: , + MessageFormat: {0} property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Message: ServiceProperty property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail.verified.txt new file mode 100644 index 0000000..c8b723c --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI002, + Title: Property must be public/internal settable, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (22,63)-(22,66), + Description: , + HelpLink: , + MessageFormat: {0} property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Message: ServiceProperty property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test1.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test1.verified.txt new file mode 100644 index 0000000..c8b723c --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test1.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI002, + Title: Property must be public/internal settable, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (22,63)-(22,66), + Description: , + HelpLink: , + MessageFormat: {0} property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Message: ServiceProperty property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test2.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test2.verified.txt new file mode 100644 index 0000000..c8b723c --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndNonPublicPropertySetterInjectionFail_Test2.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI002, + Title: Property must be public/internal settable, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (22,63)-(22,66), + Description: , + HelpLink: , + MessageFormat: {0} property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Message: ServiceProperty property marked with DependencyInjectionPropertyAttribute must have a public or internal setter, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndPropertyInjection#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndPropertyInjection#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..deff285 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndPropertyInjection#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} , typeof(global::Test.ITest)); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndPropertyInjection#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndPropertyInjection#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndPropertyInjection#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndPropertyInjection_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndPropertyInjection_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..eddb371 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndPropertyInjection_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} , typeof(global::Test.ITest), "Test1"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndPropertyInjection_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndPropertyInjection_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndPropertyInjection_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndPropertyInjection_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndPropertyInjection_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..a050923 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndPropertyInjection_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))){ ServiceProperty = (global::Test.IServiceProperty)resolver.GetService(typeof(global::Test.IServiceProperty))} , typeof(global::Test.ITest), "Test2"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndPropertyInjection_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndPropertyInjection_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionAndPropertyInjection_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionInjection#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionInjection#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..16dc734 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionInjection#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))), typeof(global::Test.ITest)); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionInjection#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionInjection#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionInjection#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionInjection_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionInjection_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..b099da2 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionInjection_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))), typeof(global::Test.ITest), "Test1"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionInjection_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionInjection_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionInjection_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionInjection_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionInjection_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..4ab1a27 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionInjection_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))), typeof(global::Test.ITest), "Test2"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionInjection_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionInjection_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.ConstructionInjection_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.EmptyConstructor#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.EmptyConstructor#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..730cd55 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.EmptyConstructor#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete(), typeof(global::Test.ITest)); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.EmptyConstructor#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.EmptyConstructor#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.EmptyConstructor#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.EmptyConstructor_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.EmptyConstructor_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..51efa3a --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.EmptyConstructor_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete(), typeof(global::Test.ITest), "Test1"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.EmptyConstructor_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.EmptyConstructor_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.EmptyConstructor_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.EmptyConstructor_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.EmptyConstructor_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..b2014c0 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.EmptyConstructor_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete(), typeof(global::Test.ITest), "Test2"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.EmptyConstructor_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.EmptyConstructor_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.EmptyConstructor_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..d95b9d1 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,14 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete1(), typeof(global::Test.ITest)); + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete2(), typeof(global::Test.ITest)); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes.verified.txt new file mode 100644 index 0000000..44ec7df --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI006, + Title: Interface has been registered before, + Severity: Warning, + WarningLevel: 1, + Location: Unknown File: (11,12)-(11,63), + Description: , + HelpLink: , + MessageFormat: {0} has been registered in multiple places, + Message: global::Test.ITest has been registered in multiple places, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..fc39e66 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,14 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete1(), typeof(global::Test.ITest), "Test1"); + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete2(), typeof(global::Test.ITest), "Test1"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes_Test1.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes_Test1.verified.txt new file mode 100644 index 0000000..1827559 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes_Test1.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI006, + Title: Interface has been registered before, + Severity: Warning, + WarningLevel: 1, + Location: Unknown File: (11,12)-(11,70), + Description: , + HelpLink: , + MessageFormat: {0} has been registered in multiple places, + Message: global::Test.ITest has been registered in multiple places, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..099141c --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,14 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete1(), typeof(global::Test.ITest), "Test2"); + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete2(), typeof(global::Test.ITest), "Test2"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes_Test2.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes_Test2.verified.txt new file mode 100644 index 0000000..1827559 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.InterfaceRegisteredMultipleTimes_Test2.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI006, + Title: Interface has been registered before, + Severity: Warning, + WarningLevel: 1, + Location: Unknown File: (11,12)-(11,70), + Description: , + HelpLink: , + MessageFormat: {0} has been registered in multiple places, + Message: global::Test.ITest has been registered in multiple places, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail.verified.txt new file mode 100644 index 0000000..01695d7 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI007, + Title: Constructor has a lazy parameter, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (19,43)-(19,51), + Description: , + HelpLink: , + MessageFormat: {0} constructor has a lazy parameter {1} which is not registered with RegisterLazySingleton, + Message: global::Test.TestConcrete constructor has a lazy parameter service1 which is not registered with RegisterLazySingleton, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail_Test1.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail_Test1.verified.txt new file mode 100644 index 0000000..01695d7 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail_Test1.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI007, + Title: Constructor has a lazy parameter, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (19,43)-(19,51), + Description: , + HelpLink: , + MessageFormat: {0} constructor has a lazy parameter {1} which is not registered with RegisterLazySingleton, + Message: global::Test.TestConcrete constructor has a lazy parameter service1 which is not registered with RegisterLazySingleton, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail_Test2.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail_Test2.verified.txt new file mode 100644 index 0000000..01695d7 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterConstantNotRegisteredLazyFail_Test2.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI007, + Title: Constructor has a lazy parameter, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (19,43)-(19,51), + Description: , + HelpLink: , + MessageFormat: {0} constructor has a lazy parameter {1} which is not registered with RegisterLazySingleton, + Message: global::Test.TestConcrete constructor has a lazy parameter service1 which is not registered with RegisterLazySingleton, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..8e7b4b3 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,14 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.Service1(), typeof(global::Test.IService1)); + Splat.Locator.CurrentMutable.Register(() => new global::Test.Service2(), typeof(global::Test.IService2)); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail.verified.txt new file mode 100644 index 0000000..344c0e3 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI007, + Title: Constructor has a lazy parameter, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (20,64)-(20,71), + Description: , + HelpLink: , + MessageFormat: {0} constructor has a lazy parameter {1} which is not registered with RegisterLazySingleton, + Message: global::Test.TestConcrete constructor has a lazy parameter service which is not registered with RegisterLazySingleton, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..66c6d84 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,14 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.Service1(), typeof(global::Test.IService1), "Test1"); + Splat.Locator.CurrentMutable.Register(() => new global::Test.Service2(), typeof(global::Test.IService2), "Test1"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail_Test1.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail_Test1.verified.txt new file mode 100644 index 0000000..344c0e3 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail_Test1.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI007, + Title: Constructor has a lazy parameter, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (20,64)-(20,71), + Description: , + HelpLink: , + MessageFormat: {0} constructor has a lazy parameter {1} which is not registered with RegisterLazySingleton, + Message: global::Test.TestConcrete constructor has a lazy parameter service which is not registered with RegisterLazySingleton, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..275a175 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,14 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.Service1(), typeof(global::Test.IService1), "Test2"); + Splat.Locator.CurrentMutable.Register(() => new global::Test.Service2(), typeof(global::Test.IService2), "Test2"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail_Test2.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail_Test2.verified.txt new file mode 100644 index 0000000..344c0e3 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.LazyParameterNotRegisteredLazyFail_Test2.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI007, + Title: Constructor has a lazy parameter, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (20,64)-(20,71), + Description: , + HelpLink: , + MessageFormat: {0} constructor has a lazy parameter {1} which is not registered with RegisterLazySingleton, + Message: global::Test.TestConcrete constructor has a lazy parameter service which is not registered with RegisterLazySingleton, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultiClassesRegistrations#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultiClassesRegistrations#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..1b87d73 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultiClassesRegistrations#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,15 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete1((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))), typeof(global::Test.ITest1)); + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete2((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))), typeof(global::Test.ITest2)); + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete3((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))), typeof(global::Test.ITest3)); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultiClassesRegistrations#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultiClassesRegistrations#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultiClassesRegistrations#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultiClassesRegistrations_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultiClassesRegistrations_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..23d8f44 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultiClassesRegistrations_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,15 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete1((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))), typeof(global::Test.ITest1), "Test1"); + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete2((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))), typeof(global::Test.ITest2), "Test1"); + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete3((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))), typeof(global::Test.ITest3), "Test1"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultiClassesRegistrations_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultiClassesRegistrations_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultiClassesRegistrations_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..b6c9881 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultiClassesRegistrations_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,15 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete1((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))), typeof(global::Test.ITest1), "Test2"); + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete2((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))), typeof(global::Test.ITest2), "Test2"); + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete3((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1)), (global::Test.IService2)resolver.GetService(typeof(global::Test.IService2))), typeof(global::Test.ITest3), "Test2"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultiClassesRegistrations_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithAttribute#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithAttribute#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..df09a98 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithAttribute#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1))), typeof(global::Test.ITest)); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithAttribute#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithAttribute#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithAttribute#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithAttribute_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithAttribute_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..86e0016 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithAttribute_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1))), typeof(global::Test.ITest), "Test1"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithAttribute_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithAttribute_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithAttribute_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithAttribute_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithAttribute_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..7593fa3 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithAttribute_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,13 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + Splat.Locator.CurrentMutable.Register(() => new global::Test.TestConcrete((global::Test.IService1)resolver.GetService(typeof(global::Test.IService1))), typeof(global::Test.ITest), "Test2"); + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithAttribute_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithAttribute_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithAttribute_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail.verified.txt new file mode 100644 index 0000000..b025b20 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI003, + Title: Multiple constructors have DependencyInjectionConstructorAttribute, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (23,15)-(23,27), + Description: , + HelpLink: , + MessageFormat: {0} has multiple constructors marked with the DependencyInjectionConstructorAttribute attribute change so only one is marked, + Message: global::Test.TestConcrete has multiple constructors marked with the DependencyInjectionConstructorAttribute attribute change so only one is marked, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail_Test1.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail_Test1.verified.txt new file mode 100644 index 0000000..b025b20 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail_Test1.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI003, + Title: Multiple constructors have DependencyInjectionConstructorAttribute, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (23,15)-(23,27), + Description: , + HelpLink: , + MessageFormat: {0} has multiple constructors marked with the DependencyInjectionConstructorAttribute attribute change so only one is marked, + Message: global::Test.TestConcrete has multiple constructors marked with the DependencyInjectionConstructorAttribute attribute change so only one is marked, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail_Test2.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail_Test2.verified.txt new file mode 100644 index 0000000..b025b20 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithMultipleAttributesFail_Test2.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI003, + Title: Multiple constructors have DependencyInjectionConstructorAttribute, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (23,15)-(23,27), + Description: , + HelpLink: , + MessageFormat: {0} has multiple constructors marked with the DependencyInjectionConstructorAttribute attribute change so only one is marked, + Message: global::Test.TestConcrete has multiple constructors marked with the DependencyInjectionConstructorAttribute attribute change so only one is marked, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail.verified.txt new file mode 100644 index 0000000..3470d87 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI001, + Title: Can't find valid constructor, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (10,12)-(10,62), + Description: , + HelpLink: , + MessageFormat: {0} has more than one constructor and one hasn't been marked with DependencyInjectionConstructorAttribute, + Message: global::Test.TestConcrete has more than one constructor and one hasn't been marked with DependencyInjectionConstructorAttribute, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail_Test1#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail_Test1#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail_Test1#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail_Test1#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail_Test1#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail_Test1#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail_Test1.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail_Test1.verified.txt new file mode 100644 index 0000000..3a6ced9 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail_Test1.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI001, + Title: Can't find valid constructor, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (10,12)-(10,69), + Description: , + HelpLink: , + MessageFormat: {0} has more than one constructor and one hasn't been marked with DependencyInjectionConstructorAttribute, + Message: global::Test.TestConcrete has more than one constructor and one hasn't been marked with DependencyInjectionConstructorAttribute, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail_Test2#Splat.DI.Reg.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail_Test2#Splat.DI.Reg.g.verified.cs new file mode 100644 index 0000000..ffa25cc --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail_Test2#Splat.DI.Reg.g.verified.cs @@ -0,0 +1,12 @@ +//HintName: Splat.DI.Reg.g.cs + +// +namespace Splat +{ + internal static partial class SplatRegistrations + { + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver) + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail_Test2#Splat.DI.g.verified.cs b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail_Test2#Splat.DI.g.verified.cs new file mode 100644 index 0000000..1ca6b3d --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail_Test2#Splat.DI.g.verified.cs @@ -0,0 +1,149 @@ +//HintName: Splat.DI.g.cs + +// +namespace Splat +{ + /// + /// Extension methods for the Splat DI source generator. + /// + internal static partial class SplatRegistrations + { + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + /// + /// Registers a class with its concrete class. + /// + /// The threading mode. + public static void RegisterLazySingleton(System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + /// The threading mode. + public static void RegisterLazySingleton(string contract, System.Threading.LazyThreadSafetyMode mode) + { + } + + /// + /// Registers a class with its concrete class. + /// + public static void Register() + { + } + + + /// + /// Registers a class with its concrete class. + /// + /// Optional contract. + public static void Register(string contract) + { + } + + /// + /// Registers a lazy class with its concrete class. + /// + public static void RegisterLazySingleton() + { + } + + + /// + /// Registers a lazy class with its concrete class. + /// + /// Optional contract. + public static void RegisterLazySingleton(string contract) + { + } + + /// + /// Proxy for the Splat SetService. + /// + public static void RegisterConstant(T instance) => Splat.Locator.CurrentMutable.RegisterConstant(instance); + + /// + /// Proxy for the Splat SetService. + /// + /// Optional contract. + public static void RegisterConstant(T instance, string contract) => Splat.Locator.CurrentMutable.RegisterConstant(instance, contract); + + /// + /// Registers the registrations. + /// + public static void SetupIOC() + { + SetupIOCInternal(Splat.Locator.GetLocator()); + } + + /// + /// Registers the registrations. + /// + /// The resolver to register with. + public static void SetupIOC(Splat.IDependencyResolver resolver) + { + SetupIOCInternal(resolver); + } + + + static partial void SetupIOCInternal(Splat.IDependencyResolver resolver); + } + + /// + /// Makes the property get added by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Property)] + internal class DependencyInjectionPropertyAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionPropertyAttribute() + { + } + } + + /// + /// Makes this the constructor used by the DI engine. + /// + [System.AttributeUsage(System.AttributeTargets.Constructor)] + internal class DependencyInjectionConstructorAttribute : System.Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DependencyInjectionConstructorAttribute() + { + } + } +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail_Test2.verified.txt b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail_Test2.verified.txt new file mode 100644 index 0000000..3a6ced9 --- /dev/null +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/RegisterTests.MultipleConstructorWithoutAttributeFail_Test2.verified.txt @@ -0,0 +1,16 @@ +{ + Diagnostics: [ + { + Id: SPLATDI001, + Title: Can't find valid constructor, + Severity: Error, + WarningLevel: 0, + Location: Unknown File: (10,12)-(10,69), + Description: , + HelpLink: , + MessageFormat: {0} has more than one constructor and one hasn't been marked with DependencyInjectionConstructorAttribute, + Message: global::Test.TestConcrete has more than one constructor and one hasn't been marked with DependencyInjectionConstructorAttribute, + Category: Compiler + } + ] +} \ No newline at end of file diff --git a/src/Splat.DependencyInjection.SourceGenerator.Tests/Splat.DependencyInjection.SourceGenerator.Tests.csproj b/src/Splat.DependencyInjection.SourceGenerator.Tests/Splat.DependencyInjection.SourceGenerator.Tests.csproj index a4e34df..f1c8730 100644 --- a/src/Splat.DependencyInjection.SourceGenerator.Tests/Splat.DependencyInjection.SourceGenerator.Tests.csproj +++ b/src/Splat.DependencyInjection.SourceGenerator.Tests/Splat.DependencyInjection.SourceGenerator.Tests.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -7,15 +7,15 @@ - - - - + + + + - - - + + + diff --git a/src/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.csproj b/src/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.csproj index 165cd11..4eb9cdb 100644 --- a/src/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.csproj +++ b/src/Splat.DependencyInjection.SourceGenerator/Splat.DependencyInjection.SourceGenerator.csproj @@ -9,14 +9,15 @@ $(TargetsForTfmSpecificContentInPackage);PackBuildOutputs $(NoWarn);AD0001 full + true - - + + - + diff --git a/version.json b/version.json index c585f2b..a0ef1aa 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { - "version": "1.1", + "version": "1.2", "publicReleaseRefSpec": [ "^refs/heads/master$", "^refs/heads/main$"