< Summary

Class:MUNity.BlazorServer.Components.Conference.Application.DelegationApplicationForm
Assembly:MUNity.BlazorServer
File(s):C:\Users\aeuke\source\repos\PeerConradi\munity\src\MUNity.BlazorServer\Components\Conference\Application\DelegationApplicationForm.razor
Covered lines:0
Uncovered lines:49
Coverable lines:49
Total lines:80
Line coverage:0% (0 of 49)
Covered branches:0
Total branches:14
Branch coverage:0% (0 of 14)
Covered methods:0
Total methods:7
Method coverage:0% (0 of 7)

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
BuildRenderTree(...)0%100%
get_AuthStateTask()100%10%
get_ConferenceId()100%10%
.ctor()100%10%
get_StepChanged()100%10%
get_UseOnlineMode()100%10%
OnInitializedAsync()0%40%

File(s)

C:\Users\aeuke\source\repos\PeerConradi\munity\src\MUNity.BlazorServer\Components\Conference\Application\DelegationApplicationForm.razor

#LineLine coverage
 1@using Microsoft.EntityFrameworkCore
 2@using MUNity.BlazorServer.Components.Conference.Application
 3@using MUNity.Base
 4
 5@inject MUNity.Database.Context.MunityContext context
 6@inject UserManager<MUNity.Database.Models.User.MunityUser> userManager
 7
 08@if (application != null)
 09{
 10
 011    @if (step == 0)
 012    {
 013        <ApplicationUsersSelection ConferenceId="@ConferenceId" Application="application" UsersSelected="() => step = 1"
 014    }
 015    else if (step == 1)
 016    {
 17        <div class="row">
 018            <button class="btn btn-primary" @onclick="() => step = 0">Zurück zur Benutzerauswahl</button>
 19        </div>
 020        <SelectableDelegationsComponent Application="@application" ConferenceId="@ConferenceId" DelegationsAdded="() => 
 021    }
 022    else if (step == 2)
 023    {
 024        <DelegationApplicationFieldsComponent ConferenceId="@ConferenceId" Application="@application" Finished="() => st
 025    }
 026    else if (step == 3)
 027    {
 28        <ApplicationReviewComponent Application="@application" ConferenceId="@ConferenceId" />
 029    }
 030}
 31
 32
 33@code {
 034    [CascadingParameter] public Task<AuthenticationState> AuthStateTask { get; set; }
 35
 036    [Parameter] public string ConferenceId { get; set; }
 37
 038    private int step = 0;
 39
 040    [Parameter] public EventCallback<int> StepChanged { get; set; }
 41
 042    [Parameter] public bool UseOnlineMode { get; set; } = false;
 43
 44    private MUNity.Database.Models.Conference.DelegationApplication application;
 45
 46
 47    protected override async Task OnInitializedAsync()
 048    {
 049        await base.OnInitializedAsync();
 50
 051        application = new Database.Models.Conference.DelegationApplication()
 052        {
 053            Status = MUNity.Base.ApplicationStatuses.Writing,
 054            Conference = context.Conferences.Find(ConferenceId),
 055            ApplyDate = DateTime.Now
 056        };
 57
 058        var claim = (await AuthStateTask)?.User;
 059        var me = await userManager.GetUserAsync(claim);
 60
 061        application.Users = new List<MUNity.Database.Models.Conference.DelegationApplicationUserEntry>();
 062        application.Users.Add(new Database.Models.Conference.DelegationApplicationUserEntry()
 063        {
 064            Application = application,
 065            CanWrite = true,
 066            Status = DelegationApplicationUserEntryStatuses.Joined,
 067            User = me
 068        });
 69
 070        application.DelegationWishes = new List<MUNity.Database.Models.Conference.DelegationApplicationPickedDelegation>
 71
 072        application.FormulaInputs = new List<Database.Models.Conference.ConferenceDelegationApplicationFieldInput>();
 73
 74        // This is a quickfix to jump directly into the Delegation Selection
 075        if (UseOnlineMode)
 076        {
 077            this.step = 1;
 078        }
 079    }
 80}