summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core.UnitTests/BaseTestFixture.cs
blob: 23b7c2db17f376ed9c1f4188c24bc51da866b671 (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
31
32
using System;
using System.Globalization;
using System.Threading;

using NUnit.Framework;

namespace Xamarin.Forms.Core.UnitTests
{
	public class BaseTestFixture
	{
		[SetUp]
		public virtual void Setup ()
		{
			Device.PlatformServices = new MockPlatformServices();

#if !WINDOWS_PHONE
			var culture = Environment.GetEnvironmentVariable ("UNIT_TEST_CULTURE");
			
			if (!string.IsNullOrEmpty (culture)) {
				var thead = Thread.CurrentThread;
				thead.CurrentCulture = new CultureInfo (culture);
			}
#endif
		}

		[TearDown]
		public virtual void TearDown ()
		{
			Device.PlatformServices = null;
		}
	}
}