From 5eff32a7bc7723f5f87d6054b19a065bd8760bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20B=C3=BCchel?= Date: Thu, 2 Apr 2020 17:56:48 +0200 Subject: [PATCH] SEBWIN-380: Added browser engine reference to browser unit tests in order to be able to unit test important components. --- .../Handlers/ContextMenuHandlerTests.cs | 46 +++++++++++++++++++ .../SafeExamBrowser.Browser.UnitTests.csproj | 9 ++++ .../packages.config | 3 ++ .../ConfigurationData/DataValues.cs | 2 + 4 files changed, 60 insertions(+) create mode 100644 SafeExamBrowser.Browser.UnitTests/Handlers/ContextMenuHandlerTests.cs diff --git a/SafeExamBrowser.Browser.UnitTests/Handlers/ContextMenuHandlerTests.cs b/SafeExamBrowser.Browser.UnitTests/Handlers/ContextMenuHandlerTests.cs new file mode 100644 index 00000000..e43d67e0 --- /dev/null +++ b/SafeExamBrowser.Browser.UnitTests/Handlers/ContextMenuHandlerTests.cs @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2020 ETH Zürich, Educational Development and Technology (LET) + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +using CefSharp; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Moq; +using SafeExamBrowser.Browser.Handlers; + +namespace SafeExamBrowser.Browser.UnitTests.Handlers +{ + [TestClass] + public class ContextMenuHandlerTests + { + private ContextMenuHandler sut; + + [TestInitialize] + public void Initialize() + { + sut = new ContextMenuHandler(); + } + + [TestMethod] + public void MustClearContextMenu() + { + var menu = new Mock(); + + sut.OnBeforeContextMenu(Mock.Of(), Mock.Of(), Mock.Of