Permalink
Browse files

CSHARP-708: added breaking test.

  • Loading branch information...
1 parent 2235bee commit 9c969995219b0942d634682c54956cdc8c844a00 @craiggwilson craiggwilson committed Mar 20, 2013
Showing with 53 additions and 0 deletions.
  1. +52 −0 MongoDB.BsonUnitTests/Jira/CSharp708Tests.cs
  2. +1 −0 MongoDB.BsonUnitTests/MongoDB.BsonUnitTests.csproj
@@ -0,0 +1,52 @@
+/* Copyright 2010-2012 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 MongoDB.Bson;
+using MongoDB.Bson.Serialization.Attributes;
+using NUnit.Framework;
+using MongoDB.Bson.Serialization;
+using MongoDB.Bson.Serialization.Conventions;
+
+namespace MongoDB.BsonUnitTests.Jira.CSharp708
+{
+ [TestFixture]
+ public class CSharp708Tests
+ {
+ interface IIdentity
+ {
+ string Id { get; }
+ }
+
+ class Entity : IIdentity
+ {
+ public string Id { get; set; }
+ }
+
+ void ConfigureClassMap<T>(BsonClassMap<T> cm)
+ where T : class, IIdentity, new()
+ {
+ cm.SetIdMember(cm.GetMemberMap(c => c.Id).SetRepresentation(BsonType.ObjectId));
+ }
+
+ [Test]
+ public void Test()
+ {
+ var classMap = new BsonClassMap<Entity>();
+ classMap.AutoMap();
+
+ ConfigureClassMap<Entity>(classMap);
+ }
+ }
+}
@@ -83,6 +83,7 @@
<Compile Include="BsonUtilsTests.cs" />
<Compile Include="IO\ByteArrayBufferTests.cs" />
<Compile Include="IO\MultiChunkBufferTests.cs" />
+ <Compile Include="Jira\CSharp708Tests.cs" />
<Compile Include="Jira\CSharp476Tests.cs" />
<Compile Include="Jira\CSharp624Tests.cs" />
<Compile Include="Jira\CSharp637Tests.cs" />

0 comments on commit 9c96999

Please sign in to comment.