コード例 #1
0
        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());
        }
コード例 #2
0
        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.");
        }
コード例 #3
0
 /// <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));
 }
コード例 #4
0
 /// <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;
 }