test: 增加单元测试
This commit is contained in:
parent
4b0e8c22de
commit
b65040af7e
|
@ -17,7 +17,6 @@ namespace Bootstrap.Admin.Api
|
||||||
Assert.NotNull(cates);
|
Assert.NotNull(cates);
|
||||||
cates = await Client.GetAsJsonAsync<AnalyseData>("?logType=trace");
|
cates = await Client.GetAsJsonAsync<AnalyseData>("?logType=trace");
|
||||||
Assert.NotNull(cates);
|
Assert.NotNull(cates);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
using UnitTest;
|
using UnitTest;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace Bootstrap.DataAccess
|
namespace Bootstrap.DataAccess.SqlServer
|
||||||
{
|
{
|
||||||
[Collection("SQLServerContext")]
|
[Collection("SQLServerContext")]
|
||||||
public class RollbackTest
|
public class RollbackTest
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using Xunit;
|
using System.Linq;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
namespace Bootstrap.DataAccess.SQLite
|
namespace Bootstrap.DataAccess.SQLite
|
||||||
{
|
{
|
||||||
|
@ -6,5 +7,21 @@ namespace Bootstrap.DataAccess.SQLite
|
||||||
public class DictsTest : SqlServer.DictsTest
|
public class DictsTest : SqlServer.DictsTest
|
||||||
{
|
{
|
||||||
protected override string DatabaseName { get; set; } = "SQLite";
|
protected override string DatabaseName { get; set; } = "SQLite";
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void RetrieveHomeUrl_Ok()
|
||||||
|
{
|
||||||
|
Assert.Equal("~/Home/Index", DictHelper.RetrieveHomeUrl("Admin", ""));
|
||||||
|
|
||||||
|
var dict = DictHelper.RetrieveDicts().FirstOrDefault(d => d.Category == "系统设置" && d.Name == "默认应用程序");
|
||||||
|
Assert.NotNull(dict);
|
||||||
|
dict.Code = "1";
|
||||||
|
DictHelper.Save(dict);
|
||||||
|
Assert.Equal("http://localhost:49185/", DictHelper.RetrieveHomeUrl("Admin", "BA"));
|
||||||
|
dict.Code = "0";
|
||||||
|
DictHelper.Save(dict);
|
||||||
|
Assert.Equal("~/Home/Index", DictHelper.RetrieveHomeUrl("Admin", "BA"));
|
||||||
|
Assert.Equal("http://localhost:49185/", DictHelper.RetrieveHomeUrl("Admin", "Demo"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ using Longbow.Web;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace Bootstrap.DataAccess
|
namespace Bootstrap.DataAccess.SqlServer
|
||||||
{
|
{
|
||||||
[Collection("SQLServerContext")]
|
[Collection("SQLServerContext")]
|
||||||
[AutoRollback]
|
[AutoRollback]
|
||||||
|
|
Loading…
Reference in New Issue