Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed CSHARP-147. It was not reading the closing "}" of the extended …
…JSON representation for binary data.
- Loading branch information
rstam
committed
Jan 14, 2011
1 parent
f60f354
commit d56552b
Showing
3 changed files
with
52 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
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
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,50 @@ | ||
/* Copyright 2010 10gen Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.Serialization; | ||
using System.Text; | ||
using NUnit.Framework; | ||
|
||
using MongoDB.Bson; | ||
using MongoDB.Bson.DefaultSerializer; | ||
using MongoDB.Bson.IO; | ||
using MongoDB.Bson.Serialization; | ||
|
||
namespace MongoDB.BsonUnitTests.Jira.CSharp147 { | ||
[TestFixture] | ||
public class CSharp146Tests { | ||
public class Parent { | ||
public Child Child { get; set; } | ||
} | ||
|
||
public class Child { | ||
public Guid Id { get; set; } | ||
public int A { get; set; } | ||
} | ||
|
||
[Test] | ||
public void Test() { | ||
var p = new Parent { Child = new Child() }; | ||
p.Child.A = 1; | ||
var json = p.ToJson(); | ||
BsonSerializer.Deserialize<Parent>(json); // throws Unexpected element exception | ||
} | ||
} | ||
} |