public void AnnotatedCommodity_Equals_ChecksIsAnnotated() { Date date = (Date)DateTime.Now.Date; Commodity commodity = new Commodity(CommodityPool.Current, new CommodityBase("comm")); AnnotatedCommodity annCommodity1 = new AnnotatedCommodity(commodity, new Annotation(new Amount(10), date, "tag")); AnnotatedCommodity annCommodity2 = new AnnotatedCommodity(commodity, new Annotation(new Amount(10), date, "tag")); Assert.IsFalse(annCommodity1.Equals(commodity)); Assert.IsTrue(annCommodity1.Equals(annCommodity2)); }
public void AnnotatedCommodity_Equals_ComparesDetails() { Date date = (Date)DateTime.Now.Date; Commodity commodity = new Commodity(CommodityPool.Current, new CommodityBase("comm")); AnnotatedCommodity annCommodity1 = new AnnotatedCommodity(commodity, new Annotation(new Amount(10), date, "tag")); AnnotatedCommodity annCommodity2 = new AnnotatedCommodity(commodity, new Annotation(new Amount(10), date, "tag")); AnnotatedCommodity annCommodity3 = new AnnotatedCommodity(commodity, new Annotation(new Amount(20), date, "tagq")); Assert.True(annCommodity1.Equals(annCommodity2)); Assert.False(annCommodity1.Equals(annCommodity3)); Assert.False(annCommodity2.Equals(annCommodity3)); }