aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/Helpers/TestApplication.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-02-21 15:10:37 +0800
committercrupest <crupest@outlook.com>2020-02-21 15:10:37 +0800
commit1d5d0c85e24fe9f30d587dc714f1cd7a233c8073 (patch)
tree57a8579bc8b6d2be2831c8e55d5b5b0f552def35 /Timeline.Tests/Helpers/TestApplication.cs
parent6cf3c7891fe8a810b20bb799db9f3fb97414c4de (diff)
downloadtimeline-1d5d0c85e24fe9f30d587dc714f1cd7a233c8073.tar.gz
timeline-1d5d0c85e24fe9f30d587dc714f1cd7a233c8073.tar.bz2
timeline-1d5d0c85e24fe9f30d587dc714f1cd7a233c8073.zip
Move jwt token key from configuration to database and auto generatable.
Diffstat (limited to 'Timeline.Tests/Helpers/TestApplication.cs')
-rw-r--r--Timeline.Tests/Helpers/TestApplication.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Timeline.Tests/Helpers/TestApplication.cs b/Timeline.Tests/Helpers/TestApplication.cs
index 5fbc2fb0..52c2f2e2 100644
--- a/Timeline.Tests/Helpers/TestApplication.cs
+++ b/Timeline.Tests/Helpers/TestApplication.cs
@@ -7,6 +7,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using Timeline.Entities;
+using Timeline.Migrations;
namespace Timeline.Tests.Helpers
{
@@ -33,6 +34,11 @@ namespace Timeline.Tests.Helpers
using (var context = new DatabaseContext(options))
{
context.Database.EnsureCreated();
+ context.JwtToken.Add(new JwtTokenEntity
+ {
+ Key = JwtTokenGenerateHelper.GenerateKey()
+ });
+ context.SaveChanges();
}
Factory = factory.WithWebHostBuilder(builder =>