diff options
author | 杨宇千 <crupest@outlook.com> | 2019-08-04 15:46:31 +0800 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-08-04 15:46:31 +0800 |
commit | 7f7fdd4d3d72980d575f7e27cea4a2d11c8482a8 (patch) | |
tree | deace7e60ff91362572bf178004f3928175a340e /Timeline.Tests/Helpers/WebApplicationFactoryExtensions.cs | |
parent | 05f10e61506c4c9200a863d3f060a480d897f4d4 (diff) | |
download | timeline-7f7fdd4d3d72980d575f7e27cea4a2d11c8482a8.tar.gz timeline-7f7fdd4d3d72980d575f7e27cea4a2d11c8482a8.tar.bz2 timeline-7f7fdd4d3d72980d575f7e27cea4a2d11c8482a8.zip |
Continue to add unit tests for token. Fix a bug thanks to unit test.
Diffstat (limited to 'Timeline.Tests/Helpers/WebApplicationFactoryExtensions.cs')
-rw-r--r-- | Timeline.Tests/Helpers/WebApplicationFactoryExtensions.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Timeline.Tests/Helpers/WebApplicationFactoryExtensions.cs b/Timeline.Tests/Helpers/WebApplicationFactoryExtensions.cs index a7616b41..aa005ba3 100644 --- a/Timeline.Tests/Helpers/WebApplicationFactoryExtensions.cs +++ b/Timeline.Tests/Helpers/WebApplicationFactoryExtensions.cs @@ -1,9 +1,11 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc.Testing; +using Microsoft.AspNetCore.TestHost; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Timeline.Models; +using Timeline.Services; using Xunit.Abstractions; namespace Timeline.Tests.Helpers @@ -46,6 +48,10 @@ namespace Timeline.Tests.Helpers db.Users.AddRange(TestMockUsers.MockUsers); db.SaveChanges(); } + }) + .ConfigureTestServices(services => + { + services.AddSingleton<IClock, TestClock>(); }); }); } |