Пример #1
0
 public void Restore_counter_http_web_app_on_server_restart()
 {
     using (var testSetup = WebHostTestSetup.Setup(CounterWebApp))
     {
         var eventsAndExpectedResponses =
             TestSetup.CounterProcessTestEventsAndExpectedResponses(
                 new (int addition, int expectedResponse)[]
Пример #2
0
        static public WebHostTestSetup Setup(
            WebAppConfiguration webAppConfig,
            Func <IWebHostBuilder, IWebHostBuilder> webHostBuilderMap)
        {
            var testDirectory = Filesystem.CreateRandomDirectoryInTempDirectory();

            var setup = new WebHostTestSetup(testDirectory, webHostBuilderMap);

            var webAppConfigFilePath = setup.WebAppConfigFilePath;

            Directory.CreateDirectory(Path.GetDirectoryName(webAppConfigFilePath));

            File.WriteAllBytes(webAppConfigFilePath, ZipArchive.ZipArchiveFromEntries(webAppConfig.AsFiles()));

            return(setup);
        }