public void PurchasesCounter_Price() { // arrange Purchases box = new Purchases(new Jewellery(10, 2000, "Golden ring"), new Jewellery(20, 6000, "Golden necklace"), new Jewellery(15, 5500, "Platinum earrings")); PurchasesCounter counter = new PurchasesCounter(box); double expected = 222500; //act double actual = counter.GetTotalPrice(); // assert Assert.AreEqual(expected, actual, 0.001, "TotalPrice has not been calculated correctly"); }
public void Purchases_Count() { // arrange Purchases box = new Purchases(new Jewellery(15, 2000, "Golden ring"), new Jewellery(23, 3000, "Golden necklace"), new Jewellery(15, 5500, "Platinum earrings")); int expected = 3; //act int actual = box.Count(); // assert Assert.AreEqual(expected, actual, "Count has not been calculated correctly"); }
public PurchasesCounter(Purchases box) { this.JewelleryBox = box; }