public void CreateStack_Test() { StackStaticLength obj = new StackStaticLength(); obj.Push(5); obj.Push(6); Assert.Equal(6, obj.PeekTop()); }
public void EmptyStack_Test() { var obj = new StackStaticLength(); obj.Push(1); obj.Push(1); obj.Push(1); obj.Push(1); obj.Push(1); obj.Push(1); obj.Push(1); obj.Push(1); obj.Push(1); obj.Push(1); obj.EmptyStack(); Assert.Equal(0, obj.StackLength()); obj.Push(1); Assert.Equal(1, obj.StackLength()); }
public void IsStackFull_Test() { var obj = new StackStaticLength(); obj.Push(1); obj.Push(1); obj.Push(1); obj.Push(1); obj.Push(1); obj.Push(1); obj.Push(1); obj.Push(1); obj.Push(1); obj.Push(1); Assert.Throws <System.IndexOutOfRangeException>(() => obj.Push(1)); }