@@ -28,17 +28,17 @@ describe ( 'workers/stats.js', function ( ) {
2828 mount : 0 ,
2929 critchance : 5
3030 } , {
31- attack : 1 ,
31+ attack : 1000 ,
3232 defense : 1 ,
3333 perception : 1 ,
34- level : 1 ,
35- stats : 0
34+ stats : 1 ,
35+ level : 1
3636 }
3737 ]
3838 ] . forEach ( function ( set ) {
39- /* it ('Case '+JSON.stringify(set[0])+' should return '+JSON.stringify(set[1]), function() {
40- idrinth.work(set[0]).should.be.equal.to (set[1]);
41- });*/
39+ it ( 'Case ' + JSON . stringify ( set [ 0 ] ) + ' should return ' + JSON . stringify ( set [ 1 ] ) , function ( ) {
40+ idrinth . work ( set [ 0 ] ) . should . be . deep . equal ( set [ 1 ] ) ;
41+ } ) ;
4242 } ) ;
4343 } ) ;
4444 } ) ;
@@ -49,11 +49,25 @@ describe ( 'workers/stats.js', function ( ) {
4949 describe ( 'idrinth.PremiumSet' , function ( ) {
5050 it ( 'PremiumSet should be a function' , function ( ) {
5151 idrinth . PremiumSet . should . be . a ( 'function' ) ;
52- describe ( 'idrinth.PremiumSet#Instance ' , function ( ) {
53- var premium = new idrinth . PremiumSet ( ) ;
52+ describe ( 'idrinth.PremiumSet() ' , function ( ) {
53+ var premium = new idrinth . PremiumSet ( 'u' , 'm' , 'k' ) ;
5454 it ( 'PremiumSet should return an object' , function ( ) {
5555 should . exist ( premium ) ;
5656 premium . should . be . an ( 'object' ) ;
57+ describe ( 'idrinth.PremiumSet#Instance' , function ( ) {
58+ it ( 'PremiumSet should have a mirele property' , function ( ) {
59+ expect ( premium ) . to . have . property ( 'mirele' ) ;
60+ premium . mirele . should . be . equal ( 'm' ) ;
61+ } ) ;
62+ it ( 'PremiumSet should have a utym property' , function ( ) {
63+ expect ( premium ) . to . have . property ( 'utym' ) ;
64+ premium . utym . should . be . equal ( 'u' ) ;
65+ } ) ;
66+ it ( 'PremiumSet should have a kraken property' , function ( ) {
67+ expect ( premium ) . to . have . property ( 'kraken' ) ;
68+ premium . kraken . should . be . equal ( 'k' ) ;
69+ } ) ;
70+ } ) ;
5771 } ) ;
5872 } ) ;
5973 } ) ;
@@ -64,11 +78,25 @@ describe ( 'workers/stats.js', function ( ) {
6478 describe ( 'idrinth.MultiplierSet' , function ( ) {
6579 it ( 'MultiplierSet should be a function' , function ( ) {
6680 idrinth . MultiplierSet . should . be . a ( 'function' ) ;
67- describe ( 'idrinth.MultiplierSet#Instance ' , function ( ) {
68- var multiplier = new idrinth . MultiplierSet ( ) ;
81+ describe ( 'idrinth.MultiplierSet() ' , function ( ) {
82+ var multiplier = new idrinth . MultiplierSet ( 'l' , 'm' , 'c' ) ;
6983 it ( 'MultiplierSet should return an object' , function ( ) {
7084 should . exist ( multiplier ) ;
7185 multiplier . should . be . an ( 'object' ) ;
86+ describe ( 'idrinth.MultiplierSet#Instance' , function ( ) {
87+ it ( 'MultiplierSet should have a mount property' , function ( ) {
88+ expect ( multiplier ) . to . have . property ( 'mount' ) ;
89+ multiplier . mount . should . be . equal ( 'm' ) ;
90+ } ) ;
91+ it ( 'MultiplierSet should have a critchance property' , function ( ) {
92+ expect ( multiplier ) . to . have . property ( 'critchance' ) ;
93+ multiplier . critchance . should . be . equal ( 'c' ) ;
94+ } ) ;
95+ it ( 'MultiplierSet should have a legion property' , function ( ) {
96+ expect ( multiplier ) . to . have . property ( 'legion' ) ;
97+ multiplier . legion . should . be . equal ( 'l' ) ;
98+ } ) ;
99+ } ) ;
72100 } ) ;
73101 } ) ;
74102 } ) ;
@@ -79,11 +107,41 @@ describe ( 'workers/stats.js', function ( ) {
79107 describe ( 'idrinth.StatSet' , function ( ) {
80108 it ( 'StatSet should be a function' , function ( ) {
81109 idrinth . StatSet . should . be . a ( 'function' ) ;
82- describe ( 'idrinth.StatSet#Instance ' , function ( ) {
83- var stat = new idrinth . StatSet ( ) ;
110+ describe ( 'idrinth.StatSet() ' , function ( ) {
111+ var stat = new idrinth . StatSet ( 'a' , 'd' , 'p' , 'l' , 's' ) ;
84112 it ( 'StatSet should return an object' , function ( ) {
85113 should . exist ( stat ) ;
86114 stat . should . be . an ( 'object' ) ;
115+ describe ( 'idrinth.StatSet#Instance' , function ( ) {
116+ it ( 'StatSet should have an attack property' , function ( ) {
117+ expect ( stat ) . to . have . property ( 'attack' ) ;
118+ stat . attack . should . be . equal ( 'a' ) ;
119+ } ) ;
120+ it ( 'StatSet should have an defense property' , function ( ) {
121+ expect ( stat ) . to . have . property ( 'defense' ) ;
122+ stat . defense . should . be . equal ( 'd' ) ;
123+ } ) ;
124+ it ( 'StatSet should have an perception property' , function ( ) {
125+ expect ( stat ) . to . have . property ( 'perception' ) ;
126+ stat . perception . should . be . equal ( 'p' ) ;
127+ } ) ;
128+ it ( 'StatSet should have an level property' , function ( ) {
129+ expect ( stat ) . to . have . property ( 'level' ) ;
130+ stat . level . should . be . equal ( 'l' ) ;
131+ } ) ;
132+ it ( 'StatSet should have an stats property' , function ( ) {
133+ expect ( stat ) . to . have . property ( 'stats' ) ;
134+ stat . stats . should . be . equal ( 's' ) ;
135+ } ) ;
136+ it ( 'StatSet should have an increase property' , function ( ) {
137+ expect ( stat ) . to . have . property ( 'increase' ) ;
138+ // @todo test
139+ } ) ;
140+ it ( 'StatSet should have an getCost property' , function ( ) {
141+ expect ( stat ) . to . have . property ( 'getCost' ) ;
142+ // @todo test
143+ } ) ;
144+ } ) ;
87145 } ) ;
88146 } ) ;
89147 } ) ;
@@ -94,11 +152,26 @@ describe ( 'workers/stats.js', function ( ) {
94152 describe ( 'idrinth.Calculator' , function ( ) {
95153 it ( 'Calculator should be a function' , function ( ) {
96154 idrinth . Calculator . should . be . a ( 'function' ) ;
97- describe ( 'idrinth.Calculator#Instance ' , function ( ) {
98- var calculator = new idrinth . Calculator ( ) ;
155+ describe ( 'idrinth.Calculator() ' , function ( ) {
156+ var calculator = new idrinth . Calculator ( 'stat' , 'premium' , 'multiplier' ) ;
99157 it ( 'Calculator should return an object' , function ( ) {
100158 should . exist ( calculator ) ;
101159 calculator . should . be . an ( 'object' ) ;
160+ describe ( 'idrinth.Calculator#Instance' , function ( ) {
161+ it ( 'Calculator should have an stat property' , function ( ) {
162+ expect ( calculator ) . to . have . property ( 'stat' ) ;
163+ calculator . stat . should . be . equal ( 'stat' ) ;
164+ } ) ;
165+ it ( 'Calculator should have an premium property' , function ( ) {
166+ expect ( calculator ) . to . have . property ( 'premium' ) ;
167+ calculator . premium . should . be . equal ( 'premium' ) ;
168+ } ) ;
169+ it ( 'Calculator should have an multiplier property' , function ( ) {
170+ expect ( calculator ) . to . have . property ( 'multiplier' ) ;
171+ calculator . multiplier . should . be . equal ( 'multiplier' ) ;
172+ } ) ;
173+ //@todo method tests
174+ } ) ;
102175 } ) ;
103176 } ) ;
104177 } ) ;
0 commit comments