OpenAuth.Net/OpenAuth.UnitTest/TestAuthen.cs

30 lines
761 B
C#
Raw Normal View History

2016-05-26 10:30:15 +08:00
using System;
2017-10-11 16:19:34 +08:00
using System.Diagnostics;
using System.Linq;
using Infrastructure;
2016-05-26 10:30:15 +08:00
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenAuth.Domain.Service;
using OpenAuth.Repository;
namespace OpenAuth.UnitTest
{
/// <summary>
/// 测试用户授权服务
/// </summary>
[TestClass]
public class TestAuthen
{
[TestMethod]
public void TestMethod1()
{
AuthoriseFactory factory = new AuthoriseFactory( );
2016-10-17 00:20:55 +08:00
var service= factory.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
}
}
}