public GetInvestorById ( string id ) : |
||
id | string | |
return |
public void ShouldFetchMultipleOffersForInvestor() { Investor investor = CreateInvestor("Jagan1", 5000); InvestorRepository investorRepository = new InvestorRepository(session); investorRepository.Save(investor); Venture venture1 = CreateVenture(3000, 500, "Ram1"); Venture venture2 = CreateVenture(6000, 1000, "Ram2"); VentureRepository ventureRepository = new VentureRepository(session); ventureRepository.Save(venture1); ventureRepository.Save(venture2); Amount amount1 = new Amount(700); Amount amount2 = new Amount(800); Offer offer1 = new Offer(investor, amount1, venture1); Offer offer2 = new Offer(investor, amount2, venture2); OfferRepository offerRepository = new OfferRepository(session); offerRepository.Save(offer1); offerRepository.Save(offer2); session.Flush(); session.Clear(); Investor fetchedInvestor = investorRepository.GetInvestorById(investor.Id); Assert.AreEqual(new Amount(1500), fetchedInvestor.OfferValue); }
public void ShouldBeAbleToSaveInvestor() { string name = "Investor 1"; DateTime date = DateTime.Today; int amount = 100; Investor investor = new Investor(new Name(name), new Amount(amount)); InvestorRepository investorRepository = new InvestorRepository(session); string newId = investorRepository.Save(investor); Investor newInvestor = investorRepository.GetInvestorById(newId); Assert.AreEqual(new Name(name), newInvestor.Name); }
public void Should_Be_Able_To_Save_Investor() { string name = "Investor 1"; DateTime date = DateTime.Today; int amount = 100; Investor investor = new Investor(new Name(name), new GringottsDate(date), new Amount(amount)); InvestorRepository investorRepository = new InvestorRepository(); investorRepository.Session = session; int newId = investorRepository.Save(investor); Investor newInvestor = investorRepository.GetInvestorById(newId); Assert.AreEqual(new Name(name), newInvestor.Name); }
public void ShouldFetchOffersForInvestorAndVenture() { Investor investor = CreateInvestor("Jagan", 4000); InvestorRepository investorRepository = new InvestorRepository(session); investorRepository.Save(investor); Venture venture = CreateVenture(2000, 400, "Ram Capitalists"); VentureRepository ventureRepository = new VentureRepository(session); ventureRepository.Save(venture); Amount amount = new Amount(600); Offer offer = new Offer(investor, amount, venture); OfferRepository offerRepository = new OfferRepository(session); offerRepository.Save(offer); session.Flush(); session.Evict(investor); session.Evict(venture); session.Evict(offer); Investor fetchedInvestor = investorRepository.GetInvestorById(investor.Id); Assert.AreEqual(amount, fetchedInvestor.OfferValue); Venture fetchedVenture = ventureRepository.GetVentureById(venture.Id); Assert.AreEqual(amount, fetchedVenture.SubscribedAmount()); }