2017-07-05 17:21:52 +02:00
|
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2017 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 System;
|
|
|
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
|
using SafeExamBrowser.Core.I18n;
|
|
|
|
|
|
|
|
|
|
namespace SafeExamBrowser.Core.UnitTests
|
|
|
|
|
{
|
|
|
|
|
[TestClass]
|
2017-07-06 10:56:03 +02:00
|
|
|
|
public class TextTests
|
2017-07-05 17:21:52 +02:00
|
|
|
|
{
|
2017-07-06 10:56:03 +02:00
|
|
|
|
[TestMethod]
|
|
|
|
|
public void MustNeverBeNull()
|
|
|
|
|
{
|
|
|
|
|
Assert.IsNotNull(Text.Instance);
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-05 17:21:52 +02:00
|
|
|
|
[TestMethod]
|
|
|
|
|
public void MustNeverReturnNull()
|
|
|
|
|
{
|
2017-07-06 10:56:03 +02:00
|
|
|
|
var text = Text.Instance.Get((Key) (-1));
|
2017-07-05 17:21:52 +02:00
|
|
|
|
|
|
|
|
|
Assert.IsNotNull(text);
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-06 10:56:03 +02:00
|
|
|
|
[TestMethod]
|
|
|
|
|
[ExpectedException(typeof(ArgumentNullException))]
|
|
|
|
|
public void MustNotAllowBeingNull()
|
|
|
|
|
{
|
|
|
|
|
Text.Instance = null;
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-05 17:21:52 +02:00
|
|
|
|
[TestMethod]
|
|
|
|
|
[ExpectedException(typeof(ArgumentNullException))]
|
|
|
|
|
public void MustNotAllowNullResource()
|
|
|
|
|
{
|
2017-07-06 10:56:03 +02:00
|
|
|
|
new Text(null);
|
2017-07-05 17:21:52 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|