public void Hash()
        {
            string ret = BLAuthentication.Hash("myPassword");

            Assert.AreNotSame(ret, "myPassword");

            this.Verify(ret);
        }
        public HttpResponseMessage Insert([FromBody] Player player)
        {
            //if (Authentication.getInstance().isAuthenticateWithHeader(Request))
            //{
            IPlayerDao PlayerDao = DalFactory.CreatePlayerDao(database);

            player.Password = BLAuthentication.Hash(player.Password);

            int id = PlayerDao.Insert(player);

            if (id == -1)
            {
                return(new HttpResponseMessage(HttpStatusCode.Conflict));
            }
            else
            {
                return(Request.CreateResponse <int>(HttpStatusCode.OK, id));
            }
            //}
            //else
            //{
            //	return new HttpResponseMessage(HttpStatusCode.Forbidden);
            //}
        }
 public void Verify(string hash)
 {
     Assert.IsTrue(BLAuthentication.Verify("myPassword", hash));
 }