Exemplo n.º 1
0
        /// <summary>
        ///   Creates the specified resolver.
        /// </summary>
        /// <param name = "resolver">The resolver.</param>
        /// <returns>An initialized instance of the Log4NetConfigurationHealthCheck class as an <see cref = "IHealthCheck" />.</returns>
        public static IHealthCheck Create(ILog4NetConfigurationResolver resolver)
        {
            XPathDocument  document  = resolver.LoadConfiguration();
            XPathNavigator navigator = document.CreateNavigator();

            return(new Log4NetConfigurationHealthCheck(navigator));
        }
Exemplo n.º 2
0
        private IHealthCheckResult GetHealthCheckResult(string configResourceName)
        {
            ILog4NetConfigurationResolver resolver = m_MockRepository.StrictMock <ILog4NetConfigurationResolver>();
            Assembly      assembly = Assembly.GetExecutingAssembly();
            Stream        stream   = assembly.GetManifestResourceStream(configResourceName);
            XPathDocument document = new XPathDocument(stream);

            using (m_MockRepository.Record())
            {
                Expect.Call(resolver.LoadConfiguration()).Return(document);
                m_MockRepository.ReplayAll();
            }

            IHealthCheck healthCheck = Log4NetConfigurationHealthCheck.Create(resolver);

            return(healthCheck.Execute());
        }