Daniel Hughes
2014-09-02 11:07:59 UTC
Attached is a patch which fixes one of the locale unit tests. This
test was assuming that english 'en' was the always the first locale
and this simply is not always the case. Meaning this test would pass
sometimes on some boxes but not on others.
-------------- next part --------------
Index: bindings/csharp/tests/ManagerTests.cs
===================================================================
--- bindings/csharp/tests/ManagerTests.cs (revision 3254)
+++ bindings/csharp/tests/ManagerTests.cs (working copy)
@@ -14,6 +14,7 @@
using System;
using NUnit.Framework;
using System.IO;
+using System.Collections.Generic;
using System.Linq;
namespace Sword.Tests
@@ -84,13 +85,23 @@
public void AvailableLocales_Get_DoesntCrash()
{
//act
- var availableLocales = _manager.AvailableLocales.ToArray();
+ string[] availableLocales = _manager.AvailableLocales.ToArray();
//Assert
- Assert.That (availableLocales[0].Contains("en"));
+ Assert.That (availableLocales.Length > 0);
}
[Test]
+ public void AvailableLocales_Get_ContainsEnglish()
+ {
+ //act
+ string[] availableLocales = _manager.AvailableLocales.ToArray();
+
+ //Assert
+ Assert.That (availableLocales.Any(locale => locale == "en"));
+ }
+
+ [Test]
public void DefaultLocale_SetToEn_DoesntCrash()
{
//act
test was assuming that english 'en' was the always the first locale
and this simply is not always the case. Meaning this test would pass
sometimes on some boxes but not on others.
-------------- next part --------------
Index: bindings/csharp/tests/ManagerTests.cs
===================================================================
--- bindings/csharp/tests/ManagerTests.cs (revision 3254)
+++ bindings/csharp/tests/ManagerTests.cs (working copy)
@@ -14,6 +14,7 @@
using System;
using NUnit.Framework;
using System.IO;
+using System.Collections.Generic;
using System.Linq;
namespace Sword.Tests
@@ -84,13 +85,23 @@
public void AvailableLocales_Get_DoesntCrash()
{
//act
- var availableLocales = _manager.AvailableLocales.ToArray();
+ string[] availableLocales = _manager.AvailableLocales.ToArray();
//Assert
- Assert.That (availableLocales[0].Contains("en"));
+ Assert.That (availableLocales.Length > 0);
}
[Test]
+ public void AvailableLocales_Get_ContainsEnglish()
+ {
+ //act
+ string[] availableLocales = _manager.AvailableLocales.ToArray();
+
+ //Assert
+ Assert.That (availableLocales.Any(locale => locale == "en"));
+ }
+
+ [Test]
public void DefaultLocale_SetToEn_DoesntCrash()
{
//act