209 похожих чатов

Привет. вкатываюсь в тестирование, тестирую сервис и не могу решить,

стоит ли проверять значения параметров которые передаются в замоканный метод репозитория, или достаточно проверить его вызов?

2 ответов

13 просмотров

Тестируя сервис ты тестируешь его методы) если юнит - мокай подключение к бд, если оно есть, ты и так знаешь что должна вернуть тебе бд, через сервис ты проверяешь, делает ли он то что должен) Иногда можно следить за вызовом методов и проверять какие данные передаются в метод, я всегда так делаю. В итоге я проверяю и что на вход в методы приходят верные данные и на выходе получаю то, что ожидаю. Обычно я просто делаю мок бд и реализую свой репозиторий, затем просто подменяю вызов репозитория на мой и он манипулирует с моковыми данными

Похожие вопросы

Обсуждают сегодня

We heading to 1.1$ 🤔?
CryptoBo$$
35
Ideally, when we launch a game from a particular studio, that studio should have the right to access the uniqs from their game on our wallet. For example, if you die in a Ubis...
Lisandru
16
A couple thoughts from a random internet stranger: 1. If you want this project to gain traction you cannot keep being negative. If I just came here after finding out about Kd...
Eric Wild
46
Who understand exactly the uniqd in game ? Does it mean that transactions are auto signed inside the game without interruption? If yes , then how can ultra retrieve elements...
Zaa
15
i justHey. Im holding kadena almost 3 years now. Its my only investment what isn't in profit. But i thought for years that its just need some more time but i haven't seen that...
Riki
7
So, did you guys catch the latest AMA with David from FunToken?
Noah Noure
15
remote nodes with vpn or tor still safe ? (or they can collect other information like amount, receiving/sending adress, .. ?)
Tchoupi
12
How Will #Monero Be Attacked? First of all I want to tell you that this is not teaching the network attackers, the central regulators. They already know how to attack the net...
Li₿ΞʁLiøη
3
But what if some projects may have no sense financially but important from public relations point of view and overall adoption (which leads to more investors so more income). ...
Katu
3
Can you help a noob? I know LTC was one of the early alt coins. But what is the benefit of it today? What are its attributes? Why should I be bullish on it this bull run?
CryptoNoobian ($PEPI)
14
Карта сайта