test: 更新 RetrieveHomeUrl 方法单元测试
This commit is contained in:
parent
d772e73f81
commit
4b0e8c22de
|
@ -145,8 +145,8 @@ namespace Bootstrap.DataAccess
|
||||||
[Fact]
|
[Fact]
|
||||||
public void RetrieveHomeUrl_Ok()
|
public void RetrieveHomeUrl_Ok()
|
||||||
{
|
{
|
||||||
Assert.Equal("~/Home/Index", DictHelper.RetrieveHomeUrl("BA"));
|
Assert.Equal("~/Home/Index", DictHelper.RetrieveHomeUrl("Admin", "BA"));
|
||||||
var url = DictHelper.RetrieveHomeUrl("Demo");
|
var url = DictHelper.RetrieveHomeUrl("Admin", "Demo");
|
||||||
Assert.Equal("http://localhost:49185/", url);
|
Assert.Equal("http://localhost:49185/", url);
|
||||||
|
|
||||||
// INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('应用首页', 2, 'http://localhost:49185/', 0);
|
// INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('应用首页', 2, 'http://localhost:49185/', 0);
|
||||||
|
@ -154,11 +154,11 @@ namespace Bootstrap.DataAccess
|
||||||
url = dict.Code;
|
url = dict.Code;
|
||||||
dict.Code = "BA";
|
dict.Code = "BA";
|
||||||
Assert.True(DictHelper.Save(dict));
|
Assert.True(DictHelper.Save(dict));
|
||||||
Assert.Equal("BA", DictHelper.RetrieveHomeUrl("Demo"));
|
Assert.Equal("BA", DictHelper.RetrieveHomeUrl("Admin", "Demo"));
|
||||||
|
|
||||||
dict.Code = url;
|
dict.Code = url;
|
||||||
Assert.True(DictHelper.Save(dict));
|
Assert.True(DictHelper.Save(dict));
|
||||||
Assert.Equal(url, DictHelper.RetrieveHomeUrl("Demo"));
|
Assert.Equal(url, DictHelper.RetrieveHomeUrl("Admin", "Demo"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue