/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/ProjectTemplates/test/Templates.Tests/BlazorWasmServiceDefaultsTemplateTest.cs
60 строк
2 KB
Javier Calvarro Nelson
[Blazor] Align gateway and templates with Aspire implementation (#67048)
16 июн 2026, 12:57
Не верифицирован
16 июн 2026, 12:57
8854c58
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.AspNetCore.InternalTesting; using Templates.Test.Helpers; using Xunit.Abstractions; namespace Templates.Test; #pragma warning disable xUnit1041 // Fixture arguments to test classes must have fixture sources public class BlazorWasmServiceDefaultsTemplateTest : LoggedTest { public BlazorWasmServiceDefaultsTemplateTest(ProjectFactoryFixture projectFactory) { ProjectFactory = projectFactory; } public ProjectFactoryFixture ProjectFactory { get; } private ITestOutputHelper _output; public ITestOutputHelper Output { get { if (_output == null) { _output = new TestOutputLogger(Logger); } return _output; } } [Fact] public async Task BlazorWasmServiceDefaultsTemplateAsync() { var project = await ProjectFactory.CreateProject(Output); await project.RunDotNetNewAsync("blazorwasm-servicedefaults"); await project.RunDotNetPublishAsync(); // Run dotnet build after publish. The reason is that one uses Config = Debug and the other uses Config = Release // The output from publish will go into bin/Release/netcoreappX.Y/publish and won't be affected by calling build // later, while the opposite is not true. await project.RunDotNetBuildAsync(); } [Fact] public async Task BlazorWasmServiceDefaultsTemplate_HostedAsync() { var project = await ProjectFactory.CreateProject(Output); await project.RunDotNetNewAsync("blazorwasm-servicedefaults", args: new[] { "--hosted" }); await project.RunDotNetPublishAsync(); await project.RunDotNetBuildAsync(); } }