Exemplo n.º 1
0
 public DonateHandler(ICampaignRepository campaignRepository, IFundraiserRepository fundraiserRepository, IDonationRepository donationRepository, IEventBus eventBus)
 {
     _campaignRepository   = campaignRepository;
     _fundraiserRepository = fundraiserRepository;
     _donationRepository   = donationRepository;
     _eventBus             = eventBus;
 }
 public FundraiserController(IFundraiserRepository fundraiserService,
                             IMapper mapper,
                             IHubContext <ZonorHub> signalHub)
 {
     this.fundraiserService = fundraiserService ?? throw new ArgumentNullException(nameof(fundraiserService));
     this.mapper            = mapper ?? throw new ArgumentNullException(nameof(mapper));
     this.signalHub         = signalHub ?? throw new ArgumentNullException(nameof(signalHub));
 }
Exemplo n.º 3
0
        private void Init()
        {
            var builder = new DbContextOptionsBuilder <FundraiseContext>()
                          .UseInMemoryDatabase("FundraiseTestDB");

            var context = new FundraiseContext(builder.Options);

            _fundraiserRepository = new FundraiserRepository(context);

            var campaignRepository = new CampaignRepository(context);

            testCampaign = campaignRepository.Create("test campaign", "USD", null, DateTime.Now.AddMonths(2));
        }
        public MockDonationRepository(FundContext dbContext,
                                      IFundraiserRepository fundraiserRepository,
                                      IDonorRepository donorRepository)
        {
            this.dbContext            = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
            this.fundraiserRepository = fundraiserRepository ?? throw new ArgumentNullException(nameof(fundraiserRepository));
            this.donorRepository      = donorRepository ?? throw new ArgumentNullException(nameof(donorRepository));

            Donations = new List <Donation> {
                new Donation {
                    FundraiserId = fundraiserRepository.GetFundraisersAsync().Result.First().Id,
                    DonorId      = donorRepository.GetDonorsAsync().Result.First().Id,
                    Amount       = 10,
                    DonationDate = DateTimeOffset.Now
                },

                new Donation {
                    FundraiserId = fundraiserRepository.GetFundraisersAsync().Result.First().Id,
                    DonorId      = donorRepository.GetDonorsAsync().Result.Last().Id,
                    Amount       = 40,
                    DonationDate = DateTimeOffset.Now
                },
            };
        }
Exemplo n.º 5
0
 public HomeController(ILogger<HomeController> logger, IMapper mapper, IFundraiserRepository fundraiserService, IDonorRepository donorService) :
     base(logger, mapper)
 {
     this.donorService = donorService ?? throw new ArgumentNullException(nameof(donorService));
     this.fundraiserService = fundraiserService ?? throw new ArgumentNullException(nameof(fundraiserService));
 }
Exemplo n.º 6
0
 public FundraiserController(CampaignRepository campaignRepository, FundraiserRepository fundraiserRepository, IDonationRepository donationRepository)
 {
     _campaignRepository   = campaignRepository;
     _fundraiserRepository = fundraiserRepository;
     _donationRepository   = donationRepository;
 }
Exemplo n.º 7
0
 public GetByIdHandler(IFundraiserRepository fundraiserRepository)
 {
     _fundraiserRepository = fundraiserRepository;
 }
 public FundraisersController(IFundraiserRepository fundraiserService, IMapper mapper)
 {
     this.fundraiserService = fundraiserService ?? throw new ArgumentNullException(nameof(fundraiserService));
     this.mapper            = mapper ?? throw new ArgumentNullException(nameof(mapper));
 }
Exemplo n.º 9
0
 public CreateHandler(IFundraiserRepository fundraiserRepository)
 {
     _fundraiserRepository = fundraiserRepository;
 }
Exemplo n.º 10
0
 public FundraisersByCreatorIdHandler(IFundraiserRepository fundraiserRepository)
 {
     _fundraiserRepository = fundraiserRepository;
 }