2020-01-03 18:37:00 +08:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using Xunit;
|
2019-01-24 17:58:06 +08:00
|
|
|
|
|
|
|
|
|
namespace Bootstrap.DataAccess.SQLite
|
|
|
|
|
{
|
|
|
|
|
[Collection("SQLiteContext")]
|
2019-05-15 00:22:13 +08:00
|
|
|
|
public class DictsTest : SqlServer.DictsTest
|
2019-01-24 17:58:06 +08:00
|
|
|
|
{
|
2019-05-18 17:48:40 +08:00
|
|
|
|
protected override string DatabaseName { get; set; } = "SQLite";
|
2020-01-03 18:37:00 +08:00
|
|
|
|
|
|
|
|
|
[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"));
|
|
|
|
|
}
|
2019-01-24 17:58:06 +08:00
|
|
|
|
}
|
|
|
|
|
}
|