Beispiel #1
0
        public void OK()
        {
            #region - code -

            var network = new LocalNetwork()
            {
                sqlServer = connStr
            };
            var repo = new FakeRepo_User();
            var srv  = new SrvPasswordRecoveryV1(repo)
            {
                _sendEmail = false
            };

            if (!srv.Exec(network, new DtoPasswordRecovery
            {
                email = new UTstUserBase().Base_Ut_user.stEmail,
                _language = 0
            }))
            {
                Assert.Fail();
            }

            #endregion
        }
Beispiel #2
0
        public void EmailNotExists()
        {
            #region - code -

            var network = new LocalNetwork()
            {
                sqlServer = connStr
            };
            var repo = new FakeRepo_User();
            var srv  = new SrvPasswordRecoveryV1(repo)
            {
                _sendEmail = false
            };

            if (srv.Exec(network, new DtoPasswordRecovery
            {
                email = "*****@*****.**",
                _language = 0
            }))
            {
                Assert.Fail();
            }

            #endregion
        }
        public ActionResult Post([FromBody] DtoPasswordRecovery obj)
        {
            var repo = new DapperUserRepository();
            var srv  = new SrvPasswordRecoveryV1(repo)
            {
                _sendEmail = this._sendEmail
            };

            if (!srv.Exec(network, obj))
            {
                return(BadRequest(srv.Error));
            }

            return(Ok(new { }));
        }