Update Safe Exam Browser Patch to 3.10.0.826

This commit is contained in:
2025-09-16 16:32:31 +02:00
parent 4827ae1afc
commit dd82d45ed8
320 changed files with 8445 additions and 5295 deletions

View File

@@ -10,6 +10,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Win32;
using Moq;
using SafeExamBrowser.Client.Contracts;
using SafeExamBrowser.Client.Responsibilities;
@@ -363,7 +364,7 @@ namespace SafeExamBrowser.Client.UnitTests.Responsibilities
.Setup(f => f.CreateLockScreen(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<LockScreenOption>>(), It.IsAny<LockScreenSettings>()))
.Returns(lockScreen.Object);
sentinel.Raise(s => s.SessionChanged += null);
sentinel.Raise(s => s.SessionChanged += null, SessionSwitchReason.ConsoleDisconnect);
coordinator.Verify(c => c.RequestSessionLock(), Times.Once);
coordinator.Verify(c => c.ReleaseSessionLock(), Times.Once);
@@ -385,7 +386,7 @@ namespace SafeExamBrowser.Client.UnitTests.Responsibilities
.Callback(new Action<string, string, IEnumerable<LockScreenOption>, LockScreenSettings>((message, title, options, settings) => result.OptionId = options.Last().Id))
.Returns(lockScreen.Object);
sentinel.Raise(s => s.SessionChanged += null);
sentinel.Raise(s => s.SessionChanged += null, SessionSwitchReason.ConsoleConnect);
coordinator.Verify(c => c.RequestSessionLock(), Times.Once);
coordinator.Verify(c => c.ReleaseSessionLock(), Times.Once);
@@ -406,9 +407,42 @@ namespace SafeExamBrowser.Client.UnitTests.Responsibilities
.Setup(f => f.CreateLockScreen(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<LockScreenOption>>(), It.IsAny<LockScreenSettings>()))
.Returns(lockScreen.Object);
sentinel.Raise(s => s.SessionChanged += null);
sentinel.Raise(s => s.SessionChanged += null, SessionSwitchReason.ConsoleConnect);
lockScreen.Verify(l => l.Show(), Times.Never);
}
[TestMethod]
public void SystemMonitor_MustDoNothingIfSessionLockUnlockWithoutService()
{
var lockScreen = new Mock<ILockScreen>();
settings.Service.IgnoreService = true;
lockScreen.Setup(l => l.WaitForResult()).Returns(new LockScreenResult());
uiFactory
.Setup(f => f.CreateLockScreen(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<LockScreenOption>>(), It.IsAny<LockScreenSettings>()))
.Returns(lockScreen.Object);
sentinel.Raise(s => s.SessionChanged += null, SessionSwitchReason.SessionLock);
lockScreen.Verify(l => l.Show(), Times.Never);
}
[TestMethod]
public void SystemMonitor_MustShowLockscreenIfNotSessionLockUnlockWithoutService()
{
var lockScreen = new Mock<ILockScreen>();
settings.Service.IgnoreService = true;
coordinator.Setup(c => c.RequestSessionLock()).Returns(true);
lockScreen.Setup(l => l.WaitForResult()).Returns(new LockScreenResult());
uiFactory
.Setup(f => f.CreateLockScreen(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<LockScreenOption>>(), It.IsAny<LockScreenSettings>()))
.Returns(lockScreen.Object);
sentinel.Raise(s => s.SessionChanged += null, SessionSwitchReason.ConsoleConnect);
lockScreen.Verify(l => l.Show(), Times.Once);
}
}
}