I have a basic understanding of Mocking and fake objects, and passing the fake data for Unit test case methods. But is it possible that we can use actual data return by our repositories instead of creating our own fake data to our Unit test methods.
I am using NUnit for a .Net MVC 5 application. As shown below in sample code line :
mockType.Setup(x=>x.GetUserDetails().Returns(
new UserDetail(){ id = 1 , name = "John"}
);
So I need to return the actual data return from method GetUserDetails, instead to create the fake data (as we did in above example).
I need to get the user details from DB table instead of creating fake UserDetail as we did in above example. Please give your advice and let me know if you need more information.
Thanks in advance.