1 implementation of IActivator
Microsoft.AspNetCore.DataProtection (1)
SimpleActivator.cs (1)
14
internal class SimpleActivator :
IActivator
48 references to IActivator
KeyManagementSimulator (1)
Program.cs (1)
267
sealed class MockActivator(IXmlDecryptor decryptor, IAuthenticatedEncryptorDescriptorDeserializer descriptorDeserializer) :
IActivator
Microsoft.AspNetCore.DataProtection (19)
ActivatorExtensions.cs (5)
14
/// Extension methods for working with <see cref="
IActivator
"/>.
22
public static T CreateInstance<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(this
IActivator
activator, string implementationTypeName)
32
/// Returns a <see cref="
IActivator
"/> given an <see cref="IServiceProvider"/>.
35
public static
IActivator
GetActivator(this IServiceProvider serviceProvider)
38
? (serviceProvider.GetService<
IActivator
>() ?? new SimpleActivator(serviceProvider))
DataProtectionServiceCollectionExtensions.cs (1)
36
services.TryAddSingleton<
IActivator
, TypeForwardingActivator>();
KeyManagement\XmlKeyManager.cs (7)
52
private readonly
IActivator
_activator;
69
/// <param name="activator">The <see cref="
IActivator
"/>.</param>
71
public XmlKeyManager(IOptions<KeyManagementOptions> keyManagementOptions,
IActivator
activator)
80
/// <param name="activator">The <see cref="
IActivator
"/>.</param>
83
public XmlKeyManager(IOptions<KeyManagementOptions> keyManagementOptions,
IActivator
activator, ILoggerFactory loggerFactory)
90
IActivator
activator,
128
IActivator
activator,
RegistryPolicyResolver.cs (3)
26
private readonly
IActivator
_activator;
28
public RegistryPolicyResolver(
IActivator
activator)
34
internal RegistryPolicyResolver(RegistryKey policyRegKey,
IActivator
activator)
SimpleActivator.cs (1)
11
/// A simplified default implementation of <see cref="
IActivator
"/> that understands
XmlEncryption\XmlEncryptionExtensions.cs (2)
19
public static XElement DecryptElement(this XElement element,
IActivator
activator)
70
private static IXmlDecryptor CreateDecryptor(
IActivator
activator, string decryptorTypeName)
Microsoft.AspNetCore.DataProtection.Extensions.Tests (1)
DataProtectionProviderTests.cs (1)
64
s.GetRequiredService<
IActivator
>(),
Microsoft.AspNetCore.DataProtection.Tests (27)
ActivatorTests.cs (3)
71
var
expectedActivator = new Mock<
IActivator
>().Object;
73
serviceCollection.AddSingleton<
IActivator
>(expectedActivator);
KeyManagement\XmlKeyManagerTests.cs (12)
325
var
activator = new Mock<
IActivator
>().Object;
363
var mockActivator = new Mock<
IActivator
>();
441
var mockActivator = new Mock<
IActivator
>();
478
var mockActivator = new Mock<
IActivator
>();
518
var mockActivator = new Mock<
IActivator
>();
548
RunGetAllKeysCore(xml, new Mock<
IActivator
>().Object, loggerFactory).ToArray();
572
RunGetAllKeysCore(xml, new Mock<
IActivator
>().Object, loggerFactory).ToArray();
592
Assert.Throws<FormatException>(() => RunGetAllKeysCore(xml, new Mock<
IActivator
>().Object));
595
private static IReadOnlyCollection<IKey> RunGetAllKeysCore(string xml,
IActivator
activator, ILoggerFactory loggerFactory = null)
790
var activator = new Mock<
IActivator
>(MockBehavior.Strict);
867
var activator = new Mock<
IActivator
>(MockBehavior.Strict);
MockExtensions.cs (2)
18
public static void ReturnDescriptorGivenDeserializerTypeNameAndInput(this Mock<
IActivator
> mockActivator, string typeName, string xml, IAuthenticatedEncryptorDescriptor descriptor)
41
public static void ReturnDecryptedElementGivenDecryptorTypeNameAndInput(this Mock<
IActivator
> mockActivator, string typeName, string expectedInputXml, string outputXml)
XmlEncryption\XmlEncryptionExtensionsTests.cs (10)
37
var mockActivator = new Mock<
IActivator
>();
41
serviceCollection.AddSingleton<
IActivator
>(mockActivator.Object);
63
var mockActivator = new Mock<
IActivator
>();
68
serviceCollection.AddSingleton<
IActivator
>(mockActivator.Object);
95
var mockActivator = new Mock<
IActivator
>();
102
serviceCollection.AddSingleton<
IActivator
>(mockActivator.Object);
127
var mockActivator = new Mock<
IActivator
>();
134
serviceCollection.AddSingleton<
IActivator
>(mockActivator.Object);
181
var mockActivator = new Mock<
IActivator
>();
185
serviceCollection.AddSingleton<
IActivator
>(mockActivator.Object);