private static void RunTest(Dictionary <string, object> regValues, KeyManagementOptions options) { WithUniqueTempRegKey(registryKey => { foreach (var entry in regValues) { registryKey.SetValue(entry.Key, entry.Value); } var policyResolver = new RegistryPolicyResolver( registryKey, activator: SimpleActivator.DefaultWithoutServices); var setup = new KeyManagementOptionsSetup(NullLoggerFactory.Instance, policyResolver); setup.Configure(options); }); }
public void Configure_SetsExpectedValues() { // Arrange var setup = new KeyManagementOptionsSetup(NullLoggerFactory.Instance); var options = new KeyManagementOptions() { AuthenticatedEncryptorConfiguration = null }; // Act setup.Configure(options); // Assert Assert.Empty(options.KeyEscrowSinks); Assert.NotNull(options.AuthenticatedEncryptorConfiguration); Assert.IsType <AuthenticatedEncryptorConfiguration>(options.AuthenticatedEncryptorConfiguration); Assert.Collection( options.AuthenticatedEncryptorFactories, f => Assert.IsType <CngGcmAuthenticatedEncryptorFactory>(f), f => Assert.IsType <CngCbcAuthenticatedEncryptorFactory>(f), f => Assert.IsType <ManagedAuthenticatedEncryptorFactory>(f), f => Assert.IsType <AuthenticatedEncryptorFactory>(f)); }