public void ShouldSendFailureIfCheckServiceThrows() { _goodCheckService.When(call => call.Check(Arg.Any <Endpoint>())) .Throw(new Exception("ERRORMSG")); _service.ProcessEndpoint(_validEndpoint, 0); _stateService.Received().AddEndpointCheckResult(_validEndpoint.Id, Arg.Is <EndpointCheckResult>(r => r.Error.Message == "Unexpected check failure: ERRORMSG"), true); }