Mercurial > repos > IBBoard.Tests
annotate Lang/TranslationLanguageTest.cs @ 49:99e4c1949c92 default tip
* Update to v2.6 of NUnit and new syntax/API changes
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 28 Apr 2013 19:32:14 +0100 |
parents | 7502653a71a0 |
children |
rev | line source |
---|---|
19
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1 // This file (TranslationLanguageTest.cs) is a part of the IBBoard.Tests project and is copyright 2010 IBBoard |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 // |
28
31fdc90f3556
* Fix license comments at top of files
IBBoard <dev@ibboard.co.uk>
parents:
20
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. |
19
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 using System; |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
6 using NUnit.Framework; |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
7 |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
8 namespace IBBoard.Lang |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
9 { |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
10 [TestFixture()] |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
11 public class TranslationLanguageTest |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
12 { |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
13 [Test()] |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
14 public void TestTranslationSetName() |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
15 { |
20
b3bc581a8433
Fixes #37: Add event to indicate change of translation
IBBoard <dev@ibboard.co.uk>
parents:
19
diff
changeset
|
16 TranslationLanguage translationLang = new TranslationLanguage("en"); |
b3bc581a8433
Fixes #37: Add event to indicate change of translation
IBBoard <dev@ibboard.co.uk>
parents:
19
diff
changeset
|
17 Assert.AreEqual("English", translationLang.Name); |
19
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
18 translationLang = new TranslationLanguage("it"); |
45
7502653a71a0
* Update tests - we now fix Microsoft's lack of capitalisation in language names
IBBoard <dev@ibboard.co.uk>
parents:
28
diff
changeset
|
19 Assert.AreEqual("Italiano", translationLang.Name); |
19
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
20 translationLang = new TranslationLanguage("zz"); |
20
b3bc581a8433
Fixes #37: Add event to indicate change of translation
IBBoard <dev@ibboard.co.uk>
parents:
19
diff
changeset
|
21 Assert.AreEqual("Unknown (zz)", translationLang.Name); |
19
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
22 } |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
23 |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
24 [Test()] |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
25 public void TestEquality() |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
26 { |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
27 Assert.AreEqual(new TranslationLanguage("en"), new TranslationLanguage("en")); |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
28 Assert.AreNotEqual(new TranslationLanguage("en"), new TranslationLanguage("it")); |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
29 } |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
30 |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
31 [Test()] |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
32 public void TestHashCodes() |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
33 { |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
34 Assert.AreEqual(new TranslationLanguage("en").GetHashCode(), new TranslationLanguage("en").GetHashCode()); |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
35 } |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
36 } |
bcb6e83752a6
Fixes #33: Add method to get list of available translations
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
37 } |