public async Task Cannot_update_non_existing_group()
        {
            var request = new GroupUpdate.Request
            {
                Id   = 1,
                Name = "S3 - Timo",
            };
            var useCase = new GroupUpdate(new ProgressContext(Fixture.ContextOptions));

            var result = await useCase.HandleAsync(request);

            result.IsFailure.Should().BeTrue();
            result.Error.Should().Contain("exist");
        }
        public async Task Can_update_group()
        {
            var group   = Fixture.DataMother.CreateGroup();
            var request = new GroupUpdate.Request
            {
                Id        = group.Id,
                Name      = "S3 - Timo",
                StartDate = new DateTime(2021, 9, 1),
                Mnemonic  = "Denk hier aan!"
            };
            var useCase = new GroupUpdate(new ProgressContext(Fixture.ContextOptions));

            var result = await useCase.HandleAsync(request);

            result.IsSuccess.Should().BeTrue();
            var groupUpdated = Fixture.DataMother.Query <StudentGroup>();

            groupUpdated
            .ShouldExist()
            .HasName("S3 - Timo")
            .HasPeriod((Period) new DateTime(2021, 9, 1))
            .HasMnemonic("Denk hier aan!");
        }
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var group = await _context.Groups.FirstOrDefaultAsync(m => m.Id == id);

            if (group == null)
            {
                return(NotFound());
            }

            StudentGroup = new GroupUpdate.Request
            {
                Id        = group.Id,
                Mnemonic  = group.Mnemonic,
                Name      = group.Name,
                StartDate = group.Period
            };
            return(Page());
        }