hi
I will ask our colleagues.
hi
In fact, I'm not particularly familiar with bUnit. : )
I also google the problem.
hi
Yes. You can give it a try.
hi
services.AddSingleton<AbpBlazorMessageLocalizerHelper<BookStoreResource>>();
using BookStore.Localization;
using Bunit;
using Microsoft.Extensions.DependencyInjection;
using Shouldly;
using Volo.Abp.AspNetCore.Components.Web;
using Xunit;
namespace BookStore.Blazor.Tests;
public class Index_Tests : BookStoreBlazorTestBase
{
protected override void AfterAddApplication(IServiceCollection services)
{
services.AddSingleton<AbpBlazorMessageLocalizerHelper<BookStoreResource>>();
base.AfterAddApplication(services);
}
[Fact]
public void Index_Test()
{
// Arrange
var ctx = CreateTestContext();
// var lh = GetRequiredService<AbpBlazorMessageLocalizerHelper<BookStoreResource>>();
// ctx.Services.AddSingleton(lh);
// Act
var cut = ctx.RenderComponent<BookStore.Blazor.Pages.Index>();
// Assert
cut.Find(".lead").InnerHtml.Contains("Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io.").ShouldBeTrue();
cut.Find("#username").InnerHtml.Contains("Welcome admin").ShouldBeTrue();
}
}
hi
Then I guess you have to override the setting component.
Btw, Does the database have any relevant logs?
hi
I think the context.RequestAborted happened. that is request is aborted
Can you share your web.config? This is not a code problem instead of environment.
Thanks.