File tree 3 files changed +7
-7
lines changed
1-js/04-object-basics/06-constructor-new
2-calculator-constructor/_js.view
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -11,16 +11,16 @@ describe("calculator", function() {
11
11
calculator . read ( ) ;
12
12
} ) ;
13
13
14
- it ( "the read method asks for two values using prompt and remembers them in object properties " , function ( ) {
14
+ it ( "o método read solicita por 2 valores usando o prompt e os guarda em propriedades do objeto " , function ( ) {
15
15
assert . equal ( calculator . a , 2 ) ;
16
16
assert . equal ( calculator . b , 3 ) ;
17
17
} ) ;
18
18
19
- it ( "when 2 and 3 are entered, the sum is 5" , function ( ) {
19
+ it ( "quando 2 e 3 são inseridos, a soma é 5" , function ( ) {
20
20
assert . equal ( calculator . sum ( ) , 5 ) ;
21
21
} ) ;
22
22
23
- it ( "when 2 and 3 are entered, the product is 6" , function ( ) {
23
+ it ( "quando 2 e 3 são inseridos, o produto é 6" , function ( ) {
24
24
assert . equal ( calculator . mul ( ) , 6 ) ;
25
25
} ) ;
26
26
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ function Accumulator(startingValue) {
2
2
this . value = startingValue ;
3
3
4
4
this . read = function ( ) {
5
- this . value += + prompt ( 'How much to add ?' , 0 ) ;
5
+ this . value += + prompt ( 'Quanto adicionar ?' , 0 ) ;
6
6
} ;
7
7
8
8
}
Original file line number Diff line number Diff line change @@ -8,20 +8,20 @@ describe("Accumulator", function() {
8
8
prompt . restore ( ) ;
9
9
} ) ;
10
10
11
- it ( "initial value is the argument of the constructor " , function ( ) {
11
+ it ( "o valor inicial é o argumento do construtor " , function ( ) {
12
12
let accumulator = new Accumulator ( 1 ) ;
13
13
14
14
assert . equal ( accumulator . value , 1 ) ;
15
15
} ) ;
16
16
17
- it ( "after reading 0, the value is 1" , function ( ) {
17
+ it ( "após ler 0, o valor é 1" , function ( ) {
18
18
let accumulator = new Accumulator ( 1 ) ;
19
19
prompt . returns ( "0" ) ;
20
20
accumulator . read ( ) ;
21
21
assert . equal ( accumulator . value , 1 ) ;
22
22
} ) ;
23
23
24
- it ( "after reading 1, the value is 2" , function ( ) {
24
+ it ( "após ler 1, o valor é 2" , function ( ) {
25
25
let accumulator = new Accumulator ( 1 ) ;
26
26
prompt . returns ( "1" ) ;
27
27
accumulator . read ( ) ;
You can’t perform that action at this time.
0 commit comments