Unit Testing in AngularJS: Services, Controllers & Providers

expect(mockModalSvc.showModalDialog).toHaveBeenCalled();
expect(mockModalSvc.showModalDialog).toHaveBeenCalledWith({
message: message,
title: title
});

How mockModalSvc.showModalDialog should have been called with parameters if the previous assert has failed? You do not need to use hasBeenCalled followed by hasBeenCalledWith. Simply use hasBeenCalledWith: if the spyed method was never used, it would fail. If it was cold without provided arguments, it would fail.