Esempio n. 1
0
        public void HashingPassword()
        {
            string passwd = "ABCDE";
            string hashed = manager.HashPassword(passwd);

            Assert.AreEqual(true, manager.VerifyPassword(hashed, passwd));
            Assert.AreEqual(false, manager.VerifyPassword(hashed, "ABCDEF"));
        }
 public PollEntity(PollModelView pollModelView, ApplicationUser user)
 {
     Question     = pollModelView.Question;
     DateTime     = DateTime.Now;
     UserChecking = pollModelView.UserChecking;
     View         = 0;
     UserCreator  = user;
     Answers      = new List <PollAnswersEntity>();
     foreach (var item in pollModelView.Answers)
     {
         Answers.Add(new PollAnswersEntity()
         {
             Answers = item, Votes = 0, Poll = this
         });
     }
     if (!string.IsNullOrEmpty(pollModelView.Password))
     {
         var privPollManager = new PrivatePollManager();
         Password = privPollManager.HashPassword(pollModelView.Password);
     }
 }