Mercurial > repos > IBBoard.Tests
annotate Lang/ModifiableTranslationSetTest.cs @ 16:c21d27a9cae5
Re #31: Break out Translations for language to own class
* Add initial tests for loader of new translation class
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Tue, 06 Apr 2010 16:01:29 +0000 |
parents | e3e4f7a92f8b |
children | 20189f3a3479 |
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 // |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
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. |
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 { |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
13 private const string TEST_ID = "testString"; |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
14 |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
15 protected override string GetFixedValueKey() |
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 return TEST_ID; |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
18 } |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
19 |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
20 protected override string GetFixedValueTranslation() |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
21 { |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
22 return "new string"; |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
23 } |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
24 |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
25 protected override AbstractTranslationSet GetTranslationSet() |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
26 { |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
27 return new ModifiableTranslationSet("en"); |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
28 } |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
29 |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
30 protected override AbstractTranslationSet GetTranslationSetWithFixedValue() |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
31 { |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
32 ModifiableTranslationSet translations = new ModifiableTranslationSet("en"); |
16
c21d27a9cae5
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
15
diff
changeset
|
33 translations.SetTranslation(GetFixedValueKey(), GetFixedValueTranslation()); |
15
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
34 return translations; |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
35 } |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
36 } |
e3e4f7a92f8b
Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
37 } |