aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/Helpers/WebApplicationFactoryExtensions.cs
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-08-04 15:46:31 +0800
committer杨宇千 <crupest@outlook.com>2019-08-04 15:46:31 +0800
commit36da221444807742a9e26f2ba636d9c6aef6155f (patch)
treedeace7e60ff91362572bf178004f3928175a340e /Timeline.Tests/Helpers/WebApplicationFactoryExtensions.cs
parenta17aa8770b0b4861849c6e01812b2ff686497f02 (diff)
downloadtimeline-36da221444807742a9e26f2ba636d9c6aef6155f.tar.gz
timeline-36da221444807742a9e26f2ba636d9c6aef6155f.tar.bz2
timeline-36da221444807742a9e26f2ba636d9c6aef6155f.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.cs6
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>();
});
});
}