public void ShouldBeAbleToUpdateInstrumentCurrentPrice() { Instrument instrument = new MutualFund(new Symbol("SUN"), new Price(1000), "Sun MF", "SUNMF", "SUN Magma", "Growth"); var four = new Price(4); instrument.UpdateCurrentPrice(four); Assert.AreEqual(four, instrument.CurrentPrice); }
public void ShouldUpdatePriceForMutualFund() { var fourThousand = new Price(4000); Instrument instrument = new MutualFund(new Symbol("SUN"), fourThousand, "Sun MF", "SUNMF","SUN Magma","Growth"); repository.Save(instrument); var lookedUpObject = repository.Lookup<Instrument>(instrument.Id); Assert.AreEqual(new Price(4000), lookedUpObject.CurrentPrice); var newPrice = new Price(2500); instrument.UpdateCurrentPrice(newPrice); lookedUpObject = repository.Lookup<Instrument>(instrument.Id); Assert.AreEqual(new Price(2500), lookedUpObject.CurrentPrice); }