diff --git a/src/Chorus.Tests/ChorusFixtureSetup.cs b/src/Chorus.Tests/ChorusFixtureSetup.cs new file mode 100644 index 000000000..1941e365d --- /dev/null +++ b/src/Chorus.Tests/ChorusFixtureSetup.cs @@ -0,0 +1,18 @@ +using L10NSharp; +using NUnit.Framework; + +namespace Chorus.Tests +{ + internal class ChorusFixtureSetup + { + [SetUpFixture] + public class SetupFixture + { + [OneTimeSetUp] + public void RunBeforeAnyTests() + { + LocalizationManager.StrictInitializationMode = false; + } + } + } +} diff --git a/src/Chorus.Tests/clone/ClonerTests.cs b/src/Chorus.Tests/clone/ClonerTests.cs index e83c2476a..295adaa13 100644 --- a/src/Chorus.Tests/clone/ClonerTests.cs +++ b/src/Chorus.Tests/clone/ClonerTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Drawing; using System.IO; diff --git a/src/Chorus/Chorus.csproj b/src/Chorus/Chorus.csproj index 354bd746e..9109fbf87 100644 --- a/src/Chorus/Chorus.csproj +++ b/src/Chorus/Chorus.csproj @@ -11,8 +11,8 @@ - - + + diff --git a/src/Chorus/ChorusSystem.cs b/src/Chorus/ChorusSystem.cs index fe6c79c75..9df704e3b 100644 --- a/src/Chorus/ChorusSystem.cs +++ b/src/Chorus/ChorusSystem.cs @@ -123,11 +123,11 @@ public static void SetUpLocalization(string desiredUiLangId, var versionObj = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; // We don't need to reload strings for every "revision" (that might be every time we build). var version = "" + versionObj.Major + "." + versionObj.Minor + "." + versionObj.Build; - LocalizationManager.Create(TranslationMemory.XLiff, desiredUiLangId, "Chorus", + LocalizationManager.Create(desiredUiLangId, "Chorus", Application.ProductName, version, directoryOfInstalledXlfFiles, directoryOfUserModifiedXlfFiles, Icon.FromHandle(Properties.Resources.chorus32x32.GetHicon()), // should call DestroyIcon, but when? - "issues@chorus.palaso.org", "Chorus"); + "issues@chorus.palaso.org", new [] {"Chorus"}); } [Obsolete("Only one kind of TranslationMemory is supported: XLF; there is no need for the kind parameter.")] diff --git a/src/ChorusHub/ChorusHub.csproj b/src/ChorusHub/ChorusHub.csproj index 95644a920..bad50e55e 100644 --- a/src/ChorusHub/ChorusHub.csproj +++ b/src/ChorusHub/ChorusHub.csproj @@ -13,8 +13,8 @@ - - + + diff --git a/src/ChorusHubApp/ChorusHubApp.csproj b/src/ChorusHubApp/ChorusHubApp.csproj index 177232fec..4b36fba56 100644 --- a/src/ChorusHubApp/ChorusHubApp.csproj +++ b/src/ChorusHubApp/ChorusHubApp.csproj @@ -11,8 +11,8 @@ - - + + diff --git a/src/ChorusHubTests/ChorusHubFixtureSetup.cs b/src/ChorusHubTests/ChorusHubFixtureSetup.cs new file mode 100644 index 000000000..bf6f76389 --- /dev/null +++ b/src/ChorusHubTests/ChorusHubFixtureSetup.cs @@ -0,0 +1,15 @@ +using L10NSharp; +using NUnit.Framework; + +namespace ChorusHubTests +{ + [SetUpFixture] + public class ChorusHubFixtureSetup + { + [OneTimeSetUp] + public void RunBeforeAnyTests() + { + LocalizationManager.StrictInitializationMode = false; + } + } +} diff --git a/src/ChorusMerge.Tests/ChorusMerge.Tests.csproj b/src/ChorusMerge.Tests/ChorusMerge.Tests.csproj index 3193ad0fb..6fcfc68c2 100644 --- a/src/ChorusMerge.Tests/ChorusMerge.Tests.csproj +++ b/src/ChorusMerge.Tests/ChorusMerge.Tests.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/LibChorus.TestUtilities/LibChorus.TestUtilities.csproj b/src/LibChorus.TestUtilities/LibChorus.TestUtilities.csproj index a6ca46956..a74d65687 100644 --- a/src/LibChorus.TestUtilities/LibChorus.TestUtilities.csproj +++ b/src/LibChorus.TestUtilities/LibChorus.TestUtilities.csproj @@ -10,9 +10,9 @@ - - - + + + diff --git a/src/LibChorusTests/LibChorus.Tests.csproj b/src/LibChorusTests/LibChorus.Tests.csproj index 04ea7a741..daac3380b 100644 --- a/src/LibChorusTests/LibChorus.Tests.csproj +++ b/src/LibChorusTests/LibChorus.Tests.csproj @@ -17,9 +17,9 @@ - - - + + + diff --git a/src/LibChorusTests/MiscTests.cs b/src/LibChorusTests/MiscTests.cs index 939b4c9e0..055c58693 100644 --- a/src/LibChorusTests/MiscTests.cs +++ b/src/LibChorusTests/MiscTests.cs @@ -1,3 +1,4 @@ +using L10NSharp; using LibChorus.TestUtilities; using NUnit.Framework; @@ -18,4 +19,14 @@ public void AllSettingsUseCrossPlatformProvider() } } } + + [SetUpFixture] + public class SetupFixture + { + [OneTimeSetUp] + public void RunBeforeAnyTests() + { + LocalizationManager.StrictInitializationMode = false; + } + } } \ No newline at end of file diff --git a/src/LibChorusTests/merge/xml/lift/MultiTextMergingTests.cs b/src/LibChorusTests/merge/xml/lift/MultiTextMergingTests.cs index 5c78a6b80..a5e65e1db 100644 --- a/src/LibChorusTests/merge/xml/lift/MultiTextMergingTests.cs +++ b/src/LibChorusTests/merge/xml/lift/MultiTextMergingTests.cs @@ -7,7 +7,7 @@ using NUnit.Framework; -namespace LiftIO.Tests.Merging +namespace LibChorus.Tests.merge.xml.lift { [TestFixture] public class MultiTextMergingTests @@ -84,163 +84,5 @@ public void SkipConvertingElementToTextElementInAnotherFile() Assert.That(doc.DocumentElement.OuterXml, Does.Not.Contain("myStuff"), "Converted element to , but should not have."); Assert.That(doc.DocumentElement.OuterXml, Does.Contain("myStuff"), "Element went away, but should have been present."); } -/* - [Test] - public void MergeMultiTextNodes_OneAddedNewMultiTextElement() - { - string red = @""; - string ancestor = red; - - string blue = @" -
- first -
-
"; - - CheckBothWays(red, blue, ancestor, "lexical-unit/form[@lang='one']/text[text()='first']"); - } - - // private void CheckBothWays(string red, string blue, string ancestor, string xpath) - // { - // XmlNode result= LiftSavvyMergeStrategy.MergeMultiTextPieces(red, blue, ancestor); - // XmlTestHelper.AssertXPathMatchesExactlyOne(result.OuterXml, xpath); - // result= LiftSavvyMergeStrategy.MergeMultiTextPieces(blue, red, ancestor); - // XmlTestHelper.AssertXPathMatchesExactlyOne(result.OuterXml, xpath); - // } - - private void CheckBothWays(string red, string blue, string ancestor, params string[] xpaths) - { - CheckOneWay(red, blue, ancestor, xpaths); - CheckOneWay(blue, red, ancestor, xpaths); - } - - private void CheckOneWay(string ours, string theirs, string ancestor, params string[] xpaths) - { - XmlNode result = MultiTextMerger.MergeMultiTextPieces(ours, theirs, ancestor); - foreach (string xpath in xpaths) - { - XmlTestHelper.AssertXPathMatchesExactlyOne(result.OuterXml, xpath); - } - } - - [Test] - public void MergeMultiTextNodes_EachAddedDifferentAlternatives_GetBoth() - { - - string ancestor = @" - "; - - - string red = @" -
- first -
-
"; - - string blue = @" -
- second -
-
"; - - CheckBothWays(red, blue, ancestor, - "lexical-unit/form[@lang='one']/text[text()='first']", - "lexical-unit/form[@lang='two']/text[text()='second']"); - } - - [Test] - public void MergeMultiTextNodes_OneAddedAnAlternatives_GetBoth() - { - string red = @" -
- first -
-
"; - - string ancestor = red; - - string blue = @" -
- first -
-
- second -
-
"; - - CheckBothWays(red, blue, ancestor, - "lexical-unit/form[@lang='one']/text[text()='first']", - "lexical-unit/form[@lang='two']/text[text()='second']"); - } - - [Test] - public void MergeMultiTextNodes_OnePutSomethingInPreviouslyEmptyForm() - { - string red = @" -
- "; - - string ancestor = red; - - string blue = @" - - first - -
"; - - Assert.That(Utilities.AreXmlElementsEqual(red, blue), Is.False); - - CheckBothWays(red, blue, ancestor, - "lexical-unit/form[@lang='one']/text[text()='first']"); - } - - [Test] - public void MergeMultiTextNodes_OnePutSomethingInPreviouslyEmptyFormText() - { - string red = @" -
-
"; - - string ancestor = red; - - - string blue = @" -
- first -
-
"; - - CheckBothWays(red, blue, ancestor, - "lexical-unit/form[@lang='one']/text[text()='first']"); - } - - [Test] - public void WeDeletedAForm_FormRemoved() - { - string red = @""; - string blue = @" -
- first -
-
"; - string ancestor = blue; - - CheckOneWay(blue, red, ancestor, "lexical-unit[ not(form)]"); - } - - [Test] - public void TheyDeleteAForm_FormRemoved() - { - string red = @""; - string blue = @" -
- first -
-
"; - string ancestor = blue; - - CheckOneWay(blue, red, ancestor, "lexical-unit[ not(form)]"); - } -*/ } }