view Lang/ModifiableTranslationSetTest.cs @ 21:2834da2b8891

Re #35: Add multi-level cascading of translations * Add tests of "parent language" property * Move some test values to constants instead of abstract methods Also: * Fix warning about tests not being executable because they're on an abstract class by not marking abstract class as a test fixture
author IBBoard <dev@ibboard.co.uk>
date Wed, 07 Apr 2010 19:36:08 +0000
parents 20189f3a3479
children e9bad86c1360
line source
1 // This file (ModifiableTranslationSetTest.cs) is a part of the IBBoard.Tests project and is copyright 2010 IBBoard
2 //
3 // 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.
5 using System;
6 using NUnit.Framework;
8 namespace IBBoard.Lang
9 {
10 [TestFixture()]
11 public class ModifiableTranslationSetTest : AbstractTranslationSetTest
12 {
13 protected override AbstractTranslationSet GetTranslationSet(string language)
14 {
15 return new ModifiableTranslationSet(language);
16 }
18 protected override AbstractTranslationSet GetTranslationSetWithInheritance(string language, string parentLanguage)
19 {
20 ModifiableTranslationSet translations = new ModifiableTranslationSet(language);
21 translations.SetTranslation(TEST_KEY, TEST_VALUE);
22 ModifiableTranslationSet parentTranslations = new ModifiableTranslationSet(parentLanguage);
23 parentTranslations.SetTranslation(INHERITED_KEY, INHERITED_VALUE);
24 translations.SetParentTranslations(parentTranslations);
25 return translations;
26 }
28 protected override AbstractTranslationSet GetTranslationSetWithFixedValue()
29 {
30 ModifiableTranslationSet translations = new ModifiableTranslationSet("en");
31 translations.SetTranslation(TEST_KEY, TEST_VALUE);
32 return translations;
33 }
34 }
35 }