Beispiel #1
0
        public void TestSerializationOfPasswordHashChanged()
        {
            var evt = new PasswordHashChanged("NEWHASH");

            var bytes    = LZ4MessagePackSerializer.Serialize <IEvent>(evt, AspnetIdentityResolver.Instance);
            var eventChk = LZ4MessagePackSerializer.Deserialize <IEvent>(bytes, AspnetIdentityResolver.Instance) as PasswordHashChanged;

            Assert.Equal(evt.PasswordHash, eventChk.PasswordHash);
        }
        private bool TestCommand(SetPasswordHash evt, out IEvent e)
        {
            e = null;
            if (user == null)
            {
                return(false);
            }

            if (!string.Equals(user.PasswordHash, evt.PasswordHash))
            {
                e = new PasswordHashChanged(evt.PasswordHash);
            }
            return(true);
        }
 private void HandleEvent(IActorRef _, PasswordHashChanged evt)
 {
     user.PasswordHash = evt.PasswordHash;
 }