WYB
2021-03-22 91b8cdad021ab052e4991f3d41834a6f0ddc36b8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using JiepeiWMS.Controllers;
using JiepeiWMS.IServices;
using Xunit;
using Autofac;
using JiepeiWMS.AuthHelper;
 
namespace JiepeiWMS.Tests
{
    public class LoginController_Should
    {
        LoginController loginController;
 
        private readonly ISysUserInfoServices _sysUserInfoServices;
        private readonly IUserRoleServices _userRoleServices;
        private readonly IRoleServices _roleServices;
        private readonly PermissionRequirement _requirement;
        private readonly IRoleModulePermissionServices _roleModulePermissionServices;
        private readonly ISmsLogServices _smsLogServices;
 
        DI_Test dI_Test = new DI_Test();
 
 
 
        public LoginController_Should()
        {
            var container = dI_Test.DICollections();
            _sysUserInfoServices = container.Resolve<ISysUserInfoServices>();
            _userRoleServices = container.Resolve<IUserRoleServices>();
            _roleServices = container.Resolve<IRoleServices>();
            _requirement = container.Resolve<PermissionRequirement>();
            _roleModulePermissionServices = container.Resolve<IRoleModulePermissionServices>();
            _smsLogServices = container.Resolve<ISmsLogServices>();
            loginController = new LoginController(_sysUserInfoServices, _userRoleServices, _roleServices, _requirement, _roleModulePermissionServices, _smsLogServices);
        }
 
        [Fact]
        public void GetJwtStrTest()
        {
            var data = loginController.GetJwtStr("test", "test");
 
            Assert.NotNull(data);
        }
        [Fact]
        public void GetJwtStrForNuxtTest()
        {
            object blogs = loginController.GetJwtStrForNuxt("test", "test");
 
            Assert.NotNull(blogs);
        }
 
        [Fact]
        public async void GetJwtToken3Test()
        {
 
            var res = await loginController.GetJwtToken3("test", "test");
 
            Assert.NotNull(res);
        }
 
        [Fact]
        public async void RefreshTokenTest()
        {
            var res = await loginController.RefreshToken("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoidGVzdCIsImp0aSI6IjgiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL2V4cGlyYXRpb24iOiIyMDE5LzEwLzE4IDIzOjI2OjQ5IiwiaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS93cy8yMDA4LzA2L2lkZW50aXR5L2NsYWltcy9yb2xlIjoiQWRtaW5UZXN0IiwibmJmIjoxNTcxNDA4ODA5LCJleHAiOjE1NzE0MTI0MDksImlzcyI6IkJsb2cuQ29yZSIsImF1ZCI6IndyIn0.oz-SPz6UCL78fM09bUecw5rmjcNYEY9dWGtuPs2gdBg");
 
            Assert.NotNull(res);
        }
 
        [Fact]
        public void Md5PasswordTest()
        {
            var res = loginController.Md5Password("test");
 
            Assert.NotNull(res);
        }
    }
}