Skip to content

Commit 15239f0

Browse files
committed
Fix unit tests. Merge PR: loic-sharma#770
1 parent 1a2b05e commit 15239f0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/BaGet.Tests/HostIntegrationTests.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ public void DefaultsToSqlite()
5959
Assert.IsType<SqliteContext>(context);
6060
}
6161

62-
private IServiceProvider BuildServiceProvider(Dictionary<string, string> configs = null)
62+
private static IServiceProvider BuildServiceProvider(Dictionary<string, string> configs = null)
6363
{
6464
var host = Program
65-
.CreateHostBuilder(new string[0])
65+
.CreateHostBuilder(Array.Empty<string>())
6666
.ConfigureAppConfiguration((ctx, config) =>
6767
{
6868
config.AddInMemoryCollection(configs ?? new Dictionary<string, string>());
6969
})
7070
.Build();
7171

72-
return host.Services;
72+
return host.Services.CreateScope().ServiceProvider;
7373
}
7474
}

tests/BaGet.Web.Tests/Pages/PackageModelFacts.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ public async Task RendersReadme()
334334
}
335335
}
336336

337-
private Package CreatePackage(
337+
private static Package CreatePackage(
338338
string version,
339339
long downloads = 0,
340340
bool hasReadme = false,

0 commit comments

Comments
 (0)