Merging IntegrationTests.WebApp projects (#2051)

updating IntegrationTests.sln
This commit is contained in:
Eddy Nakamura 2020-09-15 18:05:32 -03:00 коммит произвёл GitHub
Родитель 0c5cd65849
Коммит 837b63f65c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
70 изменённых файлов: 201 добавлений и 1132 удалений

Просмотреть файл

@ -28,11 +28,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsServer", "WEB\Src\Wi
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TelemetryChannel", "BASE\src\ServerTelemetryChannel\TelemetryChannel.csproj", "{893DFA71-0F4F-4BBF-AE8F-72208BE237BA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests.WebApp.2.1", "NETCORE\test\IntegrationTests.WebApp.2.1\IntegrationTests.WebApp.2.1.csproj", "{FB0D665A-FB75-487C-9164-57023369527F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests.WebApp.3.1", "NETCORE\test\IntegrationTests.WebApp.3.1\IntegrationTests.WebApp.3.1.csproj", "{97F94E43-702E-49B0-8570-9EF7547E1FE0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests.WebApp.5.0", "NETCORE\test\IntegrationTests.WebApp.5.0\IntegrationTests.WebApp.5.0.csproj", "{2FF06805-B8B6-4B7D-8084-F6718F9C7054}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests.WebApp", "NETCORE\test\IntegrationTests.WebApp\IntegrationTests.WebApp.csproj", "{B0899552-34A3-4BFB-8502-F966BF409FDA}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
@ -87,18 +83,10 @@ Global
{893DFA71-0F4F-4BBF-AE8F-72208BE237BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{893DFA71-0F4F-4BBF-AE8F-72208BE237BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{893DFA71-0F4F-4BBF-AE8F-72208BE237BA}.Release|Any CPU.Build.0 = Release|Any CPU
{FB0D665A-FB75-487C-9164-57023369527F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FB0D665A-FB75-487C-9164-57023369527F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FB0D665A-FB75-487C-9164-57023369527F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FB0D665A-FB75-487C-9164-57023369527F}.Release|Any CPU.Build.0 = Release|Any CPU
{97F94E43-702E-49B0-8570-9EF7547E1FE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{97F94E43-702E-49B0-8570-9EF7547E1FE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{97F94E43-702E-49B0-8570-9EF7547E1FE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{97F94E43-702E-49B0-8570-9EF7547E1FE0}.Release|Any CPU.Build.0 = Release|Any CPU
{2FF06805-B8B6-4B7D-8084-F6718F9C7054}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2FF06805-B8B6-4B7D-8084-F6718F9C7054}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2FF06805-B8B6-4B7D-8084-F6718F9C7054}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2FF06805-B8B6-4B7D-8084-F6718F9C7054}.Release|Any CPU.Build.0 = Release|Any CPU
{B0899552-34A3-4BFB-8502-F966BF409FDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B0899552-34A3-4BFB-8502-F966BF409FDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B0899552-34A3-4BFB-8502-F966BF409FDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B0899552-34A3-4BFB-8502-F966BF409FDA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

Просмотреть файл

@ -61,11 +61,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionalTests.MVC.Tests",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionalTests.WebApi.Tests", "test\FunctionalTests.WebApi.Tests\FunctionalTests.WebApi.Tests.csproj", "{E78404EA-CBAA-4366-B659-C3A46BC9DF15}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests.WebApp.3.1", "test\IntegrationTests.WebApp.3.1\IntegrationTests.WebApp.3.1.csproj", "{2EB6FF02-DB25-423A-A8FC-1E249BE4CEDB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests.WebApp.2.1", "test\IntegrationTests.WebApp.2.1\IntegrationTests.WebApp.2.1.csproj", "{78A86267-EBB6-4720-8AC8-102B47D26D21}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests.WebApp.5.0", "test\IntegrationTests.WebApp.5.0\IntegrationTests.WebApp.5.0.csproj", "{851ECB16-8469-4D92-B6B8-B6F3DC3A4C57}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests.WebApp", "test\IntegrationTests.WebApp\IntegrationTests.WebApp.csproj", "{AFB5577E-1560-468C-91C7-042080202478}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
@ -150,18 +146,10 @@ Global
{E78404EA-CBAA-4366-B659-C3A46BC9DF15}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E78404EA-CBAA-4366-B659-C3A46BC9DF15}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E78404EA-CBAA-4366-B659-C3A46BC9DF15}.Release|Any CPU.Build.0 = Release|Any CPU
{2EB6FF02-DB25-423A-A8FC-1E249BE4CEDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2EB6FF02-DB25-423A-A8FC-1E249BE4CEDB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2EB6FF02-DB25-423A-A8FC-1E249BE4CEDB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2EB6FF02-DB25-423A-A8FC-1E249BE4CEDB}.Release|Any CPU.Build.0 = Release|Any CPU
{78A86267-EBB6-4720-8AC8-102B47D26D21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{78A86267-EBB6-4720-8AC8-102B47D26D21}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78A86267-EBB6-4720-8AC8-102B47D26D21}.Release|Any CPU.ActiveCfg = Release|Any CPU
{78A86267-EBB6-4720-8AC8-102B47D26D21}.Release|Any CPU.Build.0 = Release|Any CPU
{851ECB16-8469-4D92-B6B8-B6F3DC3A4C57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{851ECB16-8469-4D92-B6B8-B6F3DC3A4C57}.Debug|Any CPU.Build.0 = Debug|Any CPU
{851ECB16-8469-4D92-B6B8-B6F3DC3A4C57}.Release|Any CPU.ActiveCfg = Release|Any CPU
{851ECB16-8469-4D92-B6B8-B6F3DC3A4C57}.Release|Any CPU.Build.0 = Release|Any CPU
{AFB5577E-1560-468C-91C7-042080202478}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AFB5577E-1560-468C-91C7-042080202478}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AFB5577E-1560-468C-91C7-042080202478}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AFB5577E-1560-468C-91C7-042080202478}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -185,9 +173,7 @@ Global
{63F64005-CDC7-4062-8CBC-A40B049E342A} = {8B5230E5-8138-44D6-839F-DF9248F195EE}
{9693CC30-A3E6-48A7-A68E-6E0DD098D779} = {8B5230E5-8138-44D6-839F-DF9248F195EE}
{E78404EA-CBAA-4366-B659-C3A46BC9DF15} = {8B5230E5-8138-44D6-839F-DF9248F195EE}
{2EB6FF02-DB25-423A-A8FC-1E249BE4CEDB} = {8B5230E5-8138-44D6-839F-DF9248F195EE}
{78A86267-EBB6-4720-8AC8-102B47D26D21} = {8B5230E5-8138-44D6-839F-DF9248F195EE}
{851ECB16-8469-4D92-B6B8-B6F3DC3A4C57} = {8B5230E5-8138-44D6-839F-DF9248F195EE}
{AFB5577E-1560-468C-91C7-042080202478} = {8B5230E5-8138-44D6-839F-DF9248F195EE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {047855A4-470F-43B1-8B74-69651DD6B8A6}

Просмотреть файл

@ -19,6 +19,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<ProjectReference Include="..\IntegrationTests.WebApp\IntegrationTests.WebApp.csproj" />
</ItemGroup>
<ItemGroup>
@ -28,17 +30,14 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<ProjectReference Include="..\IntegrationTests.WebApp.5.0\IntegrationTests.WebApp.5.0.csproj" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="5.0.0-preview.8.20414.8" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<ProjectReference Include="..\IntegrationTests.WebApp.3.1\IntegrationTests.WebApp.3.1.csproj" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.3" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
<ProjectReference Include="..\IntegrationTests.WebApp.2.1\IntegrationTests.WebApp.2.1.csproj" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="2.1.1" />
</ItemGroup>

Просмотреть файл

@ -1,4 +1,5 @@
using Microsoft.ApplicationInsights.Channel;
using IntegrationTests.WebApp;
using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.DataContracts;
using System;
using System.Collections.Concurrent;
@ -8,24 +9,37 @@ using System.Net.Http;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
#if NET5_0
using IntegrationTests.WebApp._5._0;
#elif NETCOREAPP3_1
using IntegrationTests.WebApp._3._1;
#else
using IntegrationTests.WebApp._2._1;
#endif
namespace IntegrationTests.Tests
{
public partial class RequestCollectionTest : IClassFixture<CustomWebApplicationFactory<Startup>>
public partial class RequestCollectionTest :
#if NET5_0
IClassFixture<CustomWebApplicationFactory<Startup_net_5_0>>
#elif NETCOREAPP3_1
IClassFixture<CustomWebApplicationFactory<Startup_netcoreapp_3_1>>
#else
IClassFixture<CustomWebApplicationFactory<Startup_netcoreapp_2_1>>
#endif
{
private readonly CustomWebApplicationFactory<Startup> _factory;
#if NET5_0
private readonly CustomWebApplicationFactory<Startup_net_5_0> _factory;
#elif NETCOREAPP3_1
private readonly CustomWebApplicationFactory<Startup_netcoreapp_3_1> _factory;
#else
private readonly CustomWebApplicationFactory<Startup_netcoreapp_2_1> _factory;
#endif
protected readonly ITestOutputHelper output;
public RequestCollectionTest(CustomWebApplicationFactory<Startup> factory, ITestOutputHelper output)
public RequestCollectionTest(CustomWebApplicationFactory<
#if NET5_0
Startup_net_5_0
#elif NETCOREAPP3_1
Startup_netcoreapp_3_1
#else
Startup_netcoreapp_2_1
#endif
> factory, ITestOutputHelper output)
{
this.output = output;
_factory = factory;
@ -37,7 +51,7 @@ namespace IntegrationTests.Tests
{
// Arrange
var client = _factory.CreateClient();
var path = "Home/Privacy";
var path = "Home/Empty";
var url = client.BaseAddress + path;
// Act
@ -71,8 +85,8 @@ namespace IntegrationTests.Tests
{
// Arrange
var client = _factory.CreateClient();
var path = "Home/Index/5";
var expectedName = "GET Home/Index [id]";
var path = "Home/5";
var expectedName = "GET Home/Get [id]";
var url = client.BaseAddress + path;
// Act
@ -153,7 +167,7 @@ namespace IntegrationTests.Tests
{
// Arrange
var client = _factory.CreateClient();
var path = "Home/Nonexistent";
var path = "Nonexistent";
var url = client.BaseAddress + path;
// Act

Просмотреть файл

@ -9,24 +9,25 @@ using System.Net.Http;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
#if NET5_0
using IntegrationTests.WebApp._5._0;
#elif NETCOREAPP3_1
using IntegrationTests.WebApp._3._1;
#else
using IntegrationTests.WebApp._2._1;
#endif
using IntegrationTests.WebApp;
namespace IntegrationTests.Tests
{
public partial class RequestCollectionTest : IClassFixture<CustomWebApplicationFactory<Startup>>
public partial class RequestCollectionTest :
#if NET5_0
IClassFixture<CustomWebApplicationFactory<Startup_net_5_0>>
#elif NETCOREAPP3_1
IClassFixture<CustomWebApplicationFactory<Startup_netcoreapp_3_1>>
#else
IClassFixture<CustomWebApplicationFactory<Startup_netcoreapp_2_1>>
#endif
{
[Fact]
public async Task RequestSuccessWithTraceParent()
{
// Arrange
var client = _factory.CreateClient();
var path = "Home/Index";
var path = "Home";
var url = client.BaseAddress + path;
// Act
@ -67,7 +68,7 @@ namespace IntegrationTests.Tests
ValidateRequest(
requestTelemetry: req,
expectedResponseCode: "200",
expectedName: "GET " + path,
expectedName: "GET " + path + "/Get",
expectedUrl: url,
expectedSuccess: true);
}
@ -125,7 +126,7 @@ namespace IntegrationTests.Tests
{
// Arrange
var client = _factory.CreateClient();
var path = "Home/Index";
var path = "Home";
var url = client.BaseAddress + path;
// Act
@ -165,7 +166,7 @@ namespace IntegrationTests.Tests
ValidateRequest(
requestTelemetry: req,
expectedResponseCode: "200",
expectedName: "GET " + path,
expectedName: "GET " + path + "/Get",
expectedUrl: url,
expectedSuccess: true);
}
@ -223,7 +224,7 @@ namespace IntegrationTests.Tests
{
// Arrange
var client = _factory.CreateClient();
var path = "Home/Index";
var path = "Home";
var url = client.BaseAddress + path;
// Act
@ -264,7 +265,7 @@ namespace IntegrationTests.Tests
ValidateRequest(
requestTelemetry: req,
expectedResponseCode: "200",
expectedName: "GET " + path,
expectedName: "GET " + path + "/Get",
expectedUrl: url,
expectedSuccess: true);
}

Просмотреть файл

@ -13,37 +13,31 @@ using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.ApplicationInsights;
#if NET5_0
using IntegrationTests.WebApp._5._0;
#elif NETCOREAPP3_1
using IntegrationTests.WebApp._3._1;
#else
using IntegrationTests.WebApp._2._1;
#endif
using IntegrationTests.WebApp;
namespace IntegrationTests.Tests
{
public partial class RequestCollectionTest : IClassFixture<CustomWebApplicationFactory<Startup>>
public partial class RequestCollectionTest :
#if NET5_0
IClassFixture<CustomWebApplicationFactory<Startup_net_5_0>>
#elif NETCOREAPP3_1
IClassFixture<CustomWebApplicationFactory<Startup_netcoreapp_3_1>>
#else
IClassFixture<CustomWebApplicationFactory<Startup_netcoreapp_2_1>>
#endif
{
[Fact]
public async Task RequestILoggerUserConfigOverRidesDefaultLevel()
{
// Arrange
#if NET5_0
var loggerCategory = "IntegrationTests.WebApp._5._0.Controllers.HomeController";
#elif NETCOREAPP3_1
var loggerCategory = "IntegrationTests.WebApp._3._1.Controllers.HomeController";
#else
var loggerCategory = "IntegrationTests.WebApp._2._1.Controllers.HomeController";
#endif
var loggerCategory = "IntegrationTests.WebApp.Controllers.HomeController";
var client = _factory.WithWebHostBuilder(builder =>
builder.ConfigureTestServices((services) =>
services.AddLogging(logBuilder => logBuilder.AddFilter<ApplicationInsightsLoggerProvider>(loggerCategory, LogLevel.Information))
)).CreateClient();
var path = "Home/Index";
var path = "Home";
var url = client.BaseAddress + path;
// Act
@ -74,7 +68,7 @@ namespace IntegrationTests.Tests
ValidateRequest(
requestTelemetry: req,
expectedResponseCode: "200",
expectedName: "GET " + path,
expectedName: "GET " + path + "/Get",
expectedUrl: url,
expectedSuccess: true);
@ -87,7 +81,7 @@ namespace IntegrationTests.Tests
// Arrange
var client = _factory.CreateClient();
var path = "Home/Index";
var path = "Home";
var url = client.BaseAddress + path;
// Act
@ -117,11 +111,10 @@ namespace IntegrationTests.Tests
ValidateRequest(
requestTelemetry: req,
expectedResponseCode: "200",
expectedName: "GET " + path,
expectedName: "GET " + path + "/Get",
expectedUrl: url,
expectedSuccess: true);
}
}
}

Просмотреть файл

@ -1,53 +0,0 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using IntegrationTests.WebApp._2._1.Models;
namespace IntegrationTests.WebApp._2._1.Controllers
{
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
public HomeController(ILogger<HomeController> logger)
{
_logger = logger;
}
public IActionResult Index(int index)
{
_logger.LogWarning("sample warning");
_logger.LogInformation("sample information");
return View();
}
public IActionResult About()
{
ViewData["Message"] = "Your application description page.";
return View();
}
public IActionResult Contact()
{
ViewData["Message"] = "Your contact page.";
return View();
}
public IActionResult Privacy()
{
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
throw new Exception("sample exception");
}
}
}

Просмотреть файл

@ -1,24 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace IntegrationTests.WebApp._2._1
{
public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>();
}
}

Просмотреть файл

@ -1,7 +0,0 @@
@{
ViewData["Title"] = "About";
}
<h2>@ViewData["Title"]</h2>
<h3>@ViewData["Message"]</h3>
<p>Use this area to provide additional information.</p>

Просмотреть файл

@ -1,17 +0,0 @@
@{
ViewData["Title"] = "Contact";
}
<h2>@ViewData["Title"]</h2>
<h3>@ViewData["Message"]</h3>
<address>
One Microsoft Way<br />
Redmond, WA 98052-6399<br />
<abbr title="Phone">P:</abbr>
425.555.0100
</address>
<address>
<strong>Support:</strong> <a href="mailto:Support@example.com">Support@example.com</a><br />
<strong>Marketing:</strong> <a href="mailto:Marketing@example.com">Marketing@example.com</a>
</address>

Просмотреть файл

@ -1,94 +0,0 @@
@{
ViewData["Title"] = "Home Page";
}
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="6000">
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="~/images/banner1.svg" alt="ASP.NET" class="img-responsive" />
<div class="carousel-caption" role="option">
<p>
Learn how to build ASP.NET apps that can run anywhere.
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525028&clcid=0x409">
Learn More
</a>
</p>
</div>
</div>
<div class="item">
<img src="~/images/banner2.svg" alt="Visual Studio" class="img-responsive" />
<div class="carousel-caption" role="option">
<p>
There are powerful new features in Visual Studio for building modern web apps.
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525030&clcid=0x409">
Learn More
</a>
</p>
</div>
</div>
<div class="item">
<img src="~/images/banner3.svg" alt="Microsoft Azure" class="img-responsive" />
<div class="carousel-caption" role="option">
<p>
Learn how Microsoft's Azure cloud platform allows you to build, deploy, and scale web apps.
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525027&clcid=0x409">
Learn More
</a>
</p>
</div>
</div>
</div>
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<div class="row">
<div class="col-md-3">
<h2>Application uses</h2>
<ul>
<li>Sample pages using ASP.NET Core MVC</li>
<li>Theming using <a href="https://go.microsoft.com/fwlink/?LinkID=398939">Bootstrap</a></li>
</ul>
</div>
<div class="col-md-3">
<h2>How to</h2>
<ul>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=398600">Add a Controller and View</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699315">Manage User Secrets using Secret Manager.</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699316">Use logging to log a message.</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699317">Add packages using NuGet.</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699319">Target development, staging or production environment.</a></li>
</ul>
</div>
<div class="col-md-3">
<h2>Overview</h2>
<ul>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=518008">Conceptual overview of what is ASP.NET Core</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699320">Fundamentals of ASP.NET Core such as Startup and middleware.</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=398602">Working with Data</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkId=398603">Security</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=699321">Client side development</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=699322">Develop on different platforms</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=699323">Read more on the documentation site</a></li>
</ul>
</div>
<div class="col-md-3">
<h2>Run &amp; Deploy</h2>
<ul>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=517851">Run your app</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=517853">Run tools such as EF migrations and more</a></li>
<li><a href="https://go.microsoft.com/fwlink/?LinkID=398609">Publish to Microsoft Azure Web Apps</a></li>
</ul>
</div>
</div>

Просмотреть файл

@ -1,6 +0,0 @@
@{
ViewData["Title"] = "Privacy Policy";
}
<h2>@ViewData["Title"]</h2>
<p>Use this page to detail your site's privacy policy.</p>

Просмотреть файл

@ -1,22 +0,0 @@
@model ErrorViewModel
@{
ViewData["Title"] = "Error";
}
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
</p>
<p>
<strong>Development environment should not be enabled in deployed applications</strong>, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>, and restarting the application.
</p>

Просмотреть файл

@ -1,41 +0,0 @@
@using Microsoft.AspNetCore.Http.Features
@{
var consentFeature = Context.Features.Get<ITrackingConsentFeature>();
var showBanner = !consentFeature?.CanTrack ?? false;
var cookieString = consentFeature?.CreateConsentCookie();
}
@if (showBanner)
{
<nav id="cookieConsent" class="navbar navbar-default navbar-fixed-top" role="alert">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#cookieConsent .navbar-collapse">
<span class="sr-only">Toggle cookie consent banner</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span></span>
</div>
<div class="collapse navbar-collapse">
<p class="navbar-text">
Use this space to summarize your privacy and cookie use policy.
</p>
<div class="navbar-right">
<a asp-controller="Home" asp-action="Privacy" class="btn btn-info navbar-btn">Learn More</a>
<button type="button" class="btn btn-default navbar-btn" data-cookie-string="@cookieString">Accept</button>
</div>
</div>
</div>
</nav>
<script>
(function () {
document.querySelector("#cookieConsent button[data-cookie-string]").addEventListener("click", function (el) {
document.cookie = el.target.dataset.cookieString;
document.querySelector("#cookieConsent").classList.add("hidden");
}, false);
})();
</script>
}

Просмотреть файл

@ -1,74 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - IntegrationTests.WebApp._2._1</title>
<environment include="Development">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="~/css/site.css" />
</environment>
<environment exclude="Development">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" />
<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />
</environment>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a asp-area="" asp-controller="Home" asp-action="Index" class="navbar-brand">IntegrationTests.WebApp._2._1</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a asp-area="" asp-controller="Home" asp-action="Index">Home</a></li>
<li><a asp-area="" asp-controller="Home" asp-action="About">About</a></li>
<li><a asp-area="" asp-controller="Home" asp-action="Contact">Contact</a></li>
</ul>
</div>
</div>
</nav>
<partial name="_CookieConsentPartial" />
<div class="container body-content">
@RenderBody()
<hr />
<footer>
<p>&copy; 2020 - IntegrationTests.WebApp._2._1</p>
</footer>
</div>
<environment include="Development">
<script src="~/lib/jquery/dist/jquery.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
</environment>
<environment exclude="Development">
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.3.1.min.js"
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
asp-fallback-test="window.jQuery"
crossorigin="anonymous"
integrity="sha384-tsQFqpEReu7ZLhBV2VZlAu7zcOV+rXbYlF2cqB8txI/8aZajjp4Bqd+V6D5IgvKT">
</script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.min.js"
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
crossorigin="anonymous"
integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd">
</script>
<script src="~/js/site.min.js" asp-append-version="true"></script>
</environment>
@RenderSection("Scripts", required: false)
</body>
</html>

Просмотреть файл

@ -1,18 +0,0 @@
<environment include="Development">
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
</environment>
<environment exclude="Development">
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.17.0/jquery.validate.min.js"
asp-fallback-src="~/lib/jquery-validation/dist/jquery.validate.min.js"
asp-fallback-test="window.jQuery && window.jQuery.validator"
crossorigin="anonymous"
integrity="sha384-rZfj/ogBloos6wzLGpPkkOr/gpkBNLZ6b6yLy4o+ok+t/SAKlL5mvXLr0OXNi1Hp">
</script>
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validation.unobtrusive/3.2.9/jquery.validate.unobtrusive.min.js"
asp-fallback-src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"
asp-fallback-test="window.jQuery && window.jQuery.validator && window.jQuery.validator.unobtrusive"
crossorigin="anonymous"
integrity="sha384-ifv0TYDWxBHzvAk2Z0n8R434FL1Rlv/Av18DXE43N/1rvHyOG4izKst0f2iSLdds">
</script>
</environment>

Просмотреть файл

@ -1,3 +0,0 @@
@using IntegrationTests.WebApp._2._1
@using IntegrationTests.WebApp._2._1.Models
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

Просмотреть файл

@ -1,3 +0,0 @@
@{
Layout = "_Layout";
}

Просмотреть файл

@ -1,37 +0,0 @@
/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification\
for details on configuring this project to bundle and minify static web assets. */
body {
padding-top: 50px;
padding-bottom: 20px;
}
/* Wrapping element */
/* Set some basic padding to keep content from hitting the edges */
.body-content {
padding-left: 15px;
padding-right: 15px;
}
/* Carousel */
.carousel-caption p {
font-size: 20px;
line-height: 1.4;
}
/* Make .svg files in the carousel display properly in older browsers */
.carousel-inner .item img[src$=".svg"] {
width: 100%;
}
/* QR code generator */
#qrCode {
margin: 15px;
}
/* Hide/rearrange for smaller screens */
@media screen and (max-width: 767px) {
/* Hide captions */
.carousel-caption {
display: none;
}
}

Просмотреть файл

@ -1 +0,0 @@
body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}}

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 31 KiB

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

До

Ширина:  |  Высота:  |  Размер: 9.5 KiB

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

До

Ширина:  |  Высота:  |  Размер: 8.2 KiB

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

До

Ширина:  |  Высота:  |  Размер: 12 KiB

Просмотреть файл

@ -1,4 +0,0 @@
// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.
// Write your JavaScript code.

Просмотреть файл

Просмотреть файл

@ -1,39 +0,0 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using IntegrationTests.WebApp._3._1.Models;
namespace IntegrationTests.WebApp._3._1.Controllers
{
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
public HomeController(ILogger<HomeController> logger)
{
_logger = logger;
}
public IActionResult Index(int index)
{
_logger.LogWarning("sample warning");
_logger.LogInformation("sample information");
return View();
}
public IActionResult Privacy()
{
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
throw new Exception("sample exception");
}
}
}

Просмотреть файл

@ -1,12 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>IntegrationTests.WebApp._3._1</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.ApplicationInsights.AspNetCore\Microsoft.ApplicationInsights.AspNetCore.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,11 +0,0 @@
using System;
namespace IntegrationTests.WebApp._3._1.Models
{
public class ErrorViewModel
{
public string RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
}
}

Просмотреть файл

@ -1,26 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace IntegrationTests.WebApp._3._1
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}

Просмотреть файл

@ -1,27 +0,0 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:2060",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IntegrationTests.WebApp._3._1": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

Просмотреть файл

@ -1,8 +0,0 @@
@{
ViewData["Title"] = "Home Page";
}
<div class="text-center">
<h1 class="display-4">Welcome</h1>
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
</div>

Просмотреть файл

@ -1,6 +0,0 @@
@{
ViewData["Title"] = "Privacy Policy";
}
<h1>@ViewData["Title"]</h1>
<p>Use this page to detail your site's privacy policy.</p>

Просмотреть файл

@ -1,25 +0,0 @@
@model ErrorViewModel
@{
ViewData["Title"] = "Error";
}
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>

Просмотреть файл

@ -1,48 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - IntegrationTests.WebApp._3._1</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" />
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">IntegrationTests.WebApp._3._1</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2020 - IntegrationTests.WebApp._3._1 - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
</div>
</footer>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
@RenderSection("Scripts", required: false)
</body>
</html>

Просмотреть файл

@ -1,2 +0,0 @@
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>

Просмотреть файл

@ -1,3 +0,0 @@
@using IntegrationTests.WebApp._3._1
@using IntegrationTests.WebApp._3._1.Models
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

Просмотреть файл

@ -1,3 +0,0 @@
@{
Layout = "_Layout";
}

Просмотреть файл

@ -1,9 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}

Просмотреть файл

@ -1,10 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}

Просмотреть файл

@ -1,71 +0,0 @@
/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */
a.navbar-brand {
white-space: normal;
text-align: center;
word-break: break-all;
}
/* Provide sufficient contrast against white background */
a {
color: #0366d6;
}
.btn-primary {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}
/* Sticky footer styles
-------------------------------------------------- */
html {
font-size: 14px;
}
@media (min-width: 768px) {
html {
font-size: 16px;
}
}
.border-top {
border-top: 1px solid #e5e5e5;
}
.border-bottom {
border-bottom: 1px solid #e5e5e5;
}
.box-shadow {
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}
button.accept-policy {
font-size: 1rem;
line-height: inherit;
}
/* Sticky footer styles
-------------------------------------------------- */
html {
position: relative;
min-height: 100%;
}
body {
/* Margin bottom by footer height */
margin-bottom: 60px;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
white-space: nowrap;
line-height: 60px; /* Vertically center the text there */
}

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 31 KiB

Просмотреть файл

@ -1,4 +0,0 @@
// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.
// Write your JavaScript code.

Просмотреть файл

@ -1,40 +0,0 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using IntegrationTests.WebApp._5._0.Models;
namespace IntegrationTests.WebApp._5._0.Controllers
{
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
public HomeController(ILogger<HomeController> logger)
{
_logger = logger;
}
public IActionResult Index()
{
_logger.LogWarning("sample warning");
_logger.LogInformation("sample information");
return View();
}
public IActionResult Privacy()
{
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
throw new Exception("sample exception");
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
}
}

Просмотреть файл

@ -1,12 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>IntegrationTests.WebApp._5._0</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.ApplicationInsights.AspNetCore\Microsoft.ApplicationInsights.AspNetCore.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,11 +0,0 @@
using System;
namespace IntegrationTests.WebApp._5._0.Models
{
public class ErrorViewModel
{
public string RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
}
}

Просмотреть файл

@ -1,26 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace IntegrationTests.WebApp._5._0
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}

Просмотреть файл

@ -1,28 +0,0 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:20513",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IntegrationTests.WebApp._5._0": {
"commandName": "Project",
"dotnetRunMessages": "true",
"launchBrowser": true,
"applicationUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

Просмотреть файл

@ -1,8 +0,0 @@
@{
ViewData["Title"] = "Home Page";
}
<div class="text-center">
<h1 class="display-4">Welcome</h1>
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
</div>

Просмотреть файл

@ -1,6 +0,0 @@
@{
ViewData["Title"] = "Privacy Policy";
}
<h1>@ViewData["Title"]</h1>
<p>Use this page to detail your site's privacy policy.</p>

Просмотреть файл

@ -1,25 +0,0 @@
@model ErrorViewModel
@{
ViewData["Title"] = "Error";
}
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>

Просмотреть файл

@ -1,48 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - IntegrationTests.WebApp._5._0</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" />
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">IntegrationTests.WebApp._5._0</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2020 - IntegrationTests.WebApp._5._0 - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
</div>
</footer>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
@await RenderSectionAsync("Scripts", required: false)
</body>
</html>

Просмотреть файл

@ -1,2 +0,0 @@
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>

Просмотреть файл

@ -1,3 +0,0 @@
@using IntegrationTests.WebApp._5._0
@using IntegrationTests.WebApp._5._0.Models
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

Просмотреть файл

@ -1,3 +0,0 @@
@{
Layout = "_Layout";
}

Просмотреть файл

@ -1,9 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}

Просмотреть файл

@ -1,10 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}

Просмотреть файл

@ -1,71 +0,0 @@
/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */
a.navbar-brand {
white-space: normal;
text-align: center;
word-break: break-all;
}
/* Provide sufficient contrast against white background */
a {
color: #0366d6;
}
.btn-primary {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}
/* Sticky footer styles
-------------------------------------------------- */
html {
font-size: 14px;
}
@media (min-width: 768px) {
html {
font-size: 16px;
}
}
.border-top {
border-top: 1px solid #e5e5e5;
}
.border-bottom {
border-bottom: 1px solid #e5e5e5;
}
.box-shadow {
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}
button.accept-policy {
font-size: 1rem;
line-height: inherit;
}
/* Sticky footer styles
-------------------------------------------------- */
html {
position: relative;
min-height: 100%;
}
body {
/* Margin bottom by footer height */
margin-bottom: 60px;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
white-space: nowrap;
line-height: 60px; /* Vertically center the text there */
}

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 5.3 KiB

Просмотреть файл

@ -1,4 +0,0 @@
// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.
// Write your JavaScript code.

Просмотреть файл

@ -0,0 +1,52 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace IntegrationTests.WebApp.Controllers
{
[Route("[controller]")]
[ApiController]
public class HomeController : ControllerBase
{
private readonly ILogger<HomeController> _logger;
public HomeController(ILogger<HomeController> logger)
{
_logger = logger;
}
// GET api/values
[HttpGet]
public ActionResult Get()
{
_logger.LogWarning("sample warning");
_logger.LogInformation("sample information");
return new OkResult();
}
// GET api/values/5
[HttpGet("{id}")]
public ActionResult<string> Get(int id)
{
_logger.LogWarning("sample warning");
_logger.LogInformation("sample information");
return "value";
}
[HttpGet("Empty")]
public ActionResult Empty()
{
return new OkResult();
}
[HttpGet("Error")]
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public ActionResult Error()
{
throw new Exception("sample exception");
}
}
}

Просмотреть файл

@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1;net5.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.ApplicationInsights.AspNetCore\Microsoft.ApplicationInsights.AspNetCore.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,6 +1,6 @@
using System;
namespace IntegrationTests.WebApp._2._1.Models
namespace IntegrationTests.WebApp.Models
{
public class ErrorViewModel
{

Просмотреть файл

@ -0,0 +1,51 @@
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace IntegrationTests.WebApp
{
public class Program
{
#if NETCOREAPP2_1
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup_netcoreapp_2_1>();
#elif NET5_0
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup_net_5_0>();
});
#else
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup_netcoreapp_3_1>();
});
#endif
}
}

Просмотреть файл

@ -1,7 +1,7 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:2469",
"sslPort": 0

Просмотреть файл

@ -1,3 +1,4 @@
#if NET5_0
using System;
using System.Collections.Generic;
using System.Linq;
@ -8,11 +9,11 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace IntegrationTests.WebApp._5._0
namespace IntegrationTests.WebApp
{
public class Startup
public class Startup_net_5_0
{
public Startup(IConfiguration configuration)
public Startup_net_5_0(IConfiguration configuration)
{
Configuration = configuration;
}
@ -36,7 +37,6 @@ namespace IntegrationTests.WebApp._5._0
{
app.UseExceptionHandler("/Home/Error");
}
app.UseStaticFiles();
app.UseRouting();
@ -51,3 +51,4 @@ namespace IntegrationTests.WebApp._5._0
}
}
}
#endif

Просмотреть файл

@ -1,4 +1,5 @@
using System;
#if NETCOREAPP2_1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@ -9,11 +10,11 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace IntegrationTests.WebApp._2._1
namespace IntegrationTests.WebApp
{
public class Startup
public class Startup_netcoreapp_2_1
{
public Startup(IConfiguration configuration)
public Startup_netcoreapp_2_1(IConfiguration configuration)
{
Configuration = configuration;
}
@ -30,7 +31,6 @@ namespace IntegrationTests.WebApp._2._1
options.MinimumSameSitePolicy = SameSiteMode.None;
});
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
}
@ -46,7 +46,6 @@ namespace IntegrationTests.WebApp._2._1
app.UseExceptionHandler("/Home/Error");
}
app.UseStaticFiles();
app.UseCookiePolicy();
app.UseMvc(routes =>
@ -58,3 +57,4 @@ namespace IntegrationTests.WebApp._2._1
}
}
}
#endif

Просмотреть файл

@ -1,3 +1,4 @@
#if NETCOREAPP3_1
using System;
using System.Collections.Generic;
using System.Linq;
@ -8,11 +9,11 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace IntegrationTests.WebApp._3._1
namespace IntegrationTests.WebApp
{
public class Startup
public class Startup_netcoreapp_3_1
{
public Startup(IConfiguration configuration)
public Startup_netcoreapp_3_1(IConfiguration configuration)
{
Configuration = configuration;
}
@ -36,7 +37,6 @@ namespace IntegrationTests.WebApp._3._1
{
app.UseExceptionHandler("/Home/Error");
}
app.UseStaticFiles();
app.UseRouting();
@ -51,3 +51,4 @@ namespace IntegrationTests.WebApp._3._1
}
}
}
#endif