UI Improvements: Planungsdialog, Fehlzeitendarstellung, Vorauswahl der Einheit
CI / build-and-test (push) Canceled after 0s
CI / build-and-test (push) Canceled after 0s
This commit is contained in:
@@ -25,4 +25,28 @@ public sealed class UnitDialogViewModelTests
|
||||
|
||||
Assert.Equal("10c · kein Fach hinterlegt (siehe Lerngruppe)", vm.GroupSubjectDisplay);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Laufend_SetztBisherigeLaufendeEinheitAufAbgeschlossenUndWarntVorher()
|
||||
{
|
||||
var groupId = Guid.NewGuid();
|
||||
var units = new FakeUnits();
|
||||
var previous = new LehrerApp.Core.Models.Unit
|
||||
{
|
||||
GroupId = groupId, Title = "Bruchrechnung", Status = LehrerApp.Core.Models.UnitStatus.Active,
|
||||
};
|
||||
units.Add(previous);
|
||||
var vm = new UnitDialogViewModel(units, new FakeCompetencyDomains(),
|
||||
groupId, null, 6, "6a", "Mathematik", editingUnit: null)
|
||||
{
|
||||
Title = "Prozentrechnung",
|
||||
StatusName = "Laufend",
|
||||
};
|
||||
|
||||
Assert.Contains("Bruchrechnung", vm.StatusNotice);
|
||||
vm.SaveCommand.Execute(null);
|
||||
|
||||
Assert.Equal(LehrerApp.Core.Models.UnitStatus.Completed, previous.Status);
|
||||
Assert.Single(units.GetByGroup(groupId), u => u.Status == LehrerApp.Core.Models.UnitStatus.Active);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user