Fix System.Text.Encoding tests to use non-static RNG

Commit migrated from https://github.com/dotnet/corefx/commit/1b5d9fb7503cc01a6fba08b5d9bf0eb9cfb031b6
This commit is contained in:
stephentoub committed 2015-07-14 22:15:30 -04:00
1 parent 42260a04b8
commit ae493cc005
32 files changed
+199 -576

No files matched your search

@@ -7,6 +7,8 @@ namespace System.Text.EncodingTests
//System.Text.UnicodeEncoding.GetEncoder() [v-zuolan]
public class UnicodeEncodingGetEncoder
{
private readonly RandomDataGenerator _generator = new RandomDataGenerator();
#region Positive Tests
// PosTest1:Invoke the method
[Fact]
@@ -46,7 +48,7 @@ namespace System.Text.EncodingTests
int i = 0;
while (i < length)
{
Char temp = TestLibrary.Generator.GetChar(-55);
Char temp = _generator.GetChar(-55);
if (!Char.IsSurrogate(temp))
{
charArray[i] = temp;