-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Semana 1 - Ana Carolina Zago #34
base: main
Are you sure you want to change the base?
Conversation
- [X] Fiz o fork do repositório. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sensacional a sua organização! ☑️
this.limite = limite; | ||
} | ||
|
||
// consulta de saldo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
legal que estruturou com comentários os requisitos do exercício, ajuda muito a não se perder, né? :)
throw new Error('O valor precisa ser maior que 0') | ||
} | ||
|
||
return this.saldo = valor + this.saldo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aqui acredito que caberia uma pequena refatoração: return this.saldo += valor (que eu mesma também não fiz no meu código mas depois percebi que seria uma boa! 😄 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verdade Melina, eu não sabia dessa, obrigada pela dica!
if(valor <= this.saldo && valor <= this.limite){ | ||
return "Saque realizado com sucesso" | ||
}else if(valor > this.saldo || valor <= this.limite) { | ||
return "Saque realizado com sucesso" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aqui seria bom retornar também o novo valor do saldo, que no caso sendo maior que a quantia disponível, retornaria um valor negativo.
ex: return this.saldo = this.saldo - valor (ou também naquela versão refatorada usando -= valor)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ótima contribuição Melina! Vou fazer isso!!!
// consulta de saque | ||
realizarSaque(valor) { | ||
if(valor <= this.saldo && valor <= this.limite){ | ||
return "Saque realizado com sucesso" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
muito bom ter adicionado uma mensagem de retorno pro usuário :)
}else if(valor > this.saldo || valor <= this.limite) { | ||
return "Saque realizado com sucesso" | ||
}else { | ||
throw new Error('Saque não realizado por falta de saldo ou de limite') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
legal ter usado o throw new Error com mensagem bem explicativa!
expect(contaBancaria.realizarSaque(100)).toEqual('Saque realizado com sucesso') | ||
}) | ||
|
||
test("Realizar saque com valor maior que o saldo e menor que o limte", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gostei que as descrições dos testes estão bem claras! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Muito obrigada pela seu code review @osikmelina !
}) | ||
|
||
test("Não realizar saque pois o valor é maior que o saldo e maior que o limte", () => { | ||
expect(() => contaBancaria.realizarSaque(500)).toThrow('Saque não realizado por falta de saldo ou de limite') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
depois me conta se esse teste deu certo pq eu só consegui testar o erro colocando dentro de uma função aqui no teste, igual a Isa explicou pra gente na aula de revisão 🥲
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Ana também usou uma função @osikmelina mas a dela é uma função anônima () => contaBancaria.realizarSaque(500)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exatamente Isa heheh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esse readme aqui faz parte do repositório da turma como um todo é o mesmo pra todas as alunas, peço para que vc abra um novo PR sem atualizar esse arquivo e bem como os arquivos da pasta para-sala
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isa desculpe, não entendi o que é pra fazer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acabei de ver em baixo que vc comentou para eu subir apenas os arquivos da pasta entregas, como faço isso? Eu não sei subir apenas uma pasta, e sim o projeto todo =/
Oi @anacarolzago sua atividade está entregue, como comentei mais acima mas vou pedir pra você abrir um novo PR apenas com os arquivos da sua pasta |
No description provided.