public string GetMail(RegisterationConstituent registrationConstituent, string mailText) { return string.Format(mailText) + Environment.NewLine + string.Format( "\n\nFirstName:{0}\nLastName:{1}\nFamily:{2}\nAddress:{3}\nEmail:{4}\nHomePhone:{5}\nRegisteration Date:{6}" , registrationConstituent.Constituent.Name.FirstName, registrationConstituent.Constituent.Name.LastName, registrationConstituent.Constituent.BranchName , registrationConstituent.Address.Description , registrationConstituent.Email, registrationConstituent.Phone.Number, registrationConstituent.Constituent.CreatedDateTime); }
public RegisterationConstituent CreateRegistrationConstituent(RegisterationConstituent registerationConstituent) { registerationConstituent.Constituent.IsRegistered = 'A'; RegisterationConstituent registrationConstituent = repository.Save(registerationConstituent); //need to get all admin mail ids and sent the mail to all admins mail.Send("*****@*****.**", "*****@*****.**", GetMail(registrationConstituent, Constants.AdminMailText)); mail.Send(registrationConstituent.Email, "*****@*****.**", GetMail(registrationConstituent, Constants.UserMailText)); return registrationConstituent; }
public void ShouldSaveARegisteratonConstituent() { var mobileToSave = PhoneMother.Mobile(); var addressToSave = AddressMother.London(); var registerationConstituent = new RegisterationConstituent() { Constituent = constituent, Phone = mobileToSave, Email = "*****@*****.**", Password= "******", Address = addressToSave }; var savedConst = registerationRepository.Save(registerationConstituent); Assert.That(savedConst.Constituent.Id, Is.GreaterThan(0)); Assert.That(savedConst.Constituent.Name.Id, Is.GreaterThan(0)); Assert.That(savedConst.Phone.Id, Is.GreaterThan(0)); Assert.That(savedConst.Address.Id, Is.GreaterThan(0)); Assert.That(savedConst.Password, Is.EqualTo(registerationConstituent.Password)); Assert.That(savedConst.Email, Is.EqualTo(registerationConstituent.Email)); }