re testing
This commit is contained in:
@ -183,7 +183,7 @@ namespace isnd.host.tests
|
||||
PackageUpdateResource pushRes = await repository.GetResourceAsync<PackageUpdateResource>();
|
||||
SymbolPackageUpdateResourceV3 symbolPackageResource = await repository.GetResourceAsync<SymbolPackageUpdateResourceV3>();
|
||||
|
||||
await pushRes.Push(new List<string>{ "../../../../../src/isn.abst/bin/Release/isn.abst.1.0.1.nupkg" }, null,
|
||||
await pushRes.Push(new List<string>{ "../../../Yavsc.Abstract.1.0.8.nupkg" }, null,
|
||||
5000, false, GetApiKey, GetSymbolsApiKey, false, false, symbolPackageResource, logger);
|
||||
|
||||
}
|
||||
|
@ -33,7 +33,6 @@ namespace isnd.tests
|
||||
|
||||
public IDataProtector DataProtector { get; private set; }
|
||||
|
||||
public ApplicationDbContext dbContext { get; private set; }
|
||||
|
||||
public string TestingUserName { get; private set; }
|
||||
public string ProtectedTestingApiKey { get; internal set; }
|
||||
@ -80,15 +79,18 @@ namespace isnd.tests
|
||||
|
||||
DataProtector = Host.Services.GetRequiredService<IDataProtectionProvider>()
|
||||
.CreateProtector(siteSettings.ProtectionTitle);
|
||||
using IServiceScope scope = Host.Services.CreateScope();
|
||||
ApplicationDbContext dbContext =
|
||||
scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
|
||||
|
||||
dbContext = Host.Services.GetRequiredService<ApplicationDbContext>();
|
||||
|
||||
TestingUserName = "Tester";
|
||||
TestingUser = dbContext.Users.FirstOrDefault(u => u.UserName == TestingUserName);
|
||||
EnsureUser(TestingUserName);
|
||||
var testKey = dbContext.ApiKeys.FirstOrDefault(k => k.UserId == TestingUser.Id);
|
||||
if (testKey == null)
|
||||
{
|
||||
var keyProvider = Host.Services.GetService<IApiKeyProvider>();
|
||||
var keyProvider = scope.ServiceProvider.GetService<IApiKeyProvider>();
|
||||
var apiKeyQuery = new Data.ApiKeys.CreateModel
|
||||
{
|
||||
Name = "Testing Key",
|
||||
@ -111,7 +113,12 @@ namespace isnd.tests
|
||||
{
|
||||
if (TestingUser == null)
|
||||
{
|
||||
var userManager = Host.Services.GetRequiredService<UserManager<ApplicationUser>>();
|
||||
using IServiceScope scope = Host.Services.CreateScope();
|
||||
|
||||
var userManager =
|
||||
scope.ServiceProvider.GetRequiredService<UserManager<ApplicationUser>>();
|
||||
|
||||
|
||||
TestingUser = new ApplicationUser
|
||||
{
|
||||
UserName = testingUserName
|
||||
@ -120,6 +127,9 @@ namespace isnd.tests
|
||||
var result = userManager.CreateAsync(TestingUser).Result;
|
||||
|
||||
Assert.True(result.Succeeded);
|
||||
|
||||
ApplicationDbContext dbContext =
|
||||
scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
|
||||
TestingUser = dbContext.Users.FirstOrDefault(u => u.UserName == testingUserName);
|
||||
}
|
||||
}
|
||||
|
BIN
test/isnd.tests/Yavsc.Abstract.1.0.8.nupkg
Normal file
BIN
test/isnd.tests/Yavsc.Abstract.1.0.8.nupkg
Normal file
Binary file not shown.
@ -18,5 +18,6 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\isnd\isnd.csproj" />
|
||||
<ProjectReference Include="..\..\src\isn\isn.csproj" />
|
||||
<File Include="Yavsc.Abstract.1.0.8.nupkg"></File>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
Reference in New Issue
Block a user