private IHealthCheckResult RunHealthCheck(bool isRunning) { IServiceStateInquisitor serviceStateInquisitor = m_MockRepository.StrictMock <IServiceStateInquisitor>(); IHealthCheck healthCheck = FeatureStoreServiceStateHealthCheck.Create(serviceStateInquisitor); using (m_MockRepository.Record()) { Expect.Call(serviceStateInquisitor.ServiceIsRunning()).Return(isRunning); m_MockRepository.ReplayAll(); } return(healthCheck.Execute()); }
public void ServiceIsNotInstalled() { IServiceStateInquisitor serviceStateInquisitor = m_MockRepository.StrictMock <IServiceStateInquisitor>(); IHealthCheck healthCheck = FeatureStoreServiceStateHealthCheck.Create(serviceStateInquisitor); using (m_MockRepository.Record()) { Expect.Call(serviceStateInquisitor.ServiceIsRunning()).Throw(new ServiceNotInstalledException()); m_MockRepository.ReplayAll(); } IHealthCheckResult result = healthCheck.Execute(); Assert.IsFalse(result.Passed); StringAssert.Contains(result.Message, "The Feature Store service is not installed."); }
/// <summary> /// Creates the specified service state inquisitor. /// </summary> /// <param name = "serviceStateInquisitor">The service state inquisitor.</param> /// <returns>An initialzed instance of the FeatureStoreServiceStateHealthCheck class as an <see cref = "IHealthCheck" />.</returns> public static IHealthCheck Create(IServiceStateInquisitor serviceStateInquisitor) { return(new FeatureStoreServiceStateHealthCheck(serviceStateInquisitor)); }
/// <summary> /// Initializes a new instance of the <see cref = "FeatureStoreServiceStateHealthCheck" /> class. /// </summary> /// <param name = "serviceStateInquisitor">The service state inquisitor.</param> private FeatureStoreServiceStateHealthCheck(IServiceStateInquisitor serviceStateInquisitor) { m_ServiceStateInquisitor = serviceStateInquisitor; }