public CauseTemplateController(ICauseTemplateRepository causeTemplateRepository, ICauseRepository causeRepository)
 {
     this.causeTemplateRepository = causeTemplateRepository;
     this.causeRepository = causeRepository;
     Mapper.CreateMap<CauseTemplate, CauseTemplateDetailsModel>();
     Mapper.CreateMap<CauseTemplateDetailsModel, CauseTemplate>();
     Mapper.CreateMap<Cause, CauseDetailsModel>();
     Mapper.CreateMap<Recipient, RecipientDetailsModel>();
 }
 public UserProfileController(IUserProfileRepository userProfileRepository, ICauseRepository causeRepository, IUserProfileMailer mailer)
 {
     this.userProfileRepository = userProfileRepository;
     this.causeRepository = causeRepository;
     this.mailer = mailer;
     Mapper.CreateMap<UserProfile, UserProfileDetailsModel>();
     Mapper.CreateMap<Campaign, CampaignDetailsModel>();
     Mapper.CreateMap<Cause, CauseDetailsModel>();
     Mapper.CreateMap<CampaignDonor, DonationDetailsModel>();
 }
 public HomeInfoService(
     IMapper mapper,
     IDonationService donationService,
     GloballAppConfig globallAppConfig,
     IHomeInfoRepository homeInfoRepository,
     ICauseRepository causeRepository
     )
 {
     _mapper             = mapper;
     _donationService    = donationService;
     _globallAppConfig   = globallAppConfig;
     _homeInfoRepository = homeInfoRepository;
     _causeRepository    = causeRepository;
 }
        /// TODO: Dig a little deeper into the SaveFiles method to test some more use cases...
        /// * What if a single upload fails
        /// * What if 1 of 3 fails
        /// * What if 3 of 3 fails
        /// * etc...
        private void SetUpController()
        {
            organizationRepository = new FakeOrganizationRepository();
            causeTemplateRepository = new FakeCauseTemplateRepository();
            causeRepository = new FakeCauseRepository();
            controller = new CauseTemplateController(causeTemplateRepository, causeRepository)
                             {
                                 OrganizationRepository = organizationRepository
                             };

            TestHelpers.MockBasicRequest(controller);

            organization = organizationRepository.GetDefaultOrganization();
            organization.CauseTemplates.Add(EntityHelpers.GetValidCauseTemplate());
        }
 public void SetUp()
 {
     causeRepository = new CauseRepository();
     organizationRepository = new OrganizationRepository();
 }
 public CauseService(IMapper mapper, ICauseRepository causeRepository)
 {
     _mapper          = mapper;
     _causeRepository = causeRepository;
 }
        /// TODO: Dig a little deeper into the SaveFiles method to test some more use cases...
        /// * What if a single upload fails
        /// * What if 1 of 3 fails
        /// * What if 3 of 3 fails
        /// * etc...
        private CauseTemplateController GetController(bool isAuthenticated = false, bool postFiles = true)
        {
            organizationRepository = new FakeOrganizationRepository();
            causeTemplateRepository = new FakeCauseTemplateRepository();

            causeRepository = mocks.DynamicMock<ICauseRepository>();
            Expect.Call(causeRepository.GetCauseByCauseTemplateIdAndReferenceNumber(-1, "")).IgnoreArguments()
                .Return(EntityHelpers.GetValidCause());

            var causeTemplateController = new CauseTemplateController(causeTemplateRepository, causeRepository);
            organization = organizationRepository.GetDefaultOrganization();
            organization.CauseTemplates = new List<CauseTemplate> { EntityHelpers.GetValidCauseTemplate() };

            TestHelpers.MockHttpContext(causeTemplateController, mocks, isAuthenticated, postFiles);
            return causeTemplateController;
        }
Example #8
0
 public CausesService(ICauseRepository repository)
 {
     _repository = repository;
 }