コード例 #1
0
        public void When_not_running_in_http_DeriveAppDataPath_should_throw()
        {
            var exception = Assert.Throws <Exception>(() => DefaultFactory.DeriveAppDataPath());

            Assert.AreEqual("Detected running in a website and attempted to use HostingEnvironment.MapPath(\"~/App_Data/\") to derive the logging path. Failed since MapPath returned null. To avoid using HostingEnvironment.MapPath to derive the logging directory you can instead configure it to a specific path using LogManager.Use<DefaultFactory>().Directory(\"pathToLoggingDirectory\");", exception.Message);
        }