public void Buy(InvestmentDetails buy) { if (buy == null) { throw new ArgumentNullException(nameof(buy)); } _context.InvestmentDetails.Add(buy); }
public void ShouldGetIvestmentDetails() { // arrange var id = 7; var expected = new InvestmentDetails { Id = 1, UserId = 2, Name = "Foo", Shares = 12, CostBasisPerShare = 29.00m, CurrentPricePerShare = 75.84m, }; this.portfolio.Setup(m => m.GetInvestmentDetails(id)).Returns(expected); // act var response = this.sut.Details(id); // assert Assert.Equal(expected, response.Value); this.portfolio.Verify(m => m.GetInvestmentDetails(id), Times.Once()); }
public void CreateOrUpdate(InvestmentDetails item) { investmentRepository.CreateOrUpdate(item); }
/// <summary> /// Initializes a new instance of the <see cref="InvestmentDetailsTests"/> class. /// </summary> public InvestmentDetailsTests() { this.sut = new InvestmentDetails(); }