public void TestPush() { IFancyCalculator x = new FancyCalculator(); var stack = x.GetStack(); x.Push(45); Assert.IsTrue(stack.Count == 1); Assert.IsTrue(stack.Contains(45)); }
public void TestClear() { IFancyCalculator x = new FancyCalculator(); var stack = x.GetStack(); x.Push(25); x.Push(45); Assert.IsTrue(stack.Count == 2); x.Clear(); Assert.IsTrue(stack.Count == 0); }
public void TestAdd() { IFancyCalculator x = new FancyCalculator(); var stack = x.GetStack(); Assert.IsTrue(stack.Count == 0); x.Push(10); x.Push(20); x.Push(30); x.Push(40); x.Add(); Assert.IsTrue(x.Top() == 70); }
public void TestMultiply() { IFancyCalculator x = new FancyCalculator(); var calc = x.GetStack(); Assert.IsTrue(x.Size() == 0); x.Push(10); x.Push(20); x.Push(30); x.Push(40); x.Multiply(); Assert.IsTrue(x.Top() == 1200); x.Multiply(); Assert.IsTrue(x.Top() == 24000); }
public void TestSize() { IFancyCalculator x = new FancyCalculator(); var stack = x.GetStack(); x.Push(25); Assert.AreEqual(stack.Count, x.Size()); Assert.AreEqual(x.Size(), 1); x.Push(25); Assert.AreEqual(stack.Count, x.Size()); Assert.AreEqual(x.Size(), 2); x.Push(25); Assert.AreEqual(stack.Count, x.Size()); Assert.AreEqual(x.Size(), 3); }