Mercurial > repos > IBBoard.Tests
annotate Lang/ModifiableTranslationSetTest.cs @ 28:31fdc90f3556
* Fix license comments at top of files
no-open-ticket
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 21 Aug 2010 10:07:09 +0000 |
parents | e9bad86c1360 |
children |
rev | line source |
---|---|
15
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1 // This file (ModifiableTranslationSetTest.cs) is a part of the IBBoard.Tests project and is copyright 2010 IBBoard |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 // |
28
31fdc90f3556
* Fix license comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
22
diff
changeset
|
3 // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU LGPL, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. |
15
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 using System; |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
6 using NUnit.Framework; |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
7 |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
8 namespace IBBoard.Lang |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
9 { |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
10 [TestFixture()] |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
11 public class ModifiableTranslationSetTest : AbstractTranslationSetTest |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
12 { |
18
20189f3a3479
Re #34: Get name for translation
IBBoard <dev@ibboard.co.uk>
parents:
16
diff
changeset
|
13 protected override AbstractTranslationSet GetTranslationSet(string language) |
15
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
14 { |
18
20189f3a3479
Re #34: Get name for translation
IBBoard <dev@ibboard.co.uk>
parents:
16
diff
changeset
|
15 return new ModifiableTranslationSet(language); |
15
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
16 } |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
17 |
21
2834da2b8891
Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
18 protected override AbstractTranslationSet GetTranslationSetWithInheritance(string language, string parentLanguage) |
15
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
19 { |
21
2834da2b8891
Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
20 ModifiableTranslationSet translations = new ModifiableTranslationSet(language); |
2834da2b8891
Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
21 translations.SetTranslation(TEST_KEY, TEST_VALUE); |
2834da2b8891
Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
22 ModifiableTranslationSet parentTranslations = new ModifiableTranslationSet(parentLanguage); |
2834da2b8891
Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
23 parentTranslations.SetTranslation(INHERITED_KEY, INHERITED_VALUE); |
2834da2b8891
Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
24 translations.SetParentTranslations(parentTranslations); |
2834da2b8891
Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
25 return translations; |
2834da2b8891
Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
26 } |
2834da2b8891
Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
27 |
2834da2b8891
Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
28 protected override AbstractTranslationSet GetTranslationSetWithFixedValue() |
22
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
29 { |
15
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
30 ModifiableTranslationSet translations = new ModifiableTranslationSet("en"); |
21
2834da2b8891
Re #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
18
diff
changeset
|
31 translations.SetTranslation(TEST_KEY, TEST_VALUE); |
15
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
32 return translations; |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
33 } |
22
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
34 |
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
35 protected override AbstractTranslationSet GetTranslationSetWithDirectLoop() |
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
36 { |
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
37 ModifiableTranslationSet translations = new ModifiableTranslationSet("en-US"); |
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
38 ModifiableTranslationSet parentTranslations = new ModifiableTranslationSet("en"); |
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
39 translations.SetParentTranslations(parentTranslations); |
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
40 parentTranslations.SetParentTranslations(translations); |
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
41 return translations; |
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
42 } |
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
43 |
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
44 protected override AbstractTranslationSet GetTranslationSetWithIndirectLoop() |
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
45 { |
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
46 ModifiableTranslationSet translations = new ModifiableTranslationSet("it"); |
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
47 ModifiableTranslationSet parentTranslations = new ModifiableTranslationSet("en-US"); |
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
48 ModifiableTranslationSet parentParentTranslations = new ModifiableTranslationSet("en"); |
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
49 translations.SetParentTranslations(parentTranslations); |
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
50 parentTranslations.SetParentTranslations(parentParentTranslations); |
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
51 parentParentTranslations.SetParentTranslations(translations); |
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
52 return translations; |
e9bad86c1360
Fixes #35: Add multi-level cascading of translations
IBBoard <dev@ibboard.co.uk>
parents:
21
diff
changeset
|
53 } |
15
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
54 } |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
55 } |