annotate Lang/TranslationXmlLoaderTest.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
children 948317c89fad
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 // This file (TranslationXmlLoader.cs) is a part of the IBBoard.Tests project and is copyright 2010 IBBoard
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2 //
c21d27a9cae5 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.
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 using System;
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 using NUnit.Framework;
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 namespace IBBoard.Lang
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 {
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 [TestFixture()]
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 public class TranslationXmlLoaderTest
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 {
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 [Test()]
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
14 public void TestLoadOfSimpleXml()
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15 {
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16 TranslationXmlLoader loader = new TranslationXmlLoader("test-data/schemas/translation.xsd");
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17 AbstractTranslationSet translations = loader.LoadTranslations("test-data/translations/en.translation");
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18 Assert.AreEqual("en", translations.LanguageCode);
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19 Assert.AreEqual("Test String", translations["testString"]);
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20 }
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
21 }
c21d27a9cae5 Re #31: Break out Translations for language to own class
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
22 }