public void UpdateCurrentPriceExistingEntryForDate() { var priceHistory = new StockPriceHistory(Guid.NewGuid()); priceHistory.UpdateClosingPrice(new Date(2000, 01, 01), 1.00m); priceHistory.UpdateClosingPrice(new Date(2000, 01, 03), 3.00m); priceHistory.UpdateClosingPrice(new Date(2000, 01, 05), 5.00m); priceHistory.UpdateCurrentPrice(10.00m); priceHistory.UpdateCurrentPrice(11.00m); var result = priceHistory.GetPrice(Date.Today); result.Should().Be(11.00m); }
public void GetPriceCurrentDay() { var priceHistory = new StockPriceHistory(Guid.NewGuid()); priceHistory.UpdateClosingPrice(new Date(2000, 08, 01), 4.00m); priceHistory.UpdateClosingPrice(new Date(2000, 01, 01), 10.00m); priceHistory.UpdateClosingPrice(new Date(2000, 05, 01), 6.00m); priceHistory.UpdateCurrentPrice(15.00m); var result = priceHistory.GetPrice(Date.Today); result.Should().Be(15.00m); }
public void GetPriceBeforeFirstEntry() { var priceHistory = new StockPriceHistory(Guid.NewGuid()); priceHistory.UpdateClosingPrice(new Date(2000, 08, 01), 4.00m); priceHistory.UpdateClosingPrice(new Date(2000, 01, 01), 10.00m); priceHistory.UpdateClosingPrice(new Date(2000, 05, 01), 6.00m); priceHistory.UpdateCurrentPrice(15.00m); var result = priceHistory.GetPrice(new Date(1999, 02, 01)); result.Should().Be(0.00m); }