Beispiel #1
0
        private void Init()
        {
            var builder = new DbContextOptionsBuilder <FundraiseContext>()
                          .UseInMemoryDatabase("FundraiseTestDB");

            var context = new FundraiseContext(builder.Options);

            _donationRepository = new DonationRepository(context);

            var campaignRepository = new CampaignRepository(context);

            _testCampaign = campaignRepository.Create("test", "USD", null, null);

            var fundraiserRepository = new FundraiserRepository(context);

            _testFundraiser = fundraiserRepository.Create("test", _testCampaign.Id, FundraiserType.Individual, "test");
        }
Beispiel #2
0
 public AdminController(CampaignRepository campaignRepository, FundraiserRepository fundraiserRepository)
 {
     _campaignRepository   = campaignRepository;
     _fundraiserRepository = fundraiserRepository;
 }
Beispiel #3
0
 public FundraiserController(CampaignRepository campaignRepository, FundraiserRepository fundraiserRepository, IDonationRepository donationRepository)
 {
     _campaignRepository   = campaignRepository;
     _fundraiserRepository = fundraiserRepository;
     _donationRepository   = donationRepository;
 }