Escali License control 1
IndexPageTest.razor
Gå til dokumentasjonen til denne filen.
1@inherits TestContext
2
3@code {
4 private void AddServices()
5 {
6 Services.AddDbContext<DataContext>();
7 Services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
8 Services.AddScoped<StateService>();
9 Services.AddScoped<AlertService>();
10
11 Services.AddScoped<CurrencyViewModel>();
12 Services.AddScoped<ProductViewModel>();
13 Services.AddScoped<ModuleViewModel>();
14 Services.AddScoped<SegmentViewModel>();
15 Services.AddScoped<MainSegmentViewModel>();
16 Services.AddScoped<PriceListViewModel>();
17 Services.AddScoped<UserViewModel>();
18 Services.AddScoped<CustomerViewModel>();
19 Services.AddScoped<PriorityViewModel>();
20 Services.AddScoped<RegionViewModel>();
21 Services.AddScoped<PriceElementViewModel>();
22 Services.AddScoped<AgreementViewModel>();
23 Services.AddScoped<AgreementElementViewModel>();
24 Services.AddScoped<ModuleLevelViewModel>();
25 }
26
27 [Fact]
28 public void RenderIndexPage_WithThreeComponents()
29 {
30 AddServices();
31 var page = Render(
32 @<Index />
33 );
34
35 page.FindComponent<UserTable>();
36 page.FindComponent<LeaderBoard>();
37 page.FindComponent<SalesInfo>();
38 }
39}