从山证v2.3.0拷贝
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
using YLErp.Modules.SwapModule;
|
||||
|
||||
namespace YLErp.BasicTests
|
||||
{
|
||||
[TestClass]
|
||||
public class DataBaseTest
|
||||
{
|
||||
[TestMethod]
|
||||
public void TestConnection()
|
||||
{
|
||||
var yldb = DbContextFactory.GetYLDbContext();
|
||||
var appconfigs = yldb.AppConfig.Take(10).ToArray();
|
||||
|
||||
var admindb = DbContextFactory.GetErpBaseContext();
|
||||
var sysusers = admindb.SystemUsers.Take(10).ToArray();
|
||||
|
||||
var clientdb = DbContextFactory.GetClientDbContext(OptUserInfo.SystemUser);
|
||||
var clients = clientdb.client.Take(10).ToArray();
|
||||
|
||||
Assert.IsTrue(appconfigs.Length > 0 && sysusers.Length > 0 && clients.Length > 0);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestDictionaries()
|
||||
{
|
||||
var admindb = DbContextFactory.GetErpBaseContext();
|
||||
var dictionaries = admindb.Dictionaries.ToArray();
|
||||
var sb = new StringBuilder();
|
||||
foreach(var d in dictionaries)
|
||||
{
|
||||
sb.AppendFormat(@"<dictionary name=""{0}"" catalog=""{1}"">",d.Name,d.Catalog)
|
||||
.Append("</dictionary>").AppendLine();
|
||||
}
|
||||
System.Diagnostics.Debug.WriteLine(sb.ToString());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestGenerateSwapTradeFromDb()
|
||||
{
|
||||
new SwapTradeAutoService(OptUserInfo.SystemUser).GenerateSwapTradeFromDb(DateTime.Now.Date, false);
|
||||
|
||||
Assert.Fail();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user