Mocking a dialog box that takes a callback type as argument
问题 I have created the mock setup for the dialog box of type: void ShowDialog(string windowName, string parentWindowName, Dictionary<string, object> inputFields, Action<Dictionary<string, object>> closeCallBack, Dictionary<string, object> windowProperties = null); like: UIServicemock.Setup(u => u.ShowDialog(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<Dictionary<string, object>>(), It.IsAny<Action<Dictionary<string, object>>>(), It.IsAny<Dictionary<string, object>>())).Callback(ViewName