test all of it
This commit is contained in:
parent
4d51267dfd
commit
39ff100eab
8 changed files with 168 additions and 46 deletions
|
|
@ -19,5 +19,6 @@
|
|||
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
||||
<PackageReference Include="unleash.client" Version="6.2.1" />
|
||||
<Reference Include="System.Net.Http" Version="4.0.0.0" />
|
||||
<ProjectReference Include="..\isn.abstract\isn.abstract.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -61,13 +61,26 @@ namespace isnd
|
|||
ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||
});
|
||||
|
||||
var connectionString = Configuration.GetConnectionString("DefaultConnection");
|
||||
var useInMemoryDatabase = Configuration.GetValue<bool>("UseInMemoryDatabase") ||
|
||||
string.IsNullOrWhiteSpace(connectionString) ||
|
||||
connectionString.Contains("<", StringComparison.Ordinal);
|
||||
|
||||
services.Configure<SmtpSettings>(smtpSettingsconf)
|
||||
.Configure<IsndSettings>(isndSettingsconf)
|
||||
.Configure<AdminStartupList>(adminStartupListConf)
|
||||
.Configure<MigrationsEndPointOptions>(o => o.Path = "~/migrate")
|
||||
.AddDbContext<ApplicationDbContext>(options =>
|
||||
options.UseNpgsql(
|
||||
Configuration.GetConnectionString("DefaultConnection")))
|
||||
{
|
||||
if (useInMemoryDatabase)
|
||||
{
|
||||
options.UseInMemoryDatabase("isnd-tests");
|
||||
}
|
||||
else
|
||||
{
|
||||
options.UseNpgsql(connectionString);
|
||||
}
|
||||
})
|
||||
.AddIdentity<ApplicationUser, IdentityRole>()
|
||||
.AddRoles<IdentityRole>()
|
||||
.AddEntityFrameworkStores<ApplicationDbContext>()
|
||||
|
|
|
|||
|
|
@ -3,15 +3,8 @@
|
|||
foreach (string leashed in new string[] { "pkg-push", "pkg-get",
|
||||
"pkg-autocomplete","pkg-search","pkg-catalog"})
|
||||
{
|
||||
if (Model.UnleashClient.IsEnabled(leashed))
|
||||
{
|
||||
//do some magic
|
||||
<p>@leashed</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//do old boring stuff
|
||||
<p>No @leashed (disabled)</p>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -17,6 +17,7 @@
|
|||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.9" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.9" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="10.0.2" />
|
||||
</ItemGroup>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue