This commit is contained in:
James Newton-King
2015-04-07 17:36:41 +12:00
parent d2d097172e
commit 765bfbf1b4
102 changed files with 855 additions and 129 deletions
@@ -29,10 +29,12 @@ using System.IO;
using System.Linq;
using System.Text;
using Newtonsoft.Json.Bson;
using NUnit.Framework;
namespace Newtonsoft.Json.Tests.Documentation.Samples.Bson
{
public class DeserializeFromBsonCollection
[TestFixture]
public class DeserializeFromBsonCollection : TestFixtureBase
{
#region Types
public class Event
@@ -42,23 +44,9 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Bson
}
#endregion
[Test]
public void Example()
{
//IList<Event> e = new List<Event>
// {
// new Event {StartDate = new DateTime(2013, 3, 31), Name = "Easter"}
// };
//MemoryStream ms1 = new MemoryStream();
//using (BsonWriter writer = new BsonWriter(ms1))
//{
// JsonSerializer serializer = new JsonSerializer();
// serializer.Serialize(writer, e);
//}
//string ss = Convert.ToBase64String(ms1.ToArray());
//Console.WriteLine(ss);
#region Usage
string s = "MQAAAAMwACkAAAACTmFtZQAHAAAARWFzdGVyAAlTdGFydERhdGUAgDf0uj0BAAAAAA==";
byte[] data = Convert.FromBase64String(s);