< Summary - Syki

Information
Class: Syki.Back.Features.Cross.SeedInstitutionData.SeedInstitutionUsersCommand
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Cross/SeedInstitutionData/SeedInstitutionUsersCommand.cs
Tag: 21_17346963026
Line coverage
0%
Covered lines: 0
Uncovered lines: 1
Coverable lines: 1
Total lines: 55
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_InstitutionId()100%210%

File(s)

/home/runner/work/syki/syki/Back/Features/Cross/SeedInstitutionData/SeedInstitutionUsersCommand.cs

#LineLine coverage
 1using Syki.Back.Features.Academic.CreateStudent;
 2using Syki.Back.Features.Academic.CreateTeacher;
 3
 4namespace Syki.Back.Features.Cross.SeedInstitutionData;
 5
 6[CommandDescription("Realizar seed de usuários da instituição")]
 07public record SeedInstitutionUsersCommand(Guid InstitutionId, Guid DireitoCourseOfferingId, Guid AdsCourseOfferingId) : 
 8
 9public class SeedInstitutionUsersCommandHandler(
 10    CreateTeacherService createTeacherService,
 11    CreateStudentService createStudentService) : ICommandHandler<SeedInstitutionUsersCommand>
 12{
 13    public async Task Handle(CommandId commandId, SeedInstitutionUsersCommand command)
 14    {
 15        var id = command.InstitutionId;
 16
 17        var teachers = new List<string>()
 18        {
 19            "Davi Pessoa Ferraz",
 20            "Luciete Bezerra Alves",
 21            "Manuela Abath Valença",
 22            "Paulo Marcelo Pedrosa de Almeida",
 23        };
 24        foreach (var name in teachers)
 25        {
 26            await createTeacherService.Create(id, CreateTeacherIn.Seed(name));
 27        }
 28
 29        var direitoStudents = new List<string>()
 30        {
 31            "Alisson Aranda de Aguiar",
 32            "Maria Júlia de Oliveira Melo",
 33            "Everton Ian de Galhardo Filho",
 34            "Alma Celeste Maldonado Mendonça",
 35        };
 36        foreach (var name in direitoStudents)
 37        {
 38            await createStudentService.Create(id, CreateStudentIn.Seed(name, command.DireitoCourseOfferingId));
 39        }
 40
 41        var adsStudents = new List<string>()
 42        {
 43            "Simone Bezerra",
 44            "Marcelo Lima Filho",
 45            "Josilda Aragão Paz",
 46            "Marlene de Oliveira",
 47            "Miguel Gomes da Silva",
 48            "Zaqueu do Vale Cavalcante",
 49        };
 50        foreach (var name in adsStudents)
 51        {
 52            await createStudentService.Create(id, CreateStudentIn.Seed(name, command.AdsCourseOfferingId));
 53        }
 54    }
 55}

Methods/Properties

get_InstitutionId()