Exemplo n.º 1
0
 public EmergencyContactDataProvider(
     IUnitOfWork unitOfWork,
     IContactAddressDataProvider addressDataProvider,
     IContactPhoneDataProvider phoneDataProvider,
     IContactEmailDataProvider emailDataProvider,
     IContactClientIdentifierDataProvider clientIdentifierDataProvider)
     : base(unitOfWork, addressDataProvider, phoneDataProvider, emailDataProvider, clientIdentifierDataProvider)
 {
 }
 public ECIDemographicDataProvider(IUnitOfWork unitOfWork,
                                   IContactAddressDataProvider _addressDataProvider,
                                   IContactPhoneDataProvider _phoneDataProvider,
                                   IContactEmailDataProvider _emailDataProvider,
                                   IContactClientIdentifierDataProvider _clientIdentifierDataProvider,
                                   IContactPresentingProblemProvider contactPresentingProblemProvider)
     : base(unitOfWork, _addressDataProvider, _phoneDataProvider, _emailDataProvider, _clientIdentifierDataProvider)
 {
     this.contactPresentingProblemProvider = contactPresentingProblemProvider;
 }
 public RegistrationDataProvider(IUnitOfWork unitOfWork,
                                 IContactAddressDataProvider _addressDataProvider,
                                 IContactPhoneDataProvider _phoneDataProvider,
                                 IContactEmailDataProvider _emailDataProvider,
                                 IContactClientIdentifierDataProvider _clientIdentifierDataProvider,
                                 IContactPresentingProblemProvider contactPresentingProblemProvider)
     : base(unitOfWork, _addressDataProvider, _phoneDataProvider, _emailDataProvider, _clientIdentifierDataProvider)
 {
     this.unitOfWork = unitOfWork;
     this.contactPresentingProblemProvider = contactPresentingProblemProvider;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ECIRegistrationBaseDataProvider{Model}"/> class.
 /// </summary>
 /// <param name="unitOfWork">The unit of work.</param>
 /// <param name="addressDataProvider">The address data provider.</param>
 /// <param name="phoneDataProvider">The phone data provider.</param>
 /// <param name="emailDataProvider">The email data provider.</param>
 public ECIRegistrationBaseDataProvider(IUnitOfWork unitOfWork, IContactAddressDataProvider addressDataProvider,
                                        IContactPhoneDataProvider phoneDataProvider, IContactEmailDataProvider emailDataProvider,
                                        IContactClientIdentifierDataProvider clientIdentifierDataProvider)
 {
     this._unitOfWork                   = unitOfWork;
     this._addressDataProvider          = addressDataProvider;
     this._phoneDataProvider            = phoneDataProvider;
     this._emailDataProvider            = emailDataProvider;
     this._clientIdentifierDataProvider = clientIdentifierDataProvider;
     this._logger = new Logger(true);
 }
Exemplo n.º 5
0
 public QuickRegistrationDataProvider(IUnitOfWork unitOfWork, IRegistrationTypeDataProvider registrationTypeDataProvider, IAddressTypeDataProvider addressTypeDataProvider,
                                      ICountyDataProvider countyDataProvider, IStateProvinceDataProvider stateProvinceDataProvider, IGenderDataProvider genderDataProvider, IContactAddressDataProvider addressDataProvider,
                                      IContactEmailDataProvider emailDataProvider, IContactPhoneDataProvider phoneDataProvider)
 {
     _unitOfWork = unitOfWork;
     _registrationTypeDataProvider = registrationTypeDataProvider;
     _addressTypeDataProvider      = addressTypeDataProvider;
     _countyDataProvider           = countyDataProvider;
     _stateProvinceDataProvider    = stateProvinceDataProvider;
     _addressDataProvider          = addressDataProvider;
     _emailDataProvider            = emailDataProvider;
     _phoneDataProvider            = phoneDataProvider;
     _genderDataProvider           = genderDataProvider;
 }
        /// <summary>
        /// Mock_s  contact Emails_ failed.
        /// </summary>
        public void Mock_ContactEmails_Failed()
        {
            Mock <IContactEmailDataProvider> mock = new Mock <IContactEmailDataProvider>();

            contactEmailDataProvider = mock.Object;

            var contactEmails = new List <ContactEmailModel>();

            contactEmailsModel = new ContactEmailModel()
            {
                ContactID         = -1,
                ContactEmailID    = -1,
                Email             = "*****@*****.**",
                EmailID           = 0,
                EmailPermissionID = 0,
                IsPrimary         = true,
            };
            contactEmails.Add(contactEmailsModel);
            var contactEmail = new Response <ContactEmailModel>()
            {
                DataItems = contactEmails
            };

            //Get contactEmails
            Response <ContactEmailModel> contactEmailsResponse = new Response <ContactEmailModel>();

            contactEmailsResponse.DataItems = contactEmails.Where(contact => contact.ContactID == contactId).ToList();

            mock.Setup(r => r.GetEmails(It.IsAny <long>(), It.IsAny <int>()))
            .Returns(contactEmailsResponse);

            //Add contactEmails
            mock.Setup(r => r.AddEmails(It.IsAny <long>(), It.IsAny <List <ContactEmailModel> >()))
            .Callback <long, List <ContactEmailModel> >((i, p) => contactEmails.AddRange(p))
            .Returns(contactEmail);

            //Update contactEmails
            mock.Setup(r => r.UpdateEmails(It.IsAny <long>(), It.IsAny <List <ContactEmailModel> >()))
            .Callback <long, List <ContactEmailModel> >((i, p) => contactEmails.AddRange(p))
            .Returns(contactEmail);

            //Delete Contact Email
            mock.Setup(r => r.DeleteEmail(It.IsAny <long>()))
            .Callback <long>(t => contactEmails.Remove(contactEmails.Find(c => c.ContactEmailID == t)))
            .Returns(contactEmail);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="RegistrationController"/> class.
 /// </summary>
 /// <param name="emailDataProvider">The email data provider.</param>
 public ContactEmailController(IContactEmailDataProvider emailDataProvider)
 {
     _emailDataProvider = emailDataProvider;
 }