Skip to content

Commit c016ce4

Browse files
authored
Created some add/remove test cases
Created test cases for add and remove
1 parent 09a222d commit c016ce4

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

src/_DataStructures_/Set/setTest.js

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
const letters = require('./index');
2+
3+
describe('Data Structure : Set', () => {
4+
5+
6+
it('X Set should be a Class', () => {
7+
expect(typeof XSet.prototype.constructor).toEqual('function');
8+
});
9+
10+
describe('Creation of Set', () => {
11+
12+
it('Should create a new Set with no elements', () => {
13+
letters = new XSet();
14+
expect(letters === 0);
15+
});
16+
17+
it('Should add letter A', () => {
18+
letters.add('a');
19+
expect(letters.has('a');
20+
});
21+
22+
it('Should add letter B', () => {
23+
letters.add('b');
24+
expect(letters.has('b');
25+
});
26+
27+
it('Should add letter C', () => {
28+
letters.add('c');
29+
expect(letters.has('c');
30+
});
31+
32+
it('Should remove letter A', () => {
33+
letters.remove('a');
34+
expect(!letters.has('a');
35+
});
36+
37+
it('Should remove letter B', () => {
38+
letters.remove('b');
39+
expect(!letters.has('b');
40+
});
41+
42+
43+
});

0 commit comments

Comments
 (0)