diff --git a/src/RepoM.Api/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionDeserializerComposition.cs b/src/RepoM.Api/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionDeserializerComposition.cs index 052956fd..bb40f2a9 100644 --- a/src/RepoM.Api/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionDeserializerComposition.cs +++ b/src/RepoM.Api/IO/ModuleBasedRepositoryActionProvider/ActionDeserializers/ActionDeserializerComposition.cs @@ -6,21 +6,24 @@ namespace RepoM.Api.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Data; +using RepoM.Core.Plugin.RepositoryOrdering.Configuration; public class ActionDeserializerComposition { private readonly IActionDeserializer[] _deserializers; + private readonly IKeyTypeRegistration[] _typeRegistrations; - public ActionDeserializerComposition(IEnumerable deserializers) + public ActionDeserializerComposition(IEnumerable deserializers, IEnumerable> typeRegistrations) { - _deserializers = deserializers?.Where(x => x != null).ToArray() ?? throw new ArgumentNullException(nameof(deserializers)); + _deserializers = deserializers?.ToArray() ?? throw new ArgumentNullException(nameof(deserializers)); + _typeRegistrations = typeRegistrations.ToArray(); } public RepositoryAction? DeserializeSingleAction(string type, JToken jToken, JsonSerializer jsonSerializer) { - IActionDeserializer? deserializer = _deserializers.FirstOrDefault(x => x.CanDeserialize(type)); - - RepositoryAction? result = deserializer?.Deserialize(jToken, this, jsonSerializer); + RepositoryAction? result = DeserializeWithCustomDeserializers(type, jToken, jsonSerializer) + ?? + DeserializeWithDefaultDeserializers(type, jToken, jsonSerializer); if (result == null) { @@ -36,4 +39,22 @@ public ActionDeserializerComposition(IEnumerable deserializ return result; } + + private RepositoryAction? DeserializeWithCustomDeserializers(string type, JToken jToken, JsonSerializer jsonSerializer) + { + IActionDeserializer? deserializer = _deserializers.FirstOrDefault(x => x.CanDeserialize(type)); + return deserializer?.Deserialize(jToken, this, jsonSerializer); + } + + private RepositoryAction? DeserializeWithDefaultDeserializers(string type, JToken jToken, JsonSerializer jsonSerializer) + { + IKeyTypeRegistration? registration = _typeRegistrations.FirstOrDefault(x => x.Tag.Equals(type, StringComparison.CurrentCultureIgnoreCase)); + + if (registration != null) + { + return jToken.ToObject(registration.ConfigurationType, jsonSerializer) as RepositoryAction; + } + + return null; + } } \ No newline at end of file diff --git a/src/RepoM.Api/IO/ModuleBasedRepositoryActionProvider/Data/RepositoryAction.cs b/src/RepoM.Api/IO/ModuleBasedRepositoryActionProvider/Data/RepositoryAction.cs index 52e86168..5e797765 100644 --- a/src/RepoM.Api/IO/ModuleBasedRepositoryActionProvider/Data/RepositoryAction.cs +++ b/src/RepoM.Api/IO/ModuleBasedRepositoryActionProvider/Data/RepositoryAction.cs @@ -135,24 +135,21 @@ public static class ContainerExtensions { public static void RegisterDefaultRepositoryActionDeserializerForType(this Container container) where T : RepositoryAction { - container.Collection.AppendInstance(new DefaultActionDeserializer()); - // container.Collection.AppendInstance>(new RepositoryActionKeyTypeRegistration()); + container.Collection.AppendInstance>(new RepositoryActionKeyTypeRegistration()); } public static void RegisterDefaultRepositoryActionDeserializerForType(this Container container, Type type) { - container.Collection.AppendInstance(new DefaultActionDeserializer(type)); - // container.Collection.AppendInstance>(new RepositoryActionKeyTypeRegistration()); + container.Collection.AppendInstance>(new RepositoryActionKeyTypeRegistration(type)); } } - -public class DefaultActionDeserializer : IActionDeserializer +public class DefaultActionDeserializer : IActionDeserializer where T : RepositoryAction { - public DefaultActionDeserializer(Type t) + public DefaultActionDeserializer() { - ConfigurationType = t; - Tag = t.GetCustomAttribute()?.Type ?? throw new InvalidOperationException($"RepositoryActionAttribute not found on {t.FullName}"); + ConfigurationType = typeof(T); + Tag = typeof(T).GetCustomAttribute()?.Type ?? throw new InvalidOperationException($"RepositoryActionAttribute not found on {typeof(T).FullName}"); } private Type ConfigurationType { get; } @@ -171,37 +168,25 @@ public bool CanDeserialize(string type) } } - -public class DefaultActionDeserializer : IActionDeserializer where T : RepositoryAction +public class RepositoryActionKeyTypeRegistration : IKeyTypeRegistration where T : RepositoryAction { - public DefaultActionDeserializer() + public RepositoryActionKeyTypeRegistration() { ConfigurationType = typeof(T); Tag = typeof(T).GetCustomAttribute()?.Type ?? throw new InvalidOperationException($"RepositoryActionAttribute not found on {typeof(T).FullName}"); } - private Type ConfigurationType { get; } - - private string Tag { get; } - - - public bool CanDeserialize(string type) - { - return Tag.Equals(type, StringComparison.CurrentCultureIgnoreCase); - } + public Type ConfigurationType { get; } - public RepositoryAction? Deserialize(JToken jToken, ActionDeserializerComposition actionDeserializer, JsonSerializer jsonSerializer) - { - return jToken.ToObject(ConfigurationType, jsonSerializer) as RepositoryAction; - } + public string Tag { get; } } -public class RepositoryActionKeyTypeRegistration : IKeyTypeRegistration where T : RepositoryAction +file class RepositoryActionKeyTypeRegistration : IKeyTypeRegistration { - public RepositoryActionKeyTypeRegistration() + public RepositoryActionKeyTypeRegistration(Type t) { - ConfigurationType = typeof(T); - Tag = typeof(T).GetCustomAttribute()?.Type ?? throw new InvalidOperationException($"RepositoryActionAttribute not found on {typeof(T).FullName}"); + ConfigurationType = t; + Tag = t.GetCustomAttribute()?.Type ?? throw new InvalidOperationException($"RepositoryActionAttribute not found on {t.FullName}"); } public Type ConfigurationType { get; } diff --git a/src/RepoM.App/Bootstrapper.cs b/src/RepoM.App/Bootstrapper.cs index 7d76a2e8..a0606dec 100644 --- a/src/RepoM.App/Bootstrapper.cs +++ b/src/RepoM.App/Bootstrapper.cs @@ -47,6 +47,7 @@ namespace RepoM.App; using RepoM.Api; using System.Collections.Generic; using System.Linq; +using Microsoft.VisualStudio.Services.Common; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Data; internal static class Bootstrapper @@ -133,37 +134,20 @@ public static void RegisterServices(IFileSystem fileSystem) }); Container.Register(Lifestyle.Singleton); - // - // Container.Collection.Register( - // new[] { typeof(IActionDeserializer).Assembly, }, - // Lifestyle.Singleton); - var types1 = GetExportedTypesFrom(typeof(IActionDeserializer).Assembly) - .Where(t => typeof(IActionDeserializer).GetTypeInfo().IsAssignableFrom(t.GetTypeInfo())) - .Where(t => t.GetTypeInfo() is { IsAbstract: false, IsGenericTypeDefinition: false, }) - // .Where(t => t != typeof(Api.IO.ModuleBasedRepositoryActionProvider.Data.RepositoryAction)) - .Where(t => t != typeof(DefaultActionDeserializer)) - .Where(t => t != typeof(DefaultActionDeserializer<>)) - .ToArray(); - - Container.Collection.Register(types1, Lifestyle.Singleton); - - // foreach (var type in types1) - // { - // Container.RegisterDefaultRepositoryActionDeserializerForType(type); - // } - - - var types = GetExportedTypesFrom(typeof(IActionDeserializer).Assembly) - .Where(t => typeof(Api.IO.ModuleBasedRepositoryActionProvider.Data.RepositoryAction).GetTypeInfo().IsAssignableFrom(t.GetTypeInfo())) - .Where(t => t.GetTypeInfo() is { IsAbstract: false, IsGenericTypeDefinition: false, }) - .Where(t => t != typeof(Api.IO.ModuleBasedRepositoryActionProvider.Data.RepositoryAction)) - // .Where(t => t != typeof(DefaultActionDeserializer<>)) - .ToArray(); - foreach (var type in types) - { - Container.RegisterDefaultRepositoryActionDeserializerForType(type); - } - + + // Register custom Repository Action deserializers + var actionDeserializerTypes = GetExportedTypesFrom(typeof(IActionDeserializer).Assembly) + .Where(t => typeof(IActionDeserializer).GetTypeInfo().IsAssignableFrom(t.GetTypeInfo())) + .Where(t => t.GetTypeInfo() is { IsAbstract: false, IsGenericTypeDefinition: false, }) + .Where(t => t != typeof(DefaultActionDeserializer<>)); + Container.Collection.Register(actionDeserializerTypes, Lifestyle.Singleton); + + // Register all repository action types + GetExportedTypesFrom(typeof(IActionDeserializer).Assembly) + .Where(t => typeof(Api.IO.ModuleBasedRepositoryActionProvider.Data.RepositoryAction).GetTypeInfo().IsAssignableFrom(t.GetTypeInfo())) + .Where(t => t.GetTypeInfo() is { IsAbstract: false, IsGenericTypeDefinition: false, }) + .Where(t => t != typeof(Api.IO.ModuleBasedRepositoryActionProvider.Data.RepositoryAction)) + .ForEach(t => Container.RegisterDefaultRepositoryActionDeserializerForType(t)); static IEnumerable GetExportedTypesFrom(Assembly assembly) { diff --git a/src/RepoM.Core.Plugin/RepositoryOrdering/Configuration/IConfigurationRegistration.cs b/src/RepoM.Core.Plugin/RepositoryOrdering/Configuration/IConfigurationRegistration.cs index f98efa2e..0db34ca1 100644 --- a/src/RepoM.Core.Plugin/RepositoryOrdering/Configuration/IConfigurationRegistration.cs +++ b/src/RepoM.Core.Plugin/RepositoryOrdering/Configuration/IConfigurationRegistration.cs @@ -5,13 +5,16 @@ namespace RepoM.Core.Plugin.RepositoryOrdering.Configuration; /// /// Configuration registration per name /// -public interface IConfigurationRegistration +public interface IConfigurationRegistration : IKeyTypeRegistration { - public Type ConfigurationType { get; } - - public string Tag { get; } } -public interface IKeyTypeRegistration : IConfigurationRegistration +/// +/// Configuration registration per name +/// +public interface IKeyTypeRegistration { + public Type ConfigurationType { get; } + + public string Tag { get; } } \ No newline at end of file diff --git a/tests/RepoM.Api.Tests/DynamicRepositoryActionDeserializerFactory.cs b/tests/RepoM.Api.Tests/DynamicRepositoryActionDeserializerFactory.cs index 23bfe79e..dc2cb9c9 100644 --- a/tests/RepoM.Api.Tests/DynamicRepositoryActionDeserializerFactory.cs +++ b/tests/RepoM.Api.Tests/DynamicRepositoryActionDeserializerFactory.cs @@ -1,10 +1,13 @@ namespace RepoM.Api.Tests; +using System; +using System.Collections.Generic; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Data; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Data.Actions; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Deserialization; +using RepoM.Core.Plugin.RepositoryOrdering.Configuration; internal static class DynamicRepositoryActionDeserializerFactory { @@ -29,11 +32,12 @@ public static JsonDynamicRepositoryActionDeserializer Create() new DefaultActionDeserializer(), new ActionForEachV1Deserializer(), new DefaultActionDeserializer(), - })); + }, + Array.Empty>())); } public static JsonDynamicRepositoryActionDeserializer CreateWithDeserializer(IActionDeserializer actionDeserializer) { - return new JsonDynamicRepositoryActionDeserializer(new ActionDeserializerComposition(new[] { actionDeserializer, })); + return new JsonDynamicRepositoryActionDeserializer(new ActionDeserializerComposition(new[] { actionDeserializer, }, Array.Empty>())); } } \ No newline at end of file diff --git a/tests/RepoM.Plugin.AzureDevOps.Tests/ActionProvider/AzureDevOpsGetPullRequestsV1Test.cs b/tests/RepoM.Plugin.AzureDevOps.Tests/ActionProvider/AzureDevOpsGetPullRequestsV1Test.cs index 76ef8b3a..8f29383e 100644 --- a/tests/RepoM.Plugin.AzureDevOps.Tests/ActionProvider/AzureDevOpsGetPullRequestsV1Test.cs +++ b/tests/RepoM.Plugin.AzureDevOps.Tests/ActionProvider/AzureDevOpsGetPullRequestsV1Test.cs @@ -10,6 +10,7 @@ namespace RepoM.Plugin.AzureDevOps.Tests.ActionProvider; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Data; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Deserialization; using RepoM.Api.Tests.IO.ModuleBasedRepositoryActionProvider; +using RepoM.Core.Plugin.RepositoryOrdering.Configuration; using RepoM.Plugin.AzureDevOps.ActionProvider.Options; using VerifyTests; using VerifyXunit; @@ -78,6 +79,6 @@ private RepositoryActionConfiguration SutDeserialize(string rawContent, Serializ private static JsonDynamicRepositoryActionDeserializer CreateWithDeserializer(IActionDeserializer actionDeserializer) { - return new JsonDynamicRepositoryActionDeserializer(new ActionDeserializerComposition(new IActionDeserializer[] { actionDeserializer, })); + return new JsonDynamicRepositoryActionDeserializer(new ActionDeserializerComposition(new IActionDeserializer[] { actionDeserializer, }, Array.Empty>())); } } \ No newline at end of file diff --git a/tests/RepoM.Plugin.AzureDevOps.Tests/TestFramework/DynamicRepositoryActionDeserializerFactory.cs b/tests/RepoM.Plugin.AzureDevOps.Tests/TestFramework/DynamicRepositoryActionDeserializerFactory.cs index 6be61ef6..2600f060 100644 --- a/tests/RepoM.Plugin.AzureDevOps.Tests/TestFramework/DynamicRepositoryActionDeserializerFactory.cs +++ b/tests/RepoM.Plugin.AzureDevOps.Tests/TestFramework/DynamicRepositoryActionDeserializerFactory.cs @@ -1,9 +1,11 @@ namespace RepoM.Plugin.AzureDevOps.Tests.TestFramework; +using System; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Data; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Deserialization; +using RepoM.Core.Plugin.RepositoryOrdering.Configuration; using RepoM.Plugin.AzureDevOps.ActionProvider.Options; internal static class DynamicRepositoryActionDeserializerFactory @@ -16,11 +18,12 @@ public static JsonDynamicRepositoryActionDeserializer Create() { new DefaultActionDeserializer(), new DefaultActionDeserializer(), - })); + }, + Array.Empty>())); } public static JsonDynamicRepositoryActionDeserializer CreateWithDeserializer(IActionDeserializer actionDeserializer) { - return new JsonDynamicRepositoryActionDeserializer(new ActionDeserializerComposition(new[] { actionDeserializer, })); + return new JsonDynamicRepositoryActionDeserializer(new ActionDeserializerComposition(new[] { actionDeserializer, }, Array.Empty>())); } } \ No newline at end of file diff --git a/tests/RepoM.Plugin.Clipboard.Tests/ActionProvider/ActionClipboardCopyV1DeserializerTest.cs b/tests/RepoM.Plugin.Clipboard.Tests/ActionProvider/ActionClipboardCopyV1DeserializerTest.cs index e3f278ad..9a90984d 100644 --- a/tests/RepoM.Plugin.Clipboard.Tests/ActionProvider/ActionClipboardCopyV1DeserializerTest.cs +++ b/tests/RepoM.Plugin.Clipboard.Tests/ActionProvider/ActionClipboardCopyV1DeserializerTest.cs @@ -10,6 +10,7 @@ namespace RepoM.Plugin.Clipboard.Tests.ActionProvider; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Data; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Deserialization; using RepoM.Api.Tests.IO.ModuleBasedRepositoryActionProvider; +using RepoM.Core.Plugin.RepositoryOrdering.Configuration; using RepoM.Plugin.Clipboard.ActionProvider; using VerifyTests; using VerifyXunit; @@ -78,6 +79,6 @@ private RepositoryActionConfiguration SutDeserialize(string rawContent, Serializ private static JsonDynamicRepositoryActionDeserializer CreateWithDeserializer(IActionDeserializer actionDeserializer) { - return new JsonDynamicRepositoryActionDeserializer(new ActionDeserializerComposition(new[] { actionDeserializer, })); + return new JsonDynamicRepositoryActionDeserializer(new ActionDeserializerComposition(new[] { actionDeserializer, }, Array.Empty>())); } } \ No newline at end of file diff --git a/tests/RepoM.Plugin.Clipboard.Tests/TestFramework/DynamicRepositoryActionDeserializerFactory.cs b/tests/RepoM.Plugin.Clipboard.Tests/TestFramework/DynamicRepositoryActionDeserializerFactory.cs index bb56f893..4f0b48c3 100644 --- a/tests/RepoM.Plugin.Clipboard.Tests/TestFramework/DynamicRepositoryActionDeserializerFactory.cs +++ b/tests/RepoM.Plugin.Clipboard.Tests/TestFramework/DynamicRepositoryActionDeserializerFactory.cs @@ -1,9 +1,11 @@ namespace RepoM.Plugin.Clipboard.Tests.TestFramework; +using System; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Data; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Deserialization; +using RepoM.Core.Plugin.RepositoryOrdering.Configuration; using RepoM.Plugin.Clipboard.ActionProvider; internal static class DynamicRepositoryActionDeserializerFactory @@ -15,11 +17,12 @@ public static JsonDynamicRepositoryActionDeserializer Create() new IActionDeserializer[] { new DefaultActionDeserializer(), - })); + }, + Array.Empty>())); } public static JsonDynamicRepositoryActionDeserializer CreateWithDeserializer(IActionDeserializer actionDeserializer) { - return new JsonDynamicRepositoryActionDeserializer(new ActionDeserializerComposition(new[] { actionDeserializer, })); + return new JsonDynamicRepositoryActionDeserializer(new ActionDeserializerComposition(new[] { actionDeserializer, }, Array.Empty>())); } } \ No newline at end of file diff --git a/tests/RepoM.Plugin.Heidi.Tests/ActionProvider/ActionHeidiDatabasesV1DeserializerTest.cs b/tests/RepoM.Plugin.Heidi.Tests/ActionProvider/ActionHeidiDatabasesV1DeserializerTest.cs index 8b12943b..3e88c90a 100644 --- a/tests/RepoM.Plugin.Heidi.Tests/ActionProvider/ActionHeidiDatabasesV1DeserializerTest.cs +++ b/tests/RepoM.Plugin.Heidi.Tests/ActionProvider/ActionHeidiDatabasesV1DeserializerTest.cs @@ -10,6 +10,7 @@ namespace RepoM.Plugin.Heidi.Tests.ActionProvider; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Data; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Deserialization; using RepoM.Api.Tests.IO.ModuleBasedRepositoryActionProvider; +using RepoM.Core.Plugin.RepositoryOrdering.Configuration; using RepoM.Plugin.Heidi.ActionProvider; using VerifyTests; using VerifyXunit; @@ -78,6 +79,6 @@ private RepositoryActionConfiguration SutDeserialize(string rawContent, Serializ private static JsonDynamicRepositoryActionDeserializer CreateWithDeserializer(IActionDeserializer actionDeserializer) { - return new JsonDynamicRepositoryActionDeserializer(new ActionDeserializerComposition(new[] { actionDeserializer, })); + return new JsonDynamicRepositoryActionDeserializer(new ActionDeserializerComposition(new[] { actionDeserializer, }, Array.Empty>())); } } \ No newline at end of file diff --git a/tests/RepoM.Plugin.Heidi.Tests/TestFramework/DynamicRepositoryActionDeserializerFactory.cs b/tests/RepoM.Plugin.Heidi.Tests/TestFramework/DynamicRepositoryActionDeserializerFactory.cs index 2869447c..2762c84c 100644 --- a/tests/RepoM.Plugin.Heidi.Tests/TestFramework/DynamicRepositoryActionDeserializerFactory.cs +++ b/tests/RepoM.Plugin.Heidi.Tests/TestFramework/DynamicRepositoryActionDeserializerFactory.cs @@ -1,9 +1,11 @@ namespace RepoM.Plugin.Heidi.Tests.TestFramework; +using System; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Data; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Deserialization; +using RepoM.Core.Plugin.RepositoryOrdering.Configuration; using RepoM.Plugin.Heidi.ActionProvider; internal static class DynamicRepositoryActionDeserializerFactory @@ -15,11 +17,12 @@ public static JsonDynamicRepositoryActionDeserializer Create() new IActionDeserializer[] { new DefaultActionDeserializer(), - })); + }, + Array.Empty>())); } public static JsonDynamicRepositoryActionDeserializer CreateWithDeserializer(IActionDeserializer actionDeserializer) { - return new JsonDynamicRepositoryActionDeserializer(new ActionDeserializerComposition(new[] { actionDeserializer, })); + return new JsonDynamicRepositoryActionDeserializer(new ActionDeserializerComposition(new[] { actionDeserializer, }, Array.Empty>())); } } \ No newline at end of file diff --git a/tests/RepoM.Plugin.SonarCloud.Tests/SonarCloudSetFavoriteV1Test.cs b/tests/RepoM.Plugin.SonarCloud.Tests/SonarCloudSetFavoriteV1Test.cs index 90c416a5..28ed587d 100644 --- a/tests/RepoM.Plugin.SonarCloud.Tests/SonarCloudSetFavoriteV1Test.cs +++ b/tests/RepoM.Plugin.SonarCloud.Tests/SonarCloudSetFavoriteV1Test.cs @@ -10,6 +10,7 @@ namespace RepoM.Plugin.SonarCloud.Tests; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Data; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Deserialization; using RepoM.Api.Tests.IO.ModuleBasedRepositoryActionProvider; +using RepoM.Core.Plugin.RepositoryOrdering.Configuration; using RepoM.Plugin.SonarCloud; using VerifyTests; using VerifyXunit; @@ -78,6 +79,6 @@ private RepositoryActionConfiguration SutDeserialize(string rawContent, Serializ private static JsonDynamicRepositoryActionDeserializer CreateWithDeserializer(IActionDeserializer actionDeserializer) { - return new JsonDynamicRepositoryActionDeserializer(new ActionDeserializerComposition(new IActionDeserializer[] { actionDeserializer, })); + return new JsonDynamicRepositoryActionDeserializer(new ActionDeserializerComposition(new IActionDeserializer[] { actionDeserializer, }, Array.Empty>())); } } \ No newline at end of file diff --git a/tests/RepoM.Plugin.SonarCloud.Tests/TestFramework/DynamicRepositoryActionDeserializerFactory.cs b/tests/RepoM.Plugin.SonarCloud.Tests/TestFramework/DynamicRepositoryActionDeserializerFactory.cs index 93549719..a8e73c37 100644 --- a/tests/RepoM.Plugin.SonarCloud.Tests/TestFramework/DynamicRepositoryActionDeserializerFactory.cs +++ b/tests/RepoM.Plugin.SonarCloud.Tests/TestFramework/DynamicRepositoryActionDeserializerFactory.cs @@ -1,9 +1,11 @@ namespace RepoM.Plugin.SonarCloud.Tests.TestFramework; +using System; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.ActionDeserializers; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Data; using RepoM.Api.IO.ModuleBasedRepositoryActionProvider.Deserialization; +using RepoM.Core.Plugin.RepositoryOrdering.Configuration; internal static class DynamicRepositoryActionDeserializerFactory { @@ -14,11 +16,12 @@ public static JsonDynamicRepositoryActionDeserializer Create() new IActionDeserializer[] { new DefaultActionDeserializer(), - })); + }, + Array.Empty>())); } public static JsonDynamicRepositoryActionDeserializer CreateWithDeserializer(IActionDeserializer actionDeserializer) { - return new JsonDynamicRepositoryActionDeserializer(new ActionDeserializerComposition(new[] { actionDeserializer, })); + return new JsonDynamicRepositoryActionDeserializer(new ActionDeserializerComposition(new[] { actionDeserializer, }, Array.Empty>())); } } \ No newline at end of file