view Lang/AbstractTranslationSetTest.cs @ 15:e3e4f7a92f8b

Re #31: Break out Translations for language to own class * Add tests for translation sets Re #30: Improve Translations API * Add more tests
author IBBoard <dev@ibboard.co.uk>
date Tue, 06 Apr 2010 15:43:08 +0000
parents
children 20189f3a3479
line wrap: on
line source

// This file (TranslationSetTest.cs) is a part of the IBBoard.Tests project and is copyright 2010 IBBoard
// 
// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.

using System;
using NUnit.Framework;

namespace IBBoard.Lang
{
	public abstract class AbstractTranslationSetTest
	{
		
		[Test()]
		public void TestTranslationSetReturnForMissingValue()
		{
			AbstractTranslationSet translations = GetTranslationSet();
			Assert.IsNull(translations["missing"]);
		}
		
		[Test()]
		public void TestTranslationSetSettingAndRetrieval()
		{
			AbstractTranslationSet translations = GetTranslationSetWithFixedValue();
			Assert.AreEqual(GetFixedValueTranslation(), translations[GetFixedValueKey()]);
		}
		
		protected abstract AbstractTranslationSet GetTranslationSet();
		protected abstract AbstractTranslationSet GetTranslationSetWithFixedValue();
		protected abstract string GetFixedValueKey();
		protected abstract string GetFixedValueTranslation();
	}
}