public void Balance_CommodityAmount_EmptyBalanceReturnsNullForGivenCommodity() { Commodity comm = new Commodity(CommodityPool.Current, new CommodityBase("comm")); Balance balance = new Balance(); Assert.IsNull(balance.CommodityAmount(comm)); }
public void Balance_CommodityAmount_ReturnsExistingSingleCommodity() { Commodity comm = new Commodity(CommodityPool.Current, new CommodityBase("comm")); Balance balance = new Balance(); balance.Add(new Amount(BigInt.FromLong(5), comm)); Amount amount = balance.CommodityAmount(); Assert.AreEqual(5, amount.Quantity.ToLong()); }
public void Balance_CommodityAmount_LooksForAddedAmountWithTheSameCommodity() { Commodity comm = new Commodity(CommodityPool.Current, new CommodityBase("comm")); Balance balance = new Balance(); balance.Add(new Amount(BigInt.FromLong(5), comm)); Amount amount = balance.CommodityAmount(comm); Assert.AreEqual(5, amount.Quantity.ToLong()); }