summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test/LocalizationTests.cs
blob: 6c4bc1430e1f487990cc58c97f55e5ba3b043b62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//-----------------------------------------------------------------------
// <copyright file="LocalizationTests.cs" company="Outercurve Foundation">
//     Copyright (c) Outercurve Foundation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace DotNetOpenAuth.Test {
	using System;
	using System.Globalization;
	using System.Threading;
	using System.Web;
	using DotNetOpenAuth.Messaging;
	using NUnit.Framework;

	/// <summary>
	/// Tests various localized resources work as expected.
	/// </summary>
	[TestFixture]
	public class LocalizationTests : TestBase {
		/// <summary>
		/// Tests that Serbian localized strings are correctly installed.
		/// </summary>
		[Test, ExpectedException(typeof(InvalidOperationException), ExpectedMessage = "Ovaj metod zahteva tekući HttpContext. Kao alternativa, koristite preklopljeni metod koji dozvoljava da se prosledi informacija bez HttpContext-a.")]
		public void Serbian() {
			HttpContext.Current = null; // our testbase initializes this, but it must be null to throw
			Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("sr");
			ErrorUtilities.VerifyHttpContext();
		}
	}
}