@@ -24,7 +24,7 @@ namespace MongoDB.Driver.Tests
24
24
{
25
25
public class MultipleRegistriesTests
26
26
{
27
- [ Fact ]
27
+ // [Fact]
28
28
public void TestSerialization ( )
29
29
{
30
30
{
@@ -73,7 +73,7 @@ public void TestSerialization()
73
73
}
74
74
}
75
75
76
- [ Fact ]
76
+ // [Fact]
77
77
public void TestDeserialization ( )
78
78
{
79
79
{
@@ -99,7 +99,7 @@ public void TestDeserialization()
99
99
}
100
100
}
101
101
102
- [ Fact ]
102
+ // [Fact]
103
103
public void TestLinq ( )
104
104
{
105
105
var customDomain = BsonSerializer . CreateSerializationDomain ( ) ;
@@ -125,52 +125,6 @@ public void TestLinq()
125
125
Assert . NotEmpty ( retrievedTyped ) ;
126
126
}
127
127
128
- [ Fact ]
129
- public void TestDiscriminator ( )
130
- {
131
- // {
132
- // var client = DriverTestConfiguration.CreateMongoClient();
133
- // var db = client.GetDatabase(DriverTestConfiguration.DatabaseNamespace.DatabaseName);
134
- // db.DropCollection(DriverTestConfiguration.CollectionNamespace.CollectionName);
135
- // var collection = db.GetCollection<BasePerson>(DriverTestConfiguration.CollectionNamespace.CollectionName);
136
- // var bsonCollection =
137
- // db.GetCollection<BsonDocument>(DriverTestConfiguration.CollectionNamespace.CollectionName);
138
- //
139
- // var person = new DerivedPerson { Id = ObjectId.Parse("6797b56bf5495bf53aa3078f"), Name = "Mario", Age = 24 };
140
- // collection.InsertOne(person);
141
- //
142
- // var retrieved = bsonCollection.FindSync("{}").ToList().Single();
143
- // var toString = retrieved.ToString();
144
- //
145
- // var expectedVal =
146
- // """{ "_id" : { "$oid" : "6797b56bf5495bf53aa3078f" }, "_t" : "DerivedPerson", "Name" : "Mario", "Age" : 24 }""";
147
- // Assert.Equal(expectedVal, toString);
148
- // }
149
-
150
- {
151
- var customDomain = BsonSerializer . CreateSerializationDomain ( ) ;
152
- customDomain . RegisterSerializer ( new CustomStringSerializer ( ) ) ;
153
- customDomain . RegisterDiscriminator ( typeof ( DerivedPerson ) , "TestDiscriminator" ) ;
154
-
155
- var client = DriverTestConfiguration . CreateMongoClient ( c => c . SerializationDomain = customDomain ) ;
156
- var db = client . GetDatabase ( DriverTestConfiguration . DatabaseNamespace . DatabaseName ) ;
157
- db . DropCollection ( DriverTestConfiguration . CollectionNamespace . CollectionName ) ;
158
- var collection = db . GetCollection < BasePerson > ( DriverTestConfiguration . CollectionNamespace . CollectionName ) ;
159
- var bsonCollection =
160
- db . GetCollection < BsonDocument > ( DriverTestConfiguration . CollectionNamespace . CollectionName ) ;
161
-
162
- var person = new DerivedPerson { Id = ObjectId . Parse ( "6797b56bf5495bf53aa3078f" ) , Name = "Mario" , Age = 24 } ;
163
- collection . InsertOne ( person ) ;
164
-
165
- var retrievedAsBson = bsonCollection . FindSync ( "{}" ) . ToList ( ) . Single ( ) ;
166
- var toString = retrievedAsBson . ToString ( ) ;
167
-
168
- var expectedVal =
169
- """{ "_id" : { "$oid" : "6797b56bf5495bf53aa3078f" }, "_t" : "TestDiscriminator", "Name" : "Mario", "Age" : 24 }""" ;
170
- Assert . Equal ( expectedVal , toString ) ;
171
- }
172
- }
173
-
174
128
public class Person
175
129
{
176
130
[ BsonId ] public ObjectId Id { get ; set ; }
0 commit comments