Beispiel #1
0
        public void ShouldHavePasswordResetEmail()
        {
            UserManagerConfig config = new UserManagerConfig();
            UserManager       mgr    = config.Create();

            Expect.IsTrue(mgr.EmailComposer.TemplateExists(UserManager.PasswordResetEmailName), "Password Reset email template was not there");
        }
Beispiel #2
0
        public void ShouldHaveConfirmationEmail()
        {
            UserManagerConfig config = new UserManagerConfig();
            UserManager       mgr    = config.Create();

            Expect.IsTrue(mgr.EmailComposer.TemplateExists(UserManager.AccountConfirmationEmailName), "Account Confirmation email template was not there");
        }
Beispiel #3
0
        public void ShouldInitializeDaoUserManagerFromConfig()
        {
            UserManagerConfig config = new UserManagerConfig();
            UserManager       mgr    = config.Create();

            Expect.IsNotNull(mgr);
            Expect.IsNotNull(mgr.EmailComposer);
            Expect.IsNotNull(mgr.SmtpSettingsVault);
        }
Beispiel #4
0
        public void ShouldInitializeDaoUserManagerAppNameResolver()
        {
            UserManagerConfig config = new UserManagerConfig();

            config.ApplicationNameResolverType = typeof(TestAppNameProvider).AssemblyQualifiedName;
            UserManager mgr = config.Create();

            Expect.IsNotNull(mgr);
            Expect.IsNotNull(mgr.ApplicationNameProvider);
            Expect.IsObjectOfType <TestAppNameProvider>(mgr.ApplicationNameProvider, "Resolver was a {0}"._Format(mgr.ApplicationNameProvider.GetType().Name));
        }
Beispiel #5
0
        public void ShouldInitializeUserManagerVault()
        {
            UserManagerConfig config = new UserManagerConfig();

            config.SmtpSettingsVaultPath = ".\\Test.vault.sqlite";
            UserManager mgr = config.Create();

            Expect.IsNotNull(mgr);
            Expect.IsNotNull(mgr.SmtpSettingsVault);
            Expect.IsNotNull(mgr.SmtpSettingsVault.ConnectionString);
            Expect.IsTrue(mgr.SmtpSettingsVault.ConnectionString.ToLowerInvariant().Contains("test.vault.sqlite"), "Unexpected connection string value");
        }
        public static UserManager CreateTestUserManager(string appName = "test")
        {
            UserManagerConfig config = new UserManagerConfig();

            config.SmtpSettingsVaultPath      = DataProvider.Instance.GetSysDatabasePathFor(typeof(Vault), "System");
            config.ApplicationName            = appName;
            config.EmailTemplateDirectoryPath = DataProvider.Instance.GetSysEmailTemplatesDirectory().FullName;

            UserManager mgr = config.Create();

            return(mgr);
        }
Beispiel #7
0
        public void ShouldInitializeUserManagerEmailComposer()
        {
            UserManagerConfig config = new UserManagerConfig();

            config.EmailComposerType          = typeof(TestEmailComposer).AssemblyQualifiedName;
            config.EmailTemplateDirectoryPath = _testEmailComposerTemplateDir.FullName;
            UserManager mgr = config.Create();

            Expect.IsNotNull(mgr);
            Expect.IsNotNull(mgr.EmailComposer);
            Expect.IsObjectOfType <TestEmailComposer>(mgr.EmailComposer, "Composer was a {0}"._Format(mgr.EmailComposer.GetType().Name));
            Expect.AreEqual(_testEmailComposerTemplateDir.FullName, mgr.EmailComposer.TemplateDirectory.FullName);
        }
Beispiel #8
0
        public void DaoUserManagerConfigTemplateDirectoryMustNotBeNull()
        {
            UserManagerConfig config = new UserManagerConfig();

            Expect.IsNotNull(config.EmailTemplateDirectoryPath);
        }