using LehrerApp.Core.Models; using LehrerApp.Desktop.ViewModels.Students; using Xunit; namespace LehrerApp.Desktop.Tests; public sealed class ParentCallSessionViewModelTests { [Fact] public void SaveProtocol_UebernimmtAbgehakteStatusUndEindruecke() { var pointId = Guid.NewGuid(); var documentation = new Documentation { Type = DocumentationType.ParentCall, ParentCallData = new ParentCallData { Points = [new ParentCallPoint { Id = pointId, Text = "Hausaufgaben ansprechen" }], }, }; var vm = new ParentCallSessionViewModel(documentation, "Anna Beispiel") { Impressions = "Eltern reagierten verständnisvoll.", }; vm.Points.Single().IsDone = true; vm.SaveProtocol(); Assert.NotNull(vm.Result); Assert.True(vm.Result!.ParentCallData!.IsConducted); Assert.Equal(DateOnly.FromDateTime(DateTime.Today), vm.Result.ParentCallData.ConductedDate); Assert.True(vm.Result.ParentCallData.Points.Single(p => p.Id == pointId).IsDone); Assert.Equal("Eltern reagierten verständnisvoll.", vm.Result.ParentCallData.Impressions); } }