< Summary

Information
Class: Syki.Front.Features.Academic.CrossLogin.CrossLoginClient
Assembly: Front
File(s): /home/runner/work/syki/syki/Front/Features/Academic/CrossLogin/CrossLoginClient.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 9
Uncovered lines: 0
Coverable lines: 9
Total lines: 21
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
Login()100%22100%

File(s)

/home/runner/work/syki/syki/Front/Features/Academic/CrossLogin/CrossLoginClient.cs

#LineLine coverage
 1using Microsoft.JSInterop;
 2
 3namespace Syki.Front.Features.Academic.CrossLogin;
 4
 65public class CrossLoginClient(HttpClient http, ILocalStorageService localStorage, SykiAuthStateProvider authStateProvide
 6{
 7    public async Task<OneOf<CrossLoginOut, ErrorOut>> Login(Guid targetUserId)
 8    {
 69        var body = new CrossLoginIn { TargetUserId = targetUserId };
 610        var response = await http.PostAsJsonAsync("/academic/cross-login", body);
 11
 612        var result = await response.Resolve<CrossLoginOut>();
 13
 1014        if (result.IsError()) return result.GetError();
 15
 216        await localStorage.SetItemAsync("AccessToken", result.GetSuccess().AccessToken);
 217        authStateProvider.MarkUserAsAuthenticated();
 18
 219        return result;
 620    }
 21}