-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-bamboo.js
93 lines (76 loc) · 3.74 KB
/
test-bamboo.js
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
//test_bamboo.js
var Bamboo = require('./bamboo');
console.log("1. create new Bamboo object with no arguments" +
" should have undefined properties" +
" and null response from getAuth()");
var bamboo = new Bamboo();
console.log("bamboo.url : " + bamboo.url);
console.log("bamboo.username : " + bamboo.username);
console.log("bamboo.password : " + bamboo.password);
console.log("bamboo.getAuth() : " + bamboo.getAuth(bamboo.username, bamboo.password));
console.log("---");
console.log("2. create a new Bamboo object with only url argument" +
" should have url assigned" +
" and undefined username and password " +
" and null response from getAuth()");
var bamboo = new Bamboo("http://test.sencha-test.io:8085/");
console.log("bamboo.url : " + bamboo.url);
console.log("bamboo.username : " + bamboo.username);
console.log("bamboo.password : " + bamboo.password);
console.log("bamboo.getAuth() : " + bamboo.getAuth());
console.log("---");
console.log("3. create a new Bamboo object with url, username, and password arguments" +
" should have all properties assigned" +
" and getAuth() should return base64 encoded username:password");
var bamboo = new Bamboo("http://test.sencha-test.io:8085/", "username", "password");
console.log("bamboo.url : " + bamboo.url);
console.log("bamboo.username : " + bamboo.username);
console.log("bamboo.password : " + bamboo.password);
console.log("bamboo.getAuth() : " + bamboo.getAuth());
console.log("---");
console.log("4. create a new Bamboo object with no arguments" +
" should have undefined properties" +
" and calling getAuth() with username and password arguments" +
" should return base64 encoded username:password");
var bamboo = new Bamboo();
console.log("bamboo.url : " + bamboo.url);
console.log("bamboo.username : " + bamboo.username);
console.log("bamboo.password : " + bamboo.password);
console.log("bamboo.getAuth() : " + bamboo.getAuth("username", "password"));
console.log("---");
console.log("5. create new Bamboo object with no arguments" +
" and set url, username, and password" +
" should have url, username, and password assigned" +
" and getAuth() should return base64 encoded username:password ");
var bamboo = new Bamboo();
bamboo.url = "http://test.sencha-test.io:8085/";
bamboo.username = "username";
bamboo.password = "password";
console.log("bamboo.url : " + bamboo.url);
console.log("bamboo.username : " + bamboo.username);
console.log("bamboo.password : " + bamboo.password);
console.log("bamboo.getAuth() : " + bamboo.getAuth());
console.log("---");
console.log("6. create new Bamboo object with url, usrname, and password arguments" +
" should have properties assigned" +
" and calling getAuth() with different username and password" +
" should return base64 encoded new username:password" +
" and username and password should be assigned the new values");
var bamboo = new Bamboo("http://test.sencha-test.io:8085/", "username", "password");
console.log("bamboo.url : " + bamboo.url);
console.log("bamboo.username : " + bamboo.username);
console.log("bamboo.password : " + bamboo.password);
console.log("bamboo.getAuth() : " + bamboo.getAuth("newusername", "newpassword"));
console.log("bamboo.username : " + bamboo.username);
console.log("bamboo.password : " + bamboo.password);
console.log("---");
console.log("7. create a new Bamboo object with url and username -- no password" +
" should have url and username assigned" +
" but undefined password" +
" and getAuth() should return null");
var bamboo = new Bamboo("http://test.sencha-test.io:8085/", "username");
console.log("bamboo.url : " + bamboo.url);
console.log("bamboo.username : " + bamboo.username);
console.log("bamboo.password : " + bamboo.password);
console.log("bamboo.getAuth() : " + bamboo.getAuth());
console.log("---");