-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathStackTest.txt
95 lines (66 loc) · 1.64 KB
/
StackTest.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Operations:
1. Push
2. Pop
3. Peek
4. Is empty
5. Display
6. Exit
Test case-1 (Test case for push)
size of stack - 4
choice- 1
input- 10
choice- 1
input- 20
choice- 1
input- 30
choice- 5
Output:- 30 20 10
------------------------------------------------------------------------------------------------
Test case-2 (Test case for pop)
choice- 1
input- 10
choice- 1
input- 20
choice- 1
input- 30
choice- 2
choice- 2
choice- 5
Output:- 10
------------------------------------------------------------------------------------------------
Test case-3 (Test case for Top elements)
choice- 1
input- 10
choice- 1
input- 20
choice- 1
input- 30
choice- 3
Output:- Top element is 30
------------------------------------------------------------------------------------------------
Test case-4 (Test case to check Empty Stack)
choice- 4
Output:- Stack is Empty
choice- 1
input- 10
choice- 4
Output:- Stack is not Empty
------------------------------------------------------------------------------------------------
Test case-5 (Test case for Display Stack)
choice- 1
input- 10
choice- 1
input- 20
choice- 1
input- 30
choice- 5
Output:- 30 20 10
------------------------------------------------------------------------------------------------
Test case-6 (Test case for Invalid user choice from Menu)
choice- 7
Output:- Invalid choice
------------------------------------------------------------------------------------------------
Test case-7 (Test case for invalid input type)
input - hi
Output:-
java.util.InputMismatchException