public void FillStackWithElementsExpectProperCountAndCapacity()
 {
     PushStack();
     Assert.AreEqual(17, this.abStack.Count);
     Assert.AreEqual(32, this.abStack.Capacity);
     this.abStack = new AbStack<int>();
 }
        public void PopStackExpectProperCountAndCapacityReturnLastElement()
        {
            this.PushStack();
            this.PopStack();

            Assert.AreEqual(0, this.abStack.Count);
            Assert.AreEqual(16, this.abStack.Capacity);
            this.abStack = new AbStack<int>();
        }
        public void ToStringMethodExpectProperCountAndCapacityReturnLastElement()
        {
            this.PushStack();

            string toString = this.abStack.ToString();

            Assert.AreEqual("1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17", toString);

            this.abStack = new AbStack<int>();
        }
        public void StackConvertToArrayExpectProperCountAndCapacityReturnLastElement()
        {
            this.PushStack();

            int[] arr = this.abStack.ToArray();
            int[] compare = abStack.TrimExcess();

            for (int i = compare.Length - 1; i >= 0; i--)
            {
                Assert.AreEqual(compare[i], arr[i]);
            }

            this.abStack = new AbStack<int>();
        }