質問

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.

正しい解決策はありません

ライセンス: CC-BY-SA帰属
所属していません softwareengineering.stackexchange
scroll top