OpenAuth.Net/OpenAuth.UnitTest/TestAuthen.cs

34 lines
792 B
C#
Raw Normal View History

2017-11-29 10:35:25 +08:00
using System.Diagnostics;
2017-10-11 16:19:34 +08:00
using System.Linq;
using Infrastructure;
2016-05-26 10:30:15 +08:00
using Microsoft.VisualStudio.TestTools.UnitTesting;
2017-11-29 00:48:51 +08:00
using OpenAuth.App;
2016-05-26 10:30:15 +08:00
namespace OpenAuth.UnitTest
{
/// <summary>
/// 测试用户授权服务
/// </summary>
[TestClass]
2017-11-29 00:48:51 +08:00
public class TestAuthen :TestBase
2016-05-26 10:30:15 +08:00
{
2017-11-29 00:48:51 +08:00
private AuthorizeApp app;
public TestAuthen()
{
app = AutofacExt.GetFromFac<AuthorizeApp>();
}
2016-05-26 10:30:15 +08:00
[TestMethod]
public void TestMethod1()
{
2017-11-29 00:48:51 +08:00
var service= app.Create("System");
2016-05-26 10:30:15 +08:00
2017-10-11 16:19:34 +08:00
var modules = service.Modules;
var moduleTree = modules.GenerateTree(u => u.Id, u => u.ParentId).ToList();
Debug.WriteLine(JsonHelper.Instance.Serialize(moduleTree));
2016-05-26 10:30:15 +08:00
}
}
}