test: 更新 RetrieveHomeUrl 方法单元测试

This commit is contained in:
Argo Zhang 2020-01-03 16:12:05 +08:00
parent d772e73f81
commit 4b0e8c22de
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
1 changed files with 4 additions and 4 deletions

View File

@ -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"));
} }
} }
} }