How can I unit-test my REST web service?
https://softwareengineering.stackexchange.com/questions/191997
-
06-11-2019 - |
Pregunta
I am new to unit testing, I've one REST web method that just calls DB and populates a DTO. Pseudo code is
public object GetCustomer(int id)
{
CustomerDTO objCust = //get from DB
return objCust;
}
My doubt is how to write tests for these methods and type of tests (Integration/Unit) to be included. And for unit tests, does it need to hit the DB. If it were and I pass a customer id and do few assertions, the data might change eventually resulting in failures.
I think I am missing something here understanding these concepts.
No hay solución correcta
Licenciado bajo: CC-BY-SA con atribución
No afiliado a softwareengineering.stackexchange