mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-11-08 18:34:44 +08:00
complete login
This commit is contained in:
50
OpenAuth.UnitTest/DbContextTest.cs
Normal file
50
OpenAuth.UnitTest/DbContextTest.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Data.Entity;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using OpenAuth.Infrastructure;
|
||||
|
||||
namespace OpenAuth.UnitTest
|
||||
{
|
||||
[TestClass]
|
||||
public class DbContextTest
|
||||
{
|
||||
[TestMethod]
|
||||
public void TestMethod1()
|
||||
{
|
||||
Display();
|
||||
}
|
||||
|
||||
private void Display()
|
||||
{
|
||||
OpenAuthDBContext context = new OpenAuthDBContext();
|
||||
foreach (var user in context.Users)
|
||||
{
|
||||
Console.WriteLine(user.RealName);
|
||||
}
|
||||
foreach (var department in context.Departments)
|
||||
{
|
||||
Console.WriteLine(department.FullName);
|
||||
}
|
||||
foreach (var menu in context.Menus)
|
||||
{
|
||||
Console.WriteLine(menu.FullName);
|
||||
}
|
||||
foreach (var button in context.Buttons)
|
||||
{
|
||||
Console.WriteLine(button.FullName);
|
||||
}
|
||||
foreach (var role in context.Roles)
|
||||
{
|
||||
Console.WriteLine(role.FullName);
|
||||
foreach (var roleMenu in role.RoleMenus)
|
||||
{
|
||||
Console.WriteLine(roleMenu.FullName);
|
||||
foreach (var button in roleMenu.Buttons)
|
||||
{
|
||||
Console.WriteLine(button.FullName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,6 +61,7 @@
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
<ItemGroup>
|
||||
<Compile Include="DbContextTest.cs" />
|
||||
<Compile Include="DepartmentTest.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="LoginTest.cs" />
|
||||
|
||||
Reference in New Issue
Block a user