-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Mono.Android-Tests] Fix empty files issue. (#9792)
Context: #9758 While enabling new tests for `Mono.Android-Tests`, git somehow ate my files and made them all empty. I fixed the ones that CI found but didn't notice the other empty files. Add the content of these files back. Verified on CI run that the 2 new tests are indeed being run and succeed.
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.Threading; | ||
using Android.OS; | ||
|
||
using NUnit.Framework; | ||
|
||
namespace Xamarin.Android.RuntimeTests { | ||
|
||
[TestFixture] | ||
public class HandlerTest { | ||
|
||
[Test] | ||
public void RemoveDisposedInstance () | ||
{ | ||
using (var t = new HandlerThread ("RemoveDisposedInstance")) { | ||
t.Start (); | ||
using (var h = new Handler (t.Looper)) { | ||
var e = new ManualResetEvent (false); | ||
Java.Lang.Runnable r = null; | ||
r = new Java.Lang.Runnable (() => { | ||
e.Set (); | ||
r.Dispose (); | ||
}); | ||
h.Post (r.Run); | ||
e.WaitOne (); | ||
} | ||
|
||
t.QuitSafely (); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System.Globalization; | ||
using System.Threading; | ||
using NUnit.Framework; | ||
|
||
namespace Xamarin.Android.RuntimeTests | ||
{ | ||
[TestFixture] | ||
public class LocalizationTests | ||
{ | ||
// https://bugzilla.xamarin.com/show_bug.cgi?id=31705 | ||
[Test] | ||
public void EmbeddedResources_ShouldBeLocalized () | ||
{ | ||
CultureInfo culture = Thread.CurrentThread.CurrentCulture; | ||
CultureInfo uiCulture = Thread.CurrentThread.CurrentUICulture; | ||
|
||
Assert.AreEqual ("a", AppResources.String1, "Embedded string resource did not contain expected value."); | ||
|
||
Thread.CurrentThread.CurrentCulture = new CultureInfo ("it-IT"); | ||
Thread.CurrentThread.CurrentUICulture = new CultureInfo ("it-IT"); | ||
|
||
Assert.AreEqual ("b", AppResources.String1, | ||
"Embedded string resource did not contain expected value after changing CultureInfo."); | ||
|
||
Thread.CurrentThread.CurrentCulture = culture; | ||
Thread.CurrentThread.CurrentUICulture = uiCulture; | ||
} | ||
} | ||
} |