Reputation: 4753
I am working on an asp.net mvc application.
I am using Repository pattern . I was unsure of how to test the controller methods that makes add/edit/delete operations.
How ever , i am mocking the database dependencies by using moq library.
Please suggest how to test the above operations.
Note : here , the delete operation is not actual delete , but it is soft delete , which means that , the status of the entity will be made be 0 from 1
Upvotes: 0
Views: 893
Reputation: 11717
It all depends on what you want to test:
Your question suggests that the first proposal might be nearer to what you intend. However, it is not totally clear to me (e.g. whether a DELETE operation is hard or soft would be irrelevant if you're mocking the repository...).
Upvotes: 1