-Fixed test

This commit is contained in:
James Newton-King
2014-09-11 15:34:20 +12:00
parent 7fcd12e2cf
commit 2fc8638d59
6 changed files with 22 additions and 3 deletions
@@ -27,6 +27,7 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text.RegularExpressions;
#if NET20
using Newtonsoft.Json.Serialization;
#else
@@ -172,6 +173,22 @@ namespace Newtonsoft.Json.Tests
}
}
public static class StringAssert
{
private readonly static Regex Regex = new Regex(@"\r\n|\n\r|\n|\r", RegexOptions.CultureInvariant | RegexOptions.Compiled);
public static void AreEqual(string expected, string actual)
{
if (expected != null)
expected = Regex.Replace(expected, "\r\n");
if (actual != null)
actual = Regex.Replace(actual, "\r\n");
Assert.AreEqual(expected, actual);
}
}
public static class ExceptionAssert
{
public static void Throws<TException>(string message, Action action)