From 15be4cbaf774456d1765217bb8d1dc8b25752c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20B=C3=BCchel?= Date: Mon, 30 Nov 2020 18:30:29 +0100 Subject: [PATCH] SEBWIN-442: Implemented mechanism to automatically select server exam via configuration. --- .../Handlers/ResourceHandlerTests.cs | 30 +++++++++++++++++-- .../Handlers/ResourceHandler.cs | 6 ++-- .../DataMapping/ServerDataMapper.cs | 5 ++++ .../ConfigurationData/Keys.cs | 1 + .../Operations/ServerOperation.cs | 15 ++++++++-- .../IServerProxy.cs | 4 +-- SafeExamBrowser.Server/ServerProxy.cs | 4 +-- .../Server/ServerSettings.cs | 5 ++++ 8 files changed, 59 insertions(+), 11 deletions(-) diff --git a/SafeExamBrowser.Browser.UnitTests/Handlers/ResourceHandlerTests.cs b/SafeExamBrowser.Browser.UnitTests/Handlers/ResourceHandlerTests.cs index cc921db6..cd27be64 100644 --- a/SafeExamBrowser.Browser.UnitTests/Handlers/ResourceHandlerTests.cs +++ b/SafeExamBrowser.Browser.UnitTests/Handlers/ResourceHandlerTests.cs @@ -49,18 +49,20 @@ namespace SafeExamBrowser.Browser.UnitTests.Handlers } [TestMethod] - public void MustAppendCustomHeaders() + public void MustAppendCustomHeadersForSameDomain() { + var browser = new Mock(); var headers = default(NameValueCollection); var request = new Mock(); + browser.SetupGet(b => b.Address).Returns("http://www.host.org"); request.SetupGet(r => r.Headers).Returns(new NameValueCollection()); request.SetupGet(r => r.Url).Returns("http://www.host.org"); request.SetupSet(r => r.Headers = It.IsAny()).Callback((h) => headers = h); settings.SendConfigurationKey = true; settings.SendExamKey = true; - var result = sut.OnBeforeResourceLoad(Mock.Of(), Mock.Of(), Mock.Of