public void Substruct_ValidNumber_Substructs(int val) { var c = new CoinsPile(1, 5); c.Substruct((uint)val); Assert.AreEqual(5 - val, c.Count); }
public void Add_ValidNumber_Adds() { var c = new CoinsPile(1); c.Add(3); Assert.AreEqual(3, c.Count); }
public void TakeCoins_SmallBalance_SetsCoinsToValidCountAndBalanceToZero() { uint bal = 30; var p = new CoinsPile(2, 20); var result = p.TakeCoins(ref bal); Assert.AreEqual(5, p.Count); Assert.AreEqual(2, result.Nominal); Assert.AreEqual(15, result.Count); Assert.AreEqual(0, bal); }
public void TakeCoins_BigBalance_SetsCoinsToZeroAndModifiesBalance() { uint bal = 100; var p = new CoinsPile(3, 32); var result = p.TakeCoins(ref bal); Assert.AreEqual(0, p.Count); Assert.AreEqual(3, result.Nominal); Assert.AreEqual(32, result.Count); Assert.AreEqual(4, bal); }
public CoinsPileViewItem(CoinsPile source) { this.Source = source; }
public CoinsPileEventArgs(CoinsPile pile) { this.Pile = pile; }