Ejemplo n.º 1
0
        public void DecryptPass_123abc_Returns234bcd()
        {
            string input    = "123abc";
            string expected = "234bcd";
            var    output   = PasswordCoding.Encrypt(input);

            Assert.That(output, Is.EqualTo(expected));
        }
Ejemplo n.º 2
0
 private async Task AddSender()
 {
     if (SenderEmail != null && SenderPassword != null)
     {
         var newSender = new Sender()
         {
             Email = SenderEmail, Password = PasswordCoding.Encrypt(SenderPassword)
         };
         _senderService.Add(newSender);
         Senders = new ObservableCollection <Sender>(new ObservableCollection <Sender>(_senderService.GetAll().Select(x => x = new Sender()
         {
             Id       = x.Id,
             Email    = x.Email,
             Password = PasswordCoding.Decrypt(x.Password)
         })));
         Messenger.Default.Send(newSender);
     }
 }
Ejemplo n.º 3
0
 private async Task EditSender()
 {
     if (SelectedSender != null)
     {
         _senderService.Edit(new Sender()
         {
             Id       = SelectedSender.Id,
             Email    = SelectedSender.Email,
             Password = PasswordCoding.Encrypt(SelectedSender.Password)
         });
         Messenger.Default.Send(SelectedSender);
         Senders = new ObservableCollection <Sender>(_senderService.GetAll().Select(x => new Sender()
         {
             Id       = x.Id,
             Email    = x.Email,
             Password = PasswordCoding.Decrypt(x.Password)
         }));
     }
 }