public void ShouldSendMailForForgotPassword()
        {
            testDataHelper = new TestDataHelper();
            var constituent = ConstituentMother.ConstituentWithName(ConstituentNameMother.JamesFranklin());
            var savedConstituent = testDataHelper.CreateConstituent(constituent);
            var email = testDataHelper.CreateEmail(EmailMother.Personal(savedConstituent, true));
            var login = testDataHelper.CreateUser(LoginMother.User(email, "Pass", false));

            var response = HttpHelper.DoHttpGet(string.Format("{0}?email={1}", "http://localhost/kallivayalilService/KallivayalilService.svc/Login/ForgotPassword",email.Address));
            Assert.That(response.StatusCode,Is.EqualTo(HttpStatusCode.OK));
        }
        public void ShouldLoadExistingLogin()
        {
            testDataHelper = new TestDataHelper();
            var constituent = ConstituentMother.ConstituentWithName(ConstituentNameMother.JamesFranklin());

            var savedConstituent = testDataHelper.CreateConstituent(constituent);
            var email = testDataHelper.CreateEmail(EmailMother.Official(savedConstituent));
            var login = testDataHelper.CreateUser(LoginMother.User(email, "Pass", false));

            var emailData = HttpHelper.Get<LoginData>(string.Format("{0}?username={1}", "http://localhost/kallivayalilService/KallivayalilService.svc/Login", email.Address));

            Assert.That(emailData.Id, Is.GreaterThan(0));
        }
        public void ShouldUpdateExistingUser()
        {
            testDataHelper = new TestDataHelper();
            var constituent = ConstituentMother.ConstituentWithName(ConstituentNameMother.JamesFranklin());
            var savedConstituent = testDataHelper.CreateConstituent(constituent);
            var email = testDataHelper.CreateEmail(EmailMother.Personal(savedConstituent, false));
            var login = testDataHelper.CreateUser(LoginMother.User(email,"Pass",false));

            var loginData = LoginDataMother.User(email,"Pass1",true);
            var updatedData = HttpHelper.Put(string.Format("{0}/{1}", "http://localhost/kallivayalilService/KallivayalilService.svc/Login", login.Id), loginData);

            Assert.That(updatedData.Email.Address, Is.EqualTo(email.Address));
            Assert.That(updatedData.Password, Is.EqualTo("Pass1"));
            Assert.That(updatedData.IsAdmin, Is.EqualTo(true));
        }