I have a very simple method that I am trying to test. _interactionService establishes a dialog that asks the user to confirm the removal of the client. If the button is clicked on the corresponding button, the called action is called up. The action controls the context and saves the changes. After the save is complete, another action is called.
private void Delete(object entity)
{
_interactionService.ShowConfirmationBox("Delete?", "Are you sure you want to delete this customer?", () =>
{
Customer customer = entity as Customer;
Context.Attach(customer);
Context.Delete(customer);
Context.Save(() => DoSomethingElseWhenSaveComplete);
});
}
I do not understand how to check this method. I mocked the service and context, but how do I check for a close?
source
share