mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-11-09 10:54:46 +08:00
调整了一下项目框架与前端JS代码
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using OpenAuth.Repository;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using OpenAuth.Repository;
|
||||
|
||||
namespace OpenAuth.UnitTest
|
||||
{
|
||||
[TestClass]
|
||||
public class DepartmentTest
|
||||
{
|
||||
[TestMethod]
|
||||
public void TestAllDepartment()
|
||||
{
|
||||
OpenAuthDBContext context = new OpenAuthDBContext();
|
||||
foreach (var department in context.Departments)
|
||||
{
|
||||
Console.WriteLine(department.FullName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace OpenAuth.UnitTest
|
||||
{
|
||||
[TestClass]
|
||||
public class IndexTest
|
||||
{
|
||||
[TestMethod]
|
||||
public void MenuTest()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using OpenAuth.App;
|
||||
using OpenAuth.App.DTO;
|
||||
using OpenAuth.Domain.Service;
|
||||
using OpenAuth.Repository;
|
||||
|
||||
namespace OpenAuth.UnitTest
|
||||
{
|
||||
[TestClass]
|
||||
public class LoginTest
|
||||
{
|
||||
|
||||
[TestMethod]
|
||||
public void Login()
|
||||
{
|
||||
var loginReq = new LoginRequest { UserName = "admin", Password = "123456" };
|
||||
var loginApp = new LoginApp(new LoginService(new UserRepository()));
|
||||
var response = loginApp.Login(loginReq);
|
||||
Assert.IsTrue(response.Success);
|
||||
Assert.AreEqual(response.UserName, loginReq.UserName);
|
||||
|
||||
var errPassword = new LoginRequest { UserName = "admin", Password = "111111" };
|
||||
response = loginApp.Login(errPassword);
|
||||
Assert.IsFalse(response.Success);
|
||||
Assert.AreEqual(response.Message, "密码错误");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,11 +61,7 @@
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
<ItemGroup>
|
||||
<Compile Include="DbContextTest.cs" />
|
||||
<Compile Include="DepartmentTest.cs" />
|
||||
<Compile Include="IndexTest.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="LoginTest.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
@@ -80,10 +76,6 @@
|
||||
<Project>{6108DA8E-92A1-4ABE-B9F5-26D64D55CA2C}</Project>
|
||||
<Name>OpenAuth.Domain</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\OpenAuth.Infrastructure\OpenAuth.Infrastructure.csproj">
|
||||
<Project>{ADAE08C0-DE22-41F7-9F94-0E62AE327C25}</Project>
|
||||
<Name>OpenAuth.Infrastructure</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\OpenAuth.Repository\OpenAuth.Repository.csproj">
|
||||
<Project>{E8DF8DEA-E2CF-4BDB-8F4F-3F8205B0E03A}</Project>
|
||||
<Name>OpenAuth.Repository</Name>
|
||||
|
||||
Reference in New Issue
Block a user