-Marked BSON classes as obsolete
This commit is contained in:
@@ -274,6 +274,7 @@ namespace Newtonsoft.Json.Tests.Converters
|
||||
Assert.AreEqual(t1.TableName, t2.TableName);
|
||||
}
|
||||
|
||||
#pragma warning disable 618
|
||||
[Test]
|
||||
public void RoundtripBsonBytes()
|
||||
{
|
||||
@@ -314,6 +315,7 @@ namespace Newtonsoft.Json.Tests.Converters
|
||||
CollectionAssert.AreEquivalent(Encoding.UTF8.GetBytes("Hello world!"), (byte[])dr1["data"]);
|
||||
Assert.AreEqual(g, (Guid)dr1["id"]);
|
||||
}
|
||||
#pragma warning restore 618
|
||||
|
||||
[Test]
|
||||
public void SerializeDataTableWithNull()
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
#endregion
|
||||
|
||||
#pragma warning disable 618
|
||||
using System.IO;
|
||||
using Newtonsoft.Json.Bson;
|
||||
using Newtonsoft.Json.Utilities;
|
||||
@@ -84,4 +85,5 @@ namespace Newtonsoft.Json.Tests.Converters
|
||||
Assert.AreEqual(c.Test, "1234£56");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 618
|
||||
@@ -114,6 +114,7 @@ namespace Newtonsoft.Json.Tests.Converters
|
||||
Assert.AreEqual(RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, r.Regex.Options);
|
||||
}
|
||||
|
||||
#pragma warning disable 618
|
||||
[Test]
|
||||
public void SerializeToBson()
|
||||
{
|
||||
@@ -132,19 +133,6 @@ namespace Newtonsoft.Json.Tests.Converters
|
||||
Assert.AreEqual(expected, bson);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DeserializeFromText()
|
||||
{
|
||||
string json = @"{
|
||||
""Pattern"": ""abc"",
|
||||
""Options"": 513
|
||||
}";
|
||||
|
||||
Regex newRegex = JsonConvert.DeserializeObject<Regex>(json, new RegexConverter());
|
||||
Assert.AreEqual("abc", newRegex.ToString());
|
||||
Assert.AreEqual(RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, newRegex.Options);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DeserializeFromBson()
|
||||
{
|
||||
@@ -209,6 +197,20 @@ namespace Newtonsoft.Json.Tests.Converters
|
||||
Assert.AreEqual("/", c.Regex.ToString());
|
||||
Assert.AreEqual(RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Multiline | RegexOptions.ExplicitCapture, c.Regex.Options);
|
||||
}
|
||||
#pragma warning restore 618
|
||||
|
||||
[Test]
|
||||
public void DeserializeFromText()
|
||||
{
|
||||
string json = @"{
|
||||
""Pattern"": ""abc"",
|
||||
""Options"": 513
|
||||
}";
|
||||
|
||||
Regex newRegex = JsonConvert.DeserializeObject<Regex>(json, new RegexConverter());
|
||||
Assert.AreEqual("abc", newRegex.ToString());
|
||||
Assert.AreEqual(RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, newRegex.Options);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ConvertEmptyRegexJson()
|
||||
|
||||
Reference in New Issue
Block a user