public void WhenCreatingRegistrations_ThenCreatesSingleTypeRegistrationForTheSuppliedName()
        {
            var typeRegistrations =
                cryptographySettings.GetRegistrations(null).Where(
                    r => r.ServiceType == typeof(ISymmetricCryptoProvider));

            Assert.AreEqual(1, typeRegistrations.Count());
            Assert.AreEqual("custom", typeRegistrations.ElementAt(0).Name);
        }
        public void WhenCreatingRegistration_ThenCreatesDefaultRegistration()
        {
            var mangerRegistrations = cryptographySettings.GetRegistrations(null).Where(x => x.ServiceType == typeof(CryptographyManager));

            Assert.AreEqual(1, mangerRegistrations.Count());

            var registration = cryptographySettings.GetRegistrations(null).Where(x => x.ServiceType == typeof(IHashProvider)).First();

            Assert.IsTrue(registration.IsDefault);
        }
        public void WhenCreatingRegistrations_ThenCreatesSingleTypeRegistrationForTheSuppliedNameAndOneForCryptographyManager()
        {
            var mangerRegistrations = cryptographySettings.GetRegistrations(null).Where(x => x.ServiceType == typeof(CryptographyManager));

            Assert.AreEqual(1, mangerRegistrations.Count());

            var hashAlgorithmRegistrations = cryptographySettings.GetRegistrations(null).Where(x => x.ServiceType == typeof(IHashProvider));

            Assert.AreEqual(1, hashAlgorithmRegistrations.Count());
            Assert.AreEqual("name", hashAlgorithmRegistrations.ElementAt(0).Name);
        }
        public void WhenCreatingRegistration_ThenCreatesNonDefaultRegistration()
        {
            var typeRegistrations = cryptographySettings.GetRegistrations(null);

            TypeRegistration registration = typeRegistrations.ElementAt(0);

            Assert.IsFalse(registration.IsDefault);
        }
        public void WhenCreatingRegistration_ThenCreatesDefaultRegistration()
        {
            var typeRegistrations = cryptographySettings.GetRegistrations(null).Where(x => x.ServiceType == typeof(ISymmetricCryptoProvider));

            TypeRegistration registration = typeRegistrations.ElementAt(0);

            Assert.IsTrue(registration.IsDefault);
        }
        public void WhenCreatingRegistrations_ThenCreatesSingleTypeRegistrationForTheSuppliedName()
        {
            var mangerRegistrations = cryptographySettings.GetRegistrations(null).Where(x => x.ServiceType == typeof(CryptographyManager));

            Assert.AreEqual(1, mangerRegistrations.Count());

            var symmProviderRegistrations = cryptographySettings.GetRegistrations(null).Where(x => x.ServiceType == typeof(ISymmetricCryptoProvider));

            Assert.AreEqual(1, symmProviderRegistrations.Count());

            Assert.AreEqual("symmetric algorithm", symmProviderRegistrations.ElementAt(0).Name);
            var typeRegistrations = cryptographySettings.GetRegistrations(null);
        }
 protected override void  Act()
 {
     registrations               = cryptographySettings.GetRegistrations(null);
     cryptoManagerRegistration   = registrations.Where(r => r.ServiceType == typeof(CryptographyManager)).First();
     instrumentationRegistration = registrations.Where(r => r.ServiceType == typeof(IDefaultCryptographyInstrumentationProvider)).First();
 }