private static void CreateDatabaseSchemaAndDemoData()
        {
            CreateDatabaseSchema();

            var session = NHibernateHelper.SessionFactory.OpenSession();
            var passwordPolicy = new RegularExpressionPasswordPolicy(".{5,}$");
            var translationsRepository = new TranslationRepository(session, new InMemoryKeyValueCache());
            var applicationSettings = new ApplicationSettings();
            var encryptor = new DefaultEncryptor();

            var userRepository = new UserRepository(session, passwordPolicy, applicationSettings, encryptor);

            // Create administrators
            PocoGenerator.CreateAdministrators(userRepository);

            // Create users
            PocoGenerator.CreateUsers(100, userRepository);

            session.Transaction.Begin();

            // Create translations
            PocoGenerator.CreateTranslations(translationsRepository);

            session.Transaction.Commit();

            // Create logitems
            PocoGenerator.CreateLogItems(new NLogLogger(applicationSettings, "Console.Admin"));
        }
        public void CanCreateSha512EncryptedString()
        {
            const string testString = "String to be encrypted";
            var encryptedString = new DefaultEncryptor().Sha512Encrypt(testString);

            Assert.AreEqual(128, encryptedString.Count());
            Assert.AreEqual("d8022b70792f76ed94c007962dc6fcbcb15463ab79eedbaaa0c42293918252e9c73c6ea121a19238adcae68f24c71e971346b806e5ead70a61caaa3a13a8b62a", encryptedString);
        }
        public void CanCreateMd5EncryptedString()
        {
            const string testString = "String to be encrypted";
            var encryptedString = new DefaultEncryptor().Md5Encrypt(testString);

            Assert.AreEqual(32, encryptedString.Count());
            Assert.AreEqual("52a3800d865b9017ac36e4d036133a91", encryptedString);
        }