/// <summary>
        /// Initializes a new instance of the <see cref="CRMProfileProvider"/> class.
        /// </summary>
        /// <param name="profileRepositoryFactory">The profile repository factory.</param>
        /// <param name="userRepositoryFactory">The user repository factory.</param>
        public CRMProfileProvider(IProfileRepositoryFactory profileRepositoryFactory, IUserRepositoryFactory userRepositoryFactory)
        {
            Assert.ArgumentNotNull(profileRepositoryFactory, "profileRepositoryFactory");
            Assert.ArgumentNotNull(userRepositoryFactory, "userRepositoryFactory");

            this.profileRepositoryFactory = profileRepositoryFactory;
            this.userRepositoryFactory    = userRepositoryFactory;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CrmMembershipProviderTest"/> class.
        /// </summary>
        public CrmMembershipProviderTest()
        {
            var cacheService = Substitute.For <ICacheService>();

            this.userRepository    = Substitute.For <UserRepositoryBase>(cacheService);
            this.profileRepository = Substitute.For <ProfileRepositoryBase>(this.userRepository, cacheService);

            this.userRepositoryFactory = Substitute.For <IUserRepositoryFactory>();
            this.userRepositoryFactory.GetRepository(Arg.Any <ConfigurationSettings>()).Returns(this.userRepository);

            this.profileRepositoryFactory = Substitute.For <IProfileRepositoryFactory>();
            this.profileRepositoryFactory.GetRepository(Arg.Any <ConfigurationSettings>()).Returns(this.profileRepository);

            var config = new NameValueCollection();

            config.Add("name", "crm");
            config.Add("applicationName", "CRM security provider");
            config.Add("readOnly", "false");
            config.Add("connectionStringName", "CRMConnString");

            this.crmMembershipProvider = new CRMMembershipProvider(this.userRepositoryFactory, this.profileRepositoryFactory);
            this.crmMembershipProvider.Initialize(config["name"], config);

            this.user = new CRMUser(
                "*****@*****.**",
                Guid.NewGuid(),
                "*****@*****.**",
                null,
                String.Empty,
                true,
                false,
                DateTime.Now,
                DateTime.Now,
                DateTime.MinValue,
                DateTime.MinValue,
                DateTime.MinValue);
        }