34 lines
754 B
C#
34 lines
754 B
C#
using Bunny.Common.Utils.Jwt;
|
|
using Bunny.Dao.Dto.Email;
|
|
using NUnit.Framework;
|
|
|
|
namespace Bunny.Test.Until.Jwt;
|
|
|
|
[TestFixture]
|
|
public class JwtConvertTest
|
|
{
|
|
[SetUp]
|
|
public void Initialize()
|
|
{
|
|
var emailUsersDto = new EmailUsersDto
|
|
{
|
|
Body = "test@example.com",
|
|
Subject = "苏北",
|
|
TemplateName = "test@example.com",
|
|
Type = "邮件类型"
|
|
};
|
|
_emailUsersDto = emailUsersDto;
|
|
}
|
|
|
|
private EmailUsersDto? _emailUsersDto;
|
|
|
|
[Test]
|
|
public void CreateJClaimByEmail()
|
|
{
|
|
var claims = JwtUtil.CreateClaim(_emailUsersDto!);
|
|
Console.WriteLine(claims);
|
|
|
|
var jwt = JwtUtil.GenerateJwt(claims);
|
|
Console.WriteLine(jwt);
|
|
}
|
|
} |