Restore SEBPatch
This commit is contained in:
46
SafeExamBrowser.I18n.UnitTests/TextTests.cs
Normal file
46
SafeExamBrowser.I18n.UnitTests/TextTests.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2024 ETH Zürich, IT Services
|
||||
*
|
||||
* 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 System.Globalization;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Moq;
|
||||
using SafeExamBrowser.I18n.Contracts;
|
||||
using SafeExamBrowser.Logging.Contracts;
|
||||
|
||||
namespace SafeExamBrowser.I18n.UnitTests
|
||||
{
|
||||
[TestClass]
|
||||
public class TextTests
|
||||
{
|
||||
private Mock<ILogger> loggerMock;
|
||||
private Text sut;
|
||||
|
||||
[TestInitialize]
|
||||
public void Initialize()
|
||||
{
|
||||
loggerMock = new Mock<ILogger>();
|
||||
sut = new Text(loggerMock.Object);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void MustNeverReturnNull()
|
||||
{
|
||||
var text = sut.Get((TextKey)(-1));
|
||||
|
||||
Assert.IsNotNull(text);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void MustNotFailToInitializeWhenDataNotFound()
|
||||
{
|
||||
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
|
||||
|
||||
sut.Initialize();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user