From 8a32aecbf5603deeeac9a5fa10552342ad3d4214 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 18 May 2019 17:48:40 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E4=BF=AE=E5=A4=8D=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=B8=80=E8=B5=B7=E8=BF=90=E8=A1=8C=E6=97=B6?= =?UTF-8?q?=E5=87=BA=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- UnitTest/BAWebHost.cs | 6 +----- UnitTest/Bootstrap.Admin/Api/AppsTest.cs | 2 +- UnitTest/Bootstrap.Admin/Api/DictTest.cs | 5 +---- UnitTest/Bootstrap.Admin/Api/GroupsTest.cs | 14 +++++++------- UnitTest/Bootstrap.Admin/Api/MenusTest.cs | 11 +++++------ UnitTest/Bootstrap.Admin/Api/NewTest.cs | 10 +++++----- UnitTest/Bootstrap.Admin/Api/RegisterTest.cs | 2 +- UnitTest/Bootstrap.Admin/Api/RolesTest.cs | 16 ++++++++-------- UnitTest/Bootstrap.Admin/Api/SettingsTest.cs | 15 +++++++-------- UnitTest/Bootstrap.Admin/Api/UsersTest.cs | 17 ++++++++--------- UnitTest/Bootstrap.DataAccess/DictsTest.cs | 12 +++++++++++- .../Bootstrap.DataAccess/MongoDB/DictsTest.cs | 2 +- .../Bootstrap.DataAccess/MySql/DictsTest.cs | 2 +- .../Bootstrap.DataAccess/SQLite/DictsTest.cs | 2 +- UnitTest/UnitTest.csproj | 5 ++++- UnitTest/appsettings.json | 5 ----- UnitTest/appsettings.unittest.json | 12 ++++++++++++ 18 files changed, 75 insertions(+), 65 deletions(-) create mode 100644 UnitTest/appsettings.unittest.json diff --git a/.gitignore b/.gitignore index e457dd12..c6b305e5 100644 --- a/.gitignore +++ b/.gitignore @@ -353,5 +353,5 @@ Bootstrap.Admin.xml ###### -- Custom Ignore Section, Make sure all files you add to the git repo are below this line -- ###### # Coverage -coverage.xml +coverage*.xml tools/ \ No newline at end of file diff --git a/UnitTest/BAWebHost.cs b/UnitTest/BAWebHost.cs index 11e8377e..7f1c78ac 100644 --- a/UnitTest/BAWebHost.cs +++ b/UnitTest/BAWebHost.cs @@ -126,11 +126,6 @@ namespace Bootstrap.Admin TestHelper.SQLServerConnectionString = con.GetConnectionString("sqlserver-app"); TestHelper.MySqlConnectionString = con.GetConnectionString("mysql-app"); TestHelper.NpgSqlConnectionString = con.GetConnectionString("npgsql-app"); - builder.ConfigureAppConfiguration(app => app.AddInMemoryCollection(new KeyValuePair[] { - new KeyValuePair("Logging:LogLevel:Default", "Error"), - new KeyValuePair("Logging:LogLevel:System", "Error"), - new KeyValuePair("Logging:LogLevel:Microsoft", "Error") - })); } else { @@ -141,6 +136,7 @@ namespace Bootstrap.Admin new KeyValuePair("MongoDB", con.GetValue("MongoDB", "UnitTest")) })); } + builder.ConfigureAppConfiguration(app => app.AddJsonFile(TestHelper.RetrievePath($"UnitTest{Path.DirectorySeparatorChar}appsettings.unittest.json"), false, true)); TestHelper.SQLiteConnectionString = con.GetConnectionString("sqlite"); TestHelper.ConfigureWebHost(builder); } diff --git a/UnitTest/Bootstrap.Admin/Api/AppsTest.cs b/UnitTest/Bootstrap.Admin/Api/AppsTest.cs index d4e9f596..5d1e98ad 100644 --- a/UnitTest/Bootstrap.Admin/Api/AppsTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/AppsTest.cs @@ -12,7 +12,7 @@ namespace Bootstrap.Admin.Api.SqlServer [Fact] public async void Get_Ok() { - var rid = new Role().Retrieves().Where(r => r.RoleName == "Administrators").First().Id; + var rid = RoleHelper.Retrieves().Where(r => r.RoleName == "Administrators").First().Id; var cates = await Client.GetAsJsonAsync>(rid); Assert.NotEmpty(cates); } diff --git a/UnitTest/Bootstrap.Admin/Api/DictTest.cs b/UnitTest/Bootstrap.Admin/Api/DictTest.cs index 2cf19b6f..bd357660 100644 --- a/UnitTest/Bootstrap.Admin/Api/DictTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/DictTest.cs @@ -23,13 +23,10 @@ namespace Bootstrap.Admin.Api.SqlServer [Fact] public async void PostAndDelete_Ok() { - var dict = new Dict(); - dict.Delete(new Dict().RetrieveDicts().Where(d => d.Category == "UnitTest-Category").Select(d => d.Id)); - var ret = await Client.PostAsJsonAsync("", new BootstrapDict() { Name = "UnitTest-Dict", Category = "UnitTest-Category", Code = "0", Define = 0 }); Assert.True(ret); - var ids = dict.RetrieveDicts().Where(d => d.Name == "UnitTest-Dict").Select(d => d.Id); + var ids = DictHelper.RetrieveDicts().Where(d => d.Name == "UnitTest-Dict").Select(d => d.Id); Assert.True(await Client.DeleteAsJsonAsync, bool>(ids)); } } diff --git a/UnitTest/Bootstrap.Admin/Api/GroupsTest.cs b/UnitTest/Bootstrap.Admin/Api/GroupsTest.cs index 95063673..54b44058 100644 --- a/UnitTest/Bootstrap.Admin/Api/GroupsTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/GroupsTest.cs @@ -22,7 +22,7 @@ namespace Bootstrap.Admin.Api.SqlServer [Fact] public async void GetById_Ok() { - var id = new Group().Retrieves().Where(gp => gp.GroupName == "Admin").First().Id; + var id = GroupHelper.Retrieves().Where(gp => gp.GroupName == "Admin").First().Id; var g = await Client.GetAsJsonAsync(id); Assert.Equal("Admin", g.GroupName); } @@ -33,18 +33,18 @@ namespace Bootstrap.Admin.Api.SqlServer var ret = await Client.PostAsJsonAsync("", new Group() { GroupName = "UnitTest-Group", Description = "UnitTest-Desc" }); Assert.True(ret); - var ids = new Group().Retrieves().Where(d => d.GroupName == "UnitTest-Group").Select(d => d.Id); + var ids = GroupHelper.Retrieves().Where(d => d.GroupName == "UnitTest-Group").Select(d => d.Id); Assert.True(await Client.DeleteAsJsonAsync, bool>(ids)); } [Fact] public async void PostById_Ok() { - var uid = new User().Retrieves().Where(u => u.UserName == "Admin").First().Id; + var uid = UserHelper.Retrieves().Where(u => u.UserName == "Admin").First().Id; var ret = await Client.PostAsJsonAsync>($"{uid}?type=user", string.Empty); Assert.NotEmpty(ret); - var rid = new Role().Retrieves().Where(r => r.RoleName == "Administrators").First().Id; + var rid = RoleHelper.Retrieves().Where(r => r.RoleName == "Administrators").First().Id; ret = await Client.PostAsJsonAsync>($"{rid}?type=role", string.Empty); Assert.NotEmpty(ret); } @@ -52,12 +52,12 @@ namespace Bootstrap.Admin.Api.SqlServer [Fact] public async void PutById_Ok() { - var ids = new Group().Retrieves().Select(g => g.Id); - var uid = new User().Retrieves().Where(u => u.UserName == "Admin").First().Id; + var ids = GroupHelper.Retrieves().Select(g => g.Id); + var uid = UserHelper.Retrieves().Where(u => u.UserName == "Admin").First().Id; var ret = await Client.PutAsJsonAsync, bool>($"{uid}?type=user", ids); Assert.True(ret); - var rid = new Role().Retrieves().Where(r => r.RoleName == "Administrators").First().Id; + var rid = RoleHelper.Retrieves().Where(r => r.RoleName == "Administrators").First().Id; ret = await Client.PutAsJsonAsync, bool>($"{rid}?type=role", ids); Assert.True(ret); } diff --git a/UnitTest/Bootstrap.Admin/Api/MenusTest.cs b/UnitTest/Bootstrap.Admin/Api/MenusTest.cs index bdf89f00..d8d211f8 100644 --- a/UnitTest/Bootstrap.Admin/Api/MenusTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/MenusTest.cs @@ -26,8 +26,7 @@ namespace Bootstrap.Admin.Api.SqlServer var ret = await Client.PostAsJsonAsync(new BootstrapMenu() { Name = "UnitTest-Menu", Application = "0", Category = "0", ParentId = "0", Url = "#", Target = "_self", IsResource = 0 }); Assert.True(ret); - var menu = new Menu(); - var ids = menu.RetrieveAllMenus("Admin").Where(d => d.Name == "UnitTest-Menu").Select(d => d.Id); + var ids = MenuHelper.RetrieveAllMenus("Admin").Where(d => d.Name == "UnitTest-Menu").Select(d => d.Id); Assert.True(await Client.DeleteAsJsonAsync, bool>("", ids)); } @@ -35,11 +34,11 @@ namespace Bootstrap.Admin.Api.SqlServer [Fact] public async void PostById_Ok() { - var uid = new User().Retrieves().Where(u => u.UserName == "Admin").First().Id; + var uid = UserHelper.Retrieves().Where(u => u.UserName == "Admin").First().Id; var ret = await Client.PostAsJsonAsync>($"{uid}?type=user", string.Empty); Assert.NotEmpty(ret); - var rid = new Role().Retrieves().Where(r => r.RoleName == "Administrators").First().Id; + var rid = RoleHelper.Retrieves().Where(r => r.RoleName == "Administrators").First().Id; ret = await Client.PostAsJsonAsync>($"{rid}?type=role", string.Empty); Assert.NotEmpty(ret); } @@ -47,8 +46,8 @@ namespace Bootstrap.Admin.Api.SqlServer [Fact] public async void PutById_Ok() { - var ids = new Menu().RetrieveAllMenus("Admin").Select(g => g.Id); - var rid = new Role().Retrieves().Where(r => r.RoleName == "Administrators").First().Id; + var ids = MenuHelper.RetrieveAllMenus("Admin").Select(g => g.Id); + var rid = RoleHelper.Retrieves().Where(r => r.RoleName == "Administrators").First().Id; var ret = await Client.PutAsJsonAsync, bool>($"{rid}", ids); Assert.True(ret); } diff --git a/UnitTest/Bootstrap.Admin/Api/NewTest.cs b/UnitTest/Bootstrap.Admin/Api/NewTest.cs index 808bd056..bde47d4c 100644 --- a/UnitTest/Bootstrap.Admin/Api/NewTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/NewTest.cs @@ -33,7 +33,7 @@ namespace Bootstrap.Admin.Api.SqlServer Assert.True(resp); // 删除新用户 - nusr.Delete(new string[] { nusr.Id }); + UserHelper.Delete(new string[] { nusr.Id }); // Reject nusr = InsertNewUser(); @@ -48,15 +48,15 @@ namespace Bootstrap.Admin.Api.SqlServer private User InsertNewUser() { // 插入新用户 - var nusr = new User() { UserName = "UnitTest-Register", DisplayName = "UnitTest", Password = "1", Description = "UnitTest" }; - Assert.True(new User().Save(nusr)); + var nusr = new User() { UserName = "UnitTest_New", DisplayName = "UnitTest", Password = "1", Description = "UnitTest" }; + Assert.True(UserHelper.Save(nusr)); return nusr; } private void DeleteUnitTestUser() { - var ids = new User().RetrieveNewUsers().Where(u => u.UserName == "UnitTest-Register").Select(u => u.Id); - new User().Delete(ids); + var ids = UserHelper.RetrieveNewUsers().Where(u => u.UserName == "UnitTest_New").Select(u => u.Id); + UserHelper.Delete(ids); } } } diff --git a/UnitTest/Bootstrap.Admin/Api/RegisterTest.cs b/UnitTest/Bootstrap.Admin/Api/RegisterTest.cs index 32a6260d..851c5b4f 100644 --- a/UnitTest/Bootstrap.Admin/Api/RegisterTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/RegisterTest.cs @@ -22,7 +22,7 @@ namespace Bootstrap.Admin.Api.SqlServer var nusr = new User() { UserName = "UnitTest_RegisterController", DisplayName = "UnitTest", Password = "1", Description = "UnitTest" }; var resp = await Client.PostAsJsonAsync(nusr); Assert.True(resp); - nusr.Delete(nusr.RetrieveNewUsers().Where(u => u.UserName == nusr.UserName).Select(u => u.Id)); + UserHelper.Delete(nusr.RetrieveNewUsers().Where(u => u.UserName == nusr.UserName).Select(u => u.Id)); } [Fact] diff --git a/UnitTest/Bootstrap.Admin/Api/RolesTest.cs b/UnitTest/Bootstrap.Admin/Api/RolesTest.cs index e2934332..eb3c046a 100644 --- a/UnitTest/Bootstrap.Admin/Api/RolesTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/RolesTest.cs @@ -25,16 +25,16 @@ namespace Bootstrap.Admin.Api.SqlServer var ret = await Client.PostAsJsonAsync(new Role() { RoleName = "UnitTest-Role", Description = "UnitTest-Desc" }); Assert.True(ret); - var ids = new Role().Retrieves().Where(d => d.RoleName == "UnitTest-Role").Select(d => d.Id); + var ids = RoleHelper.Retrieves().Where(d => d.RoleName == "UnitTest-Role").Select(d => d.Id); Assert.True(await Client.DeleteAsJsonAsync, bool>(ids)); } [Fact] public async void PostById_Ok() { - var uid = new User().Retrieves().Where(u => u.UserName == "Admin").First().Id; - var gid = new Group().Retrieves().Where(g => g.GroupName == "Admin").First().Id; - var mid = new Menu().RetrieveAllMenus("Admin").Where(m => m.Url == "~/Admin/Index").First().Id; + var uid = UserHelper.Retrieves().Where(u => u.UserName == "Admin").First().Id; + var gid = GroupHelper.Retrieves().Where(g => g.GroupName == "Admin").First().Id; + var mid = MenuHelper.RetrieveAllMenus("Admin").Where(m => m.Url == "~/Admin/Index").First().Id; var ret = await Client.PostAsJsonAsync>($"{uid}?type=user", string.Empty); Assert.NotEmpty(ret); @@ -49,10 +49,10 @@ namespace Bootstrap.Admin.Api.SqlServer [Fact] public async void PutById_Ok() { - var uid = new User().Retrieves().Where(u => u.UserName == "Admin").First().Id; - var gid = new Group().Retrieves().Where(g => g.GroupName == "Admin").First().Id; - var mid = new Menu().RetrieveAllMenus("Admin").Where(m => m.Url == "~/Admin/Index").First().Id; - var ids = new Role().Retrieves().Select(r => r.Id); + var uid = UserHelper.Retrieves().Where(u => u.UserName == "Admin").First().Id; + var gid = GroupHelper.Retrieves().Where(g => g.GroupName == "Admin").First().Id; + var mid = MenuHelper.RetrieveAllMenus("Admin").Where(m => m.Url == "~/Admin/Index").First().Id; + var ids = RoleHelper.Retrieves().Select(r => r.Id); var ret = await Client.PutAsJsonAsync, bool>($"{uid}?type=user", ids); Assert.True(ret); diff --git a/UnitTest/Bootstrap.Admin/Api/SettingsTest.cs b/UnitTest/Bootstrap.Admin/Api/SettingsTest.cs index 2cc0f6da..6379736d 100644 --- a/UnitTest/Bootstrap.Admin/Api/SettingsTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/SettingsTest.cs @@ -21,24 +21,23 @@ namespace Bootstrap.Admin.Api.SqlServer [Fact] public async void Post_Ok() { - var dict = new Dict(); - var dicts = dict.RetrieveDicts(); + var dicts = DictHelper.RetrieveDicts(); var ids = dicts.Where(d => d.Category == "UnitTest-Settings").Select(d => d.Id); - dict.Delete(ids); + DictHelper.Delete(ids); - Assert.True(dict.Save(new Dict() { Category = "UnitTest-Settings", Name = "UnitTest", Code = "0", Define = 0 })); + Assert.True(DictHelper.Save(new BootstrapDict() { Category = "UnitTest-Settings", Name = "UnitTest", Code = "0", Define = 0 })); // 获得原来值 - var resp = await Client.PostAsJsonAsync(new Dict() { Category = "UnitTest-Settings", Name = "UnitTest", Code = "UnitTest" }); + var resp = await Client.PostAsJsonAsync(new BootstrapDict() { Category = "UnitTest-Settings", Name = "UnitTest", Code = "UnitTest" }); Assert.True(resp); - var code = dict.RetrieveDicts().FirstOrDefault(d => d.Category == "UnitTest-Settings").Code; + var code = DictHelper.RetrieveDicts().FirstOrDefault(d => d.Category == "UnitTest-Settings").Code; Assert.Equal("UnitTest", code); // Delete - ids = dict.RetrieveDicts().Where(d => d.Category == "UnitTest-Settings").Select(d => d.Id); - dict.Delete(ids); + ids = DictHelper.RetrieveDicts().Where(d => d.Category == "UnitTest-Settings").Select(d => d.Id); + DictHelper.Delete(ids); } internal class CacheCorsItem : ICacheCorsItem diff --git a/UnitTest/Bootstrap.Admin/Api/UsersTest.cs b/UnitTest/Bootstrap.Admin/Api/UsersTest.cs index 9559806b..ff3118c7 100644 --- a/UnitTest/Bootstrap.Admin/Api/UsersTest.cs +++ b/UnitTest/Bootstrap.Admin/Api/UsersTest.cs @@ -31,30 +31,29 @@ namespace Bootstrap.Admin.Api.SqlServer [Fact] public async void PostAndDelete_Ok() { - var user = new User(); - user.Delete(user.Retrieves().Where(usr => usr.UserName == "UnitTest-Delete").Select(usr => usr.Id)); + UserHelper.Delete(UserHelper.Retrieves().Where(usr => usr.UserName == "UnitTest_Delete").Select(usr => usr.Id)); var nusr = new User { UserName = "UnitTest_Delete", Password = "1", DisplayName = "DisplayName", ApprovedBy = "System", ApprovedTime = DateTime.Now, Description = "Desc", Icon = "default.jpg" }; var resp = await Client.PostAsJsonAsync("", nusr); Assert.True(resp); - nusr.Id = user.Retrieves().First(u => u.UserName == nusr.UserName).Id; + nusr.Id = UserHelper.Retrieves().First(u => u.UserName == nusr.UserName).Id; resp = await Client.PostAsJsonAsync(nusr); Assert.True(resp); - var ids = user.Retrieves().Where(d => d.UserName == nusr.UserName).Select(d => d.Id); + var ids = UserHelper.Retrieves().Where(d => d.UserName == nusr.UserName).Select(d => d.Id); Assert.True(await Client.DeleteAsJsonAsync, bool>(ids)); } [Fact] public async void PostById_Ok() { - var rid = new Role().Retrieves().Where(r => r.RoleName == "Administrators").First().Id; + var rid = RoleHelper.Retrieves().Where(r => r.RoleName == "Administrators").First().Id; var ret = await Client.PostAsJsonAsync>($"{rid}?type=role", string.Empty); Assert.NotNull(ret); - var gid = new Group().Retrieves().Where(r => r.GroupName == "Admin").First().Id; + var gid = GroupHelper.Retrieves().Where(r => r.GroupName == "Admin").First().Id; ret = await Client.PostAsJsonAsync>($"{gid}?type=group", string.Empty); Assert.NotNull(ret); @@ -65,12 +64,12 @@ namespace Bootstrap.Admin.Api.SqlServer [Fact] public async void PutById_Ok() { - var ids = new User().Retrieves().Where(u => u.UserName == "Admin").Select(u => u.Id); - var gid = new Group().Retrieves().Where(r => r.GroupName == "Admin").First().Id; + var ids = UserHelper.Retrieves().Where(u => u.UserName == "Admin").Select(u => u.Id); + var gid = GroupHelper.Retrieves().Where(r => r.GroupName == "Admin").First().Id; var ret = await Client.PutAsJsonAsync, bool>($"{gid}?type=group", ids); Assert.True(ret); - var rid = new Role().Retrieves().Where(r => r.RoleName == "Administrators").First().Id; + var rid = RoleHelper.Retrieves().Where(r => r.RoleName == "Administrators").First().Id; ret = await Client.PutAsJsonAsync, bool>($"{rid}?type=role", ids); Assert.True(ret); } diff --git a/UnitTest/Bootstrap.DataAccess/DictsTest.cs b/UnitTest/Bootstrap.DataAccess/DictsTest.cs index e54e45bc..3008a82e 100644 --- a/UnitTest/Bootstrap.DataAccess/DictsTest.cs +++ b/UnitTest/Bootstrap.DataAccess/DictsTest.cs @@ -1,4 +1,4 @@ -using Bootstrap.Security; +using Bootstrap.Security; using System; using System.Linq; using System.Net.Http; @@ -9,6 +9,8 @@ namespace Bootstrap.DataAccess.SqlServer [Collection("SQLServerContext")] public class DictsTest { + protected virtual string DatabaseName { get; set; } = "SQLServer"; + [Fact] public void SaveAndDelete_Ok() { @@ -168,6 +170,14 @@ namespace Bootstrap.DataAccess.SqlServer Assert.Equal("10", DictHelper.RetrieveLocaleIPSvrCachePeriod()); } + [Fact] + public void DatabaseCheck_Ok() + { + var dict = new BootstrapDict() { Category = "系统检查", Name = "系统设置", Code = DatabaseName, Define = 0 }; + Assert.True(DictHelper.Save(dict)); + Assert.Equal(DatabaseName, DictHelper.RetrieveDicts().FirstOrDefault(d => d.Category == dict.Category && d.Name == dict.Name)?.Code ?? "unknown"); + } + #region Private Class For Test /// /// diff --git a/UnitTest/Bootstrap.DataAccess/MongoDB/DictsTest.cs b/UnitTest/Bootstrap.DataAccess/MongoDB/DictsTest.cs index afb68b6e..872d6d9e 100644 --- a/UnitTest/Bootstrap.DataAccess/MongoDB/DictsTest.cs +++ b/UnitTest/Bootstrap.DataAccess/MongoDB/DictsTest.cs @@ -5,6 +5,6 @@ namespace Bootstrap.DataAccess.MongoDB [Collection("MongoContext")] public class DictsTest : SqlServer.DictsTest { - + protected override string DatabaseName { get; set; } = "MongoDB"; } } diff --git a/UnitTest/Bootstrap.DataAccess/MySql/DictsTest.cs b/UnitTest/Bootstrap.DataAccess/MySql/DictsTest.cs index 2539b3ee..cb76d60a 100644 --- a/UnitTest/Bootstrap.DataAccess/MySql/DictsTest.cs +++ b/UnitTest/Bootstrap.DataAccess/MySql/DictsTest.cs @@ -5,6 +5,6 @@ namespace Bootstrap.DataAccess.MySql [Collection("MySqlContext")] public class DictsTest : SqlServer.DictsTest { - + protected override string DatabaseName { get; set; } = "MySql"; } } diff --git a/UnitTest/Bootstrap.DataAccess/SQLite/DictsTest.cs b/UnitTest/Bootstrap.DataAccess/SQLite/DictsTest.cs index 310c614e..27920d1c 100644 --- a/UnitTest/Bootstrap.DataAccess/SQLite/DictsTest.cs +++ b/UnitTest/Bootstrap.DataAccess/SQLite/DictsTest.cs @@ -5,6 +5,6 @@ namespace Bootstrap.DataAccess.SQLite [Collection("SQLiteContext")] public class DictsTest : SqlServer.DictsTest { - + protected override string DatabaseName { get; set; } = "SQLite"; } } diff --git a/UnitTest/UnitTest.csproj b/UnitTest/UnitTest.csproj index a811fba0..ca3f414d 100644 --- a/UnitTest/UnitTest.csproj +++ b/UnitTest/UnitTest.csproj @@ -8,7 +8,10 @@ - + + all + runtime; build; native; contentfiles; analyzers + diff --git a/UnitTest/appsettings.json b/UnitTest/appsettings.json index 6c6c04a0..cb258d09 100644 --- a/UnitTest/appsettings.json +++ b/UnitTest/appsettings.json @@ -1,9 +1,4 @@ { - "Logging": { - "LogLevel": { - "Default": "Debug" - } - }, "MongoDB": "UnitTest", "ConnectionStrings": { "sqlite": "Data Source=UnitTest.db;", diff --git a/UnitTest/appsettings.unittest.json b/UnitTest/appsettings.unittest.json new file mode 100644 index 00000000..28ca7f07 --- /dev/null +++ b/UnitTest/appsettings.unittest.json @@ -0,0 +1,12 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Error", + "System": "Error", + "Microsoft": "Error" + } + }, + "LongbowCache": { + "Enabled": false + } +} \ No newline at end of file