Exemple #1
0
        public void After_drugstore_registration_should_insert_record_in_user_update_info_table()
        {
            var defaults = session.Query <DefaultValues>().First();

            defaults.AnalitFVersion = 705;
            Save(defaults);
            FlushAndCommit();

            SetupGeneralInformation();
            Css("#options_FillBillingInfo").Checked = false;
            browser.Button(Find.ById("RegisterButton")).Click();

            var client     = GetRegistredClient();
            var user       = client.Users.First();
            var updateInfo = session.Load <UserUpdateInfo>(user.Id);

            Assert.That(updateInfo.AFAppVersion, Is.EqualTo(705u));

            Assert.That(client.Status, Is.EqualTo(ClientStatus.On));
            Assert.That(client.Addresses.Count, Is.EqualTo(1), "не создали адрес доставки");

            var logs           = PasswordChangeLogEntity.GetByLogin(user.Login, DateTime.Today, DateTime.Today.AddDays(1));
            var passwordChange = logs.SingleOrDefault();

            Assert.That(passwordChange, Is.Not.Null);
            Assert.That(passwordChange.UserName, Is.EqualTo(Environment.UserName));
            Assert.That(passwordChange.TargetUserName, Is.EqualTo(user.Login));
            Assert.That(passwordChange.SentTo.Contains(String.Format(_randomClientName + _mailSuffix)), Is.True);
            Assert.That(passwordChange.SmtpId, Is.Not.EqualTo(0));
            Assert.That(updateInfo, Is.Not.Null, "Не создали запись в UserUpdateInfo");
        }
Exemple #2
0
        public void PasswordChangeLog(uint id, DateTime beginDate, DateTime endDate)
        {
            var user = DbSession.Load <User>(id);

            PropertyBag["logEntities"] = PasswordChangeLogEntity.GetByLogin(user.Login,
                                                                            beginDate,
                                                                            endDate.AddDays(1));
            PropertyBag["login"]     = user.Login;
            PropertyBag["beginDate"] = beginDate;
            PropertyBag["endDate"]   = endDate;
        }
        public void Is_change_password_by_one_self_return_true_if_last_password_change_done_by_client()
        {
            var entities = PasswordChangeLogEntity.GetByLogin(user.Login, DateTime.MinValue, DateTime.MaxValue);

            if (entities.Count > 0)
            {
                entities.Each(l => session.Delete(l));
            }
            Assert.That(user.IsChangePasswordByOneself(), Is.False);
            Save(new PasswordChangeLogEntity(user.Login, user.Login, Environment.MachineName));
            Assert.That(user.IsChangePasswordByOneself(), Is.True);
            Save(new PasswordChangeLogEntity(user.Login, user.Login, Environment.MachineName)
            {
                LogTime = DateTime.Now.AddSeconds(10)
            });
        }