Datensicherheit: Backup, Verschlüsselung, App-Sperre (Kapitel 13.3)
Automatisches rollierendes Backup der Datenbank beim Start mit Wiederherstellung über die Einstellungen, versionierte Schema-Migration, optionale Passwort-Verschlüsselung der LiteDB-Datei und eine App-Sperre nach Inaktivität mit eigenem Passwort. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -115,6 +115,26 @@ public sealed class LiteDbContextTests
|
||||
new ExamResult { StudentId = studentId, ExamId = examId }));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NeueDatenbank_HatDieAktuelleSchemaVersionNachDemErstenOeffnen()
|
||||
{
|
||||
using var temp = new TempDatabase();
|
||||
using var context = new LiteDbContext(temp.Path);
|
||||
|
||||
Assert.Equal(1, context.SchemaVersion);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SchemaVersion_WirdUeberEinenNeustartHinwegBeibehalten()
|
||||
{
|
||||
using var temp = new TempDatabase();
|
||||
using (var first = new LiteDbContext(temp.Path)) { }
|
||||
|
||||
using var second = new LiteDbContext(temp.Path);
|
||||
|
||||
Assert.Equal(1, second.SchemaVersion);
|
||||
}
|
||||
|
||||
private sealed class TempDatabase : IDisposable
|
||||
{
|
||||
private readonly string _directory = System.IO.Path.Combine(
|
||||
|
||||
Reference in New Issue
Block a user