Kapitel 3.1: Mitarbeit-Aspekte pro Gruppe verwalten (3.1.1/3.1.2/3.1.4)
Neuer Button "Aspekte verwalten" im Mitarbeit-Tab öffnet ParticipationAspectsDialog: Anlegen, Bezeichnung/Typ/Gewichtung/Aktiv-Status bearbeiten (speichert sofort, gleiches Muster wie die bestehende Gewichtungs-Bearbeitung in 3.2.1), Hoch/Runter-Reihenfolge, Löschen mit Rückfrage. Verwaltet bewusst nur die gruppenspezifischen Aspekte, nicht den bislang nirgends befüllten globalen Standardkatalog. Schlüssel ist nur beim Neuanlegen editierbar - er verknüpft AspectRating mit dem Aspekt per Key, ein nachträgliches Umbenennen würde historische Bewertungen unauffindbar machen. IParticipationAspectRepository.Save validiert jetzt Pflichtfelder und Schlüssel-Eindeutigkeit gegen globale Standards UND eigene Gruppen-Aspekte zusammen, da beide im Bewertungsraster kombiniert verwendet werden. Neue GetAllByGroup-Methode (inkl. inaktiver) für die Verwaltungsansicht. 3.1.3 (Scale3/Binary/Points im Bewertungsraster selbst) bewusst nicht angefasst - eigener, größerer Eingriff in die Bewertungs-UI. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -376,6 +376,58 @@ public sealed class RepositoryTests
|
||||
Assert.Null(repo.GetById(subject.Id));
|
||||
}
|
||||
|
||||
// ── ParticipationAspectRepository (3.1) ───────────────────────────────────
|
||||
|
||||
[Fact]
|
||||
public void ParticipationAspectRepository_Save_LehntLeerenSchluesselUndBezeichnungAb()
|
||||
{
|
||||
using var db = NewInMemoryContext();
|
||||
var repo = new ParticipationAspectRepository(db);
|
||||
var groupId = Guid.NewGuid();
|
||||
|
||||
Assert.Throws<ArgumentException>(() => repo.Save(new ParticipationAspect { GroupId = groupId, Key = " ", Label = "Experiment" }));
|
||||
Assert.Throws<ArgumentException>(() => repo.Save(new ParticipationAspect { GroupId = groupId, Key = "experiment", Label = " " }));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParticipationAspectRepository_Save_LehntDuplikatSchluesselInnerhalbDerGruppeAb()
|
||||
{
|
||||
using var db = NewInMemoryContext();
|
||||
var repo = new ParticipationAspectRepository(db);
|
||||
var groupId = Guid.NewGuid();
|
||||
repo.Save(new ParticipationAspect { GroupId = groupId, Key = "experiment", Label = "Experiment" });
|
||||
|
||||
Assert.Throws<InvalidOperationException>(() =>
|
||||
repo.Save(new ParticipationAspect { GroupId = groupId, Key = "Experiment", Label = "Anderes Label" }));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParticipationAspectRepository_Save_LehntDuplikatGegenGlobalenStandardAb()
|
||||
{
|
||||
using var db = NewInMemoryContext();
|
||||
var repo = new ParticipationAspectRepository(db);
|
||||
var groupId = Guid.NewGuid();
|
||||
repo.Save(new ParticipationAspect { GroupId = null, Key = "quality", Label = "Qualität" });
|
||||
|
||||
// Gleicher Schlüssel wie ein globaler Standardaspekt wäre in der Bewertungsübersicht
|
||||
// dieser Gruppe eine mehrdeutige Spalte (siehe ParticipationTabViewModel.LoadAspects).
|
||||
Assert.Throws<InvalidOperationException>(() =>
|
||||
repo.Save(new ParticipationAspect { GroupId = groupId, Key = "quality", Label = "Andere Qualität" }));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParticipationAspectRepository_GetByGroup_FiltertInaktiveAus_GetAllByGroupNicht()
|
||||
{
|
||||
using var db = NewInMemoryContext();
|
||||
var repo = new ParticipationAspectRepository(db);
|
||||
var groupId = Guid.NewGuid();
|
||||
repo.Save(new ParticipationAspect { GroupId = groupId, Key = "a", Label = "Aktiv", IsActive = true });
|
||||
repo.Save(new ParticipationAspect { GroupId = groupId, Key = "b", Label = "Inaktiv", IsActive = false });
|
||||
|
||||
Assert.Single(repo.GetByGroup(groupId));
|
||||
Assert.Equal(2, repo.GetAllByGroup(groupId).Count);
|
||||
}
|
||||
|
||||
// ── GradingSchemeRepository ───────────────────────────────────────────────
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user