File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
src/moving-to-a-shared-object/account-type Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1
1
export class AccountType {
2
- constructor ( nameString ) {
2
+ constructor ( nameString , interestRate ) {
3
3
this . _name = nameString ;
4
+ this . _interestRate = interestRate ;
4
5
}
5
6
6
7
get name ( ) {
7
8
return this . _name ;
8
9
}
10
+
11
+ get interestRate ( ) {
12
+ return this . _interestRate ;
13
+ }
9
14
}
Original file line number Diff line number Diff line change @@ -2,7 +2,12 @@ import { AccountType } from '.';
2
2
3
3
describe ( 'AccountType' , ( ) => {
4
4
it ( 'should have a name' , ( ) => {
5
- const type = new AccountType ( 'normal' ) ;
5
+ const type = new AccountType ( 'normal' , 0.1 ) ;
6
6
expect ( type . name ) . toEqual ( 'normal' ) ;
7
7
} ) ;
8
+
9
+ it ( 'should have an interestRate' , ( ) => {
10
+ const type = new AccountType ( 'normal' , 0.1 ) ;
11
+ expect ( type . interestRate ) . toEqual ( 0.1 ) ;
12
+ } ) ;
8
13
} ) ;
You can’t perform that action at this time.
0 commit comments