Exemplo n.º 1
0
        public string Post(Account input)
        {
            var account = Session.Load<Account>(input.Id);

            account.EmailAddress = input.EmailAddress;
            account.Username = input.Username;
            account.Password = input.Password;
            account.FirstName = input.FirstName;
            account.LastName = input.LastName;
            account.Gender = input.Gender;
            account.DateOfBirth = input.DateOfBirth;
            account.Country = input.Country;
            account.State = input.State;
            account.City = input.City;
            account.Zip = input.Zip;
            account.Question1 = input.Question1;
            account.Question2 = input.Question2;
            account.Question3 = input.Question3;
            account.Question4 = input.Question4;
            account.Answer1 = input.Answer1;
            account.Answer2 = input.Answer2;
            account.Answer3 = input.Answer3;
            account.Answer4 = input.Answer4;
            account.IsActive = input.IsActive;

            return string.Empty;
        }
Exemplo n.º 2
0
        public Context(GlobalSettings globalSettings, Account account, IWebDriver driver, IList<Domain> domains, ISessionFactory nhibernateSessionFactory, Provider provider, IList<string> accountFolderNames, EngagementSession engagementSession, IServerStatusService serverStatusService)
        {
            GlobalSettings = globalSettings;
            Account = account;
            Driver = driver;
            NhibernateSessionFactory = nhibernateSessionFactory;
            this.provider = provider;
            ManualReset = new ManualResetEvent(false);
            AccountFolderNames = accountFolderNames;
            InboxEngageCounts = new Dictionary<string, int>();
            JunkEngageCounts = new Dictionary<string, int>();
            EngagementSession = engagementSession;
            _serverStatusService = serverStatusService;

            foreach (var domain in domains)
            {
                domain.GenerateBernoullis();
            }
            Domains = domains;
        }
Exemplo n.º 3
0
        private void InjectDevTestingData(ISession session, ref Account account)
        {
#if IS_DEV_MODE
#warning DEV_MODE Code Injection is Active. DO NOT DEPLOY TO PRODUCTION WITH THIS FLAG ON
#endif

            Logger.Fatal("Running in DEV_MODE");

            if (!System.Diagnostics.Debugger.IsAttached)
            {
                Logger.Fatal("Running out of Visual Studio. DEV_MODE Code will not be executed.");
                return;
            }

            ///////////////////////////////////////////////////////////////////////////////////////
            // Custom DEV_MODE code is defined here...

            // Yahoo testable seed
            //var pickAccountId = 142401;

            // Hotmail testable seed
            var pickAccountId = 32349;

            account = session.QueryOver<Account>()
                .Where
                (
                    x => (x.Provider == this._provider)

                // && (x.ServerId == DevModeServerId))

                // If using a pre-configured account for dev mode 
                && (x.Id == pickAccountId)
                )
                .ThenBy(x => x.LastEngagedDate).Asc
                .Take(1)
                .SingleOrDefault();

            WebDriverDefaults.NumberOfDaysToLookBack = 10;
        }
Exemplo n.º 4
0
 private void SetupDevTestingData(ISession session, ref Account account)
 {
     InjectDevTestingData(session, ref account);
 }
Exemplo n.º 5
0
        protected EngagementSession CreateNewEngagementSession(ISession session, Account account)
        {
            var engagementSession = new EngagementSession(account);

            session.Save(engagementSession);

            return engagementSession;
        }
Exemplo n.º 6
0
 public void AccountSelectedRaise(object sender, Account account)
 {
     OnAccountSelected(sender, account);
 }
Exemplo n.º 7
0
 public EngagementSession(Account account)
 {
     AccountId = account.Id;
     StartDate = DateTime.UtcNow;
 }