diff options
author | 杨宇千 <crupest@outlook.com> | 2019-08-08 16:54:03 +0800 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-08-08 16:54:03 +0800 |
commit | d018e1c318646c6d7fecc8d3824129e9f1d5cf6c (patch) | |
tree | da11e395a3fd1340187fb785fc17e570171b942b /Timeline.Tests/Helpers/MyWebApplicationFactory.cs | |
parent | dc1ab11cea249f4ca967f86b115147a63f7c93a5 (diff) | |
parent | e283a3e745bad05a55c572646d7b20fbaaeb522d (diff) | |
download | timeline-d018e1c318646c6d7fecc8d3824129e9f1d5cf6c.tar.gz timeline-d018e1c318646c6d7fecc8d3824129e9f1d5cf6c.tar.bz2 timeline-d018e1c318646c6d7fecc8d3824129e9f1d5cf6c.zip |
Merge branch 'master' into null-request-field
Diffstat (limited to 'Timeline.Tests/Helpers/MyWebApplicationFactory.cs')
-rw-r--r-- | Timeline.Tests/Helpers/MyWebApplicationFactory.cs | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/Timeline.Tests/Helpers/MyWebApplicationFactory.cs b/Timeline.Tests/Helpers/MyWebApplicationFactory.cs index ef207fd2..d8da7168 100644 --- a/Timeline.Tests/Helpers/MyWebApplicationFactory.cs +++ b/Timeline.Tests/Helpers/MyWebApplicationFactory.cs @@ -1,16 +1,16 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Mvc.Testing; +using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.AspNetCore.TestHost;
using Microsoft.Data.Sqlite;
-using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Timeline.Entities; +using Microsoft.EntityFrameworkCore;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Logging;
+using Timeline.Entities;
using Timeline.Services;
-using Xunit.Abstractions; - -namespace Timeline.Tests.Helpers -{ +using Xunit.Abstractions;
+
+namespace Timeline.Tests.Helpers
+{
public class MyWebApplicationFactory<TStartup> : WebApplicationFactory<TStartup> where TStartup : class
{
// We should keep the connection, so the database is persisted but not recreate every time.
@@ -65,19 +65,19 @@ namespace Timeline.Tests.Helpers base.Dispose(disposing);
}
- } - - public static class WebApplicationFactoryExtensions - { - public static WebApplicationFactory<TEntry> WithTestLogging<TEntry>(this WebApplicationFactory<TEntry> factory, ITestOutputHelper outputHelper) where TEntry : class - { - return factory.WithWebHostBuilder(builder => - { + }
+
+ public static class WebApplicationFactoryExtensions
+ {
+ public static WebApplicationFactory<TEntry> WithTestLogging<TEntry>(this WebApplicationFactory<TEntry> factory, ITestOutputHelper outputHelper) where TEntry : class
+ {
+ return factory.WithWebHostBuilder(builder =>
+ {
builder.ConfigureLogging(logging =>
{
logging.AddXunit(outputHelper);
- }); - }); - } - } -} + });
+ });
+ }
+ }
+}
|