diff --git a/test/UnitTest/Bootstrap.DataAccess/SQLServer/DictsTest.cs b/test/UnitTest/Bootstrap.DataAccess/SQLServer/DictsTest.cs index 91d95c38..62c50a70 100644 --- a/test/UnitTest/Bootstrap.DataAccess/SQLServer/DictsTest.cs +++ b/test/UnitTest/Bootstrap.DataAccess/SQLServer/DictsTest.cs @@ -85,24 +85,6 @@ namespace Bootstrap.DataAccess.SqlServer Assert.Equal("~/images/uploader/", DictHelper.RetrieveIconFolderPath()); } - [Fact] - public void RetrieveHomeUrl_Ok() - { - Assert.Equal("~/Home/Index", DictHelper.RetrieveHomeUrl("BA")); - var url = DictHelper.RetrieveHomeUrl("Demo"); - Assert.Equal("http://localhost:49185/", url); - - // INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('应用首页', 2, 'http://localhost:49185/', 0); - var dict = DictHelper.RetrieveDicts().FirstOrDefault(d => d.Category == "应用首页" && d.Name == "Demo"); - url = dict.Code; - dict.Code = "BA"; - Assert.True(DictHelper.Save(dict)); - Assert.Equal("BA", DictHelper.RetrieveHomeUrl("Demo")); - - dict.Code = url; - Assert.True(DictHelper.Save(dict)); - } - [Fact] public void RetrieveApps_Ok() { diff --git a/test/UnitTest/Bootstrap.DataAccess/SystemModeTest.cs b/test/UnitTest/Bootstrap.DataAccess/SystemModeTest.cs index feadcc6a..322450bc 100644 --- a/test/UnitTest/Bootstrap.DataAccess/SystemModeTest.cs +++ b/test/UnitTest/Bootstrap.DataAccess/SystemModeTest.cs @@ -141,5 +141,24 @@ namespace Bootstrap.DataAccess Assert.True(RoleHelper.SaveByUserId(uId, new string[0])); Assert.Contains(RoleHelper.RetrievesByUserName("Admin"), r => r.Equals("Administrators")); } + + [Fact] + public void RetrieveHomeUrl_Ok() + { + Assert.Equal("~/Home/Index", DictHelper.RetrieveHomeUrl("BA")); + var url = DictHelper.RetrieveHomeUrl("Demo"); + Assert.Equal("http://localhost:49185/", url); + + // INSERT INTO [Dicts] ([Category], [Name], [Code], [Define]) VALUES ('应用首页', 2, 'http://localhost:49185/', 0); + var dict = DictHelper.RetrieveDicts().FirstOrDefault(d => d.Category == "应用首页" && d.Name == "Demo"); + url = dict.Code; + dict.Code = "BA"; + Assert.True(DictHelper.Save(dict)); + Assert.Equal("BA", DictHelper.RetrieveHomeUrl("Demo")); + + dict.Code = url; + Assert.True(DictHelper.Save(dict)); + Assert.Equal(url, DictHelper.RetrieveHomeUrl("Demo")); + } } }